@captcha-libs/captchaai
v1.0.0
Published
CaptchaAI NodeJS client, captcha recognition service
Downloads
25
Maintainers
Readme
CaptchaAI NodeJS captcha client - use CaptchaAI with ease
Docs: https://docs.captchaai.com
Installation
- npm
$ npm i @captcha-libs/captchaai - pnpm
$ pnpm i @captcha-libs/captchaai - yarn
$ yarn add @captcha-libs/captchaai
Usage
//import CaptchaAI client and desired task
import { CaptchaAI, RecaptchaV2TaskProxyless } from "@captcha-libs/captchaai";
const captchaAIClient = new CaptchaAI({
clientKey: "<YOUR_CLIENT_KEY>",
pollingInterval: 5000, //optional. Delay in milliseconds to fetch task result, default: 5000ms
timeout: 120_000 //optional. Max time in milliseconds to wait for settled task result, default: 120000ms
});
//Pass captcha params to solve
const reCaptchaV2Request = new RecaptchaV2TaskProxyless({
googlekey: "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u",
pageurl: "https://captchaai.com/demo/recaptcha-v2"
});
//returns the solved token or throws an exception
const reCaptchaV2Token = await captchaAIClient.solve(reCaptchaV2Request);
//to get balance
const balance = await captchaAIClient.getBalance()Usage with proxies
const reCaptchaV2Request = new RecaptchaV2Task({
googlekey: "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u",
pageurl: "https://captchaai.com/demo/recaptcha-v2",
//your proxy credentials
proxyAddress: "1.2.3.4", //required. string
proxyPort: 8080, //required. number
proxyType: "http", //required. 'http' or 'socks4' or 'socks5'
proxyLogin: "user", //optional. string
proxyPassword: "p4$$w0rd" //optional. string
});
Features
- TypeScript-first design
- Automatically waits for solution
- Fully tested task payloads
Currently supported task payloads
- Classification:
- Token:
Note: CaptchaAI does not solve hCaptcha, so hCaptcha is intentionally not part of this client.
