https://www.captchaai.io/ - simple captchaai API (next 2captcha) tasks handler for node

Overview

captchaai.io api 🧠 task handler

Want you to get captcha verified tokens with a simple function call in you node application?

Just install axios and run with this repo. You will find a fast way to perform web testing (and simple automations).

1.2.0 - captchaai-npm 1.2.0 - captchaai-npm

Install

npm i captchaai-npm

Usage

  1. Import module.

import Captchaai from 'captchaai-npm'; // import as ES6 module

const Captchaai = require('captchaai-npm'); // using require

  1. Declare singleton/handler.

const captchaai = new Captchaai('CAI-XXXXXXXXXXXXXXXXXXXXXXXXX', 1);

👀 There are 2 different versions in order to handle task results:

Version 1: fast-bind methods

balance check + .hcaptchaproxyless() example:

import Captchaai from 'captchaai-npm';  // import as ES6 module
const handler = new Captchaai('CAI-XXXXXXXXXXXXXXXXXXXXXXXXX', 1);
let b = await handler.balance()
if(b > 0){  // usd balance
    await handler.hcaptchaproxyless('https://websiteurl.com/', '000000-000000000-0000000')
        .then(async r => {
            if(r.error === 0)
                console.log('got token!\n' + JSON.stringify(r.apiResponse));
        })
}

Version 2: .runAnyTask(taskData)

proxyless example

import Captchaai from 'captchaai-npm';
const handler = new Captchaai('CAI-XXXXXXXXXXXXXXXXXXXXXXXXX', 1);
const taskData =
    { type : 'HCaptchaTaskProxyless', websiteURL : 'https://website.com/', websiteKey : '000000-00000-000000-000000000' }
handler.runAnyTask(taskData).then(response => { console.log(response); });

proxyInfo example

import Captchaai from 'captchaai-npm';
const handler = new Captchaai('CAI-XXXXXXXXXXXXXXXXXXXXXXXXX', 1);
const taskData =
    { type : 'HCaptchaTask', websiteURL : 'https://website.com/', websiteKey : '000000-00000-000000-000000000',
            proxyInfo: {
                "proxyType": 'http',
                "proxyAddress": 'proxy.provider.io',
                "proxyPort": 32221,
                "proxyLogin": "******",
                "proxyPassword": "************"
            }
    }
handler.runAnyTask(taskData).then(response => { console.log(response); });

What its returned

All methods returns response with a simple schema described below.

Parameter Type Description
error number [-1] Request or captcha error. [0] Success solving.
statusText string A composed string that includes http status.
apiResponse object Captchaai response. Task result.

success object example

{
  error: 0,
  statusText: '200 OK',
  apiResponse: {
    errorId: 0,
    taskId: '4e6c33f5-bc14-44d0-979e-d5f37b072c59',
    status: 'ready',
    solution: {
      gRecaptchaResponse: '03AIIukzgCys9brSNnrVbwXE9mTesvkxQ-ocK ...'
    }
  }
}

invalid task example

{
  error: -1,
  statusText: '400 Bad Request',
  apiResponse: {
        errorCode: "ERROR_INVALID_TASK_DATA",
        errorDescription: "clientKey error",
        errorId: 1
    }
}

Supported API methods

Each method is a easy way to launch and handle a request to captchaai API so you have to pass some args which mostly are of type string or type object. Anycase, this is described in captchaai docs page. reffered docs.

Method Returns
await handler.runAnyTask(taskData) handle tasks for a determined taskData. In order to build this object, use !reffered docs and check parameters by catpcha task type
  • taskData examples are shown above.

  • proxy credentials must be passed as proxyInfo schema shown above too.

balance

Method Returns
await handler.balance() directly the float value or an error object
await handler.getBalance() succes or error object

hcaptcha

pass null instead of empty

Method
await handler.hcaptcha(websiteURL, websiteKey, proxyInfo, userAgent=null, isInvisible=null, enterprisePayload=null)
await handler.hcaptchaproxyless(websiteURL, websiteKey, userAgent=null, isInvisible=null, enterprisePayload=null)

recaptcha

Method
await handler.recaptchav2(websiteURL, websiteKey, proxyInfo, userAgent=null, isInvisible=null, recaptchaDataSValue=null, cookies=null)
await handler.recaptchav2proxyless(websiteURL, websiteKey, userAgent=null, isInvisible=null, recaptchaDataSValue=null, cookies=null)
await handler.recaptchav2enterprise(websiteURL, websiteKey, proxyInfo, userAgent=null, enterprisePayload=null, apiDomain=null, cookies=null)
await handler.recaptchav2enterpriseproxyless(websiteURL, websiteKey, userAgent=null, enterprisePayload=null, apiDomain=null, cookies=null)
await handler.recaptchav3(websiteURL, websiteKey, proxyInfo, pageAction, minScore=null)
await handler.recaptchav3proxyless(websiteURL, websiteKey, pageAction, minScore=null)

datadome

Method
await handler.datadome(websiteURL, userAgent, captchaUrl, proxyInfo)

funcaptcha

Method
await handler.funcaptcha(websiteURL, websitePublicKey, proxyInfo, funcaptchaApiJSSubdomain, userAgent = null, data=null)
await handler.funcaptchaproxyless(websiteURL, websitePublicKey, funcaptchaApiJSSubdomain, userAgent = null, data=null)

geetest

Method
await handler.geetest(websiteURL, gt, challenge, geetestApiServerSubdomain, proxyInfo, version=null, userAgent=null, geetestGetLib=null, initParameters=null)
await handler.geetestproxyless(websiteURL, gt, challenge, geetestApiServerSubdomain, version=null, userAgent=null, geetestGetLib=null, initParameters=null)

currently unsupported methods:

ReCaptchaV2Classification

HCaptchaClassification

It has not been tested in larger workloads or in a multithreading environment. (supposed to come soon, appreciate any feedback 🙏 )

Verbose level

When singleton is initialized, verbose level must be passed as 2nd argument. Default is 0.

new Captchaai('CAI-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 1);

Verbose level undefined: Dont print logs, just get response.

Verbose level 1: Print logs about performed requests during execution.

Verbose level 2: Appends full captchaai api response in verbose level 1 outputs.

More code examples

! Building fast test-project with captchaai-npm

proxyInfo use example:

import Captchaai from 'captchaai-npm';
const captchaai = new Captchaai('CAI-XXXXXXXXXXXXXXXXXXXXXXXXX');
await captchaai.recaptchav3(
    'https://websiteurl.com/', '0000000000000_0000000',
    {	// proxyInfo
        "proxyType": 'http', "proxyAddress": 'proxy.provider.io', "proxyPort": 32221, "proxyLogin": "******", "proxyPassword": "************"
    }
    ,'sign_in'	// required in recaptchav3
).then(response => { console.log(response); })
You might also like...

To Do list is a small but useful project to make list app , you can add tasks delete tasks and modify tasks, the project built using HTML, CSS, JavaScript

Project Name The To-Do-List app description this is a project in the second week of the second module in microverse. its a useful to do list that save

Jul 25, 2022

The Remix version of the fakebooks app demonstrated on https://remix.run. Check out the CRA version: https://github.com/kentcdodds/fakebooks-cra

Remix Fakebooks App This is a (very) simple implementation of the fakebooks mock app demonstrated on remix.run. There is no database, but there is an

Dec 22, 2022

nest연습용 (w. https://github.com/seuiggi, https://github.com/okysky1121)

A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

Oct 5, 2022

A simple to-do app for managing daily tasks built with Webpack, JavaScript, HTML, and CSS with the functionality to manipulate multiple completed tasks and store them to local storage.

A simple to-do app for managing daily tasks built with Webpack, JavaScript, HTML, and CSS with the functionality to manipulate multiple completed tasks and store them to local storage.

TODO LIST APP In this project, I have built a simple HTML list of To Do tasks. The list is styled according to the listed specifications . This simple

Jun 7, 2022

This is simple To-Do App for managing the daily tasks and to keep track on tasks during the day.

This is simple To-Do App for managing the daily tasks and to keep track on tasks during the day.

Event Page Todo List. This is simple To-Do App for managing the daily tasks and to keep track on tasks during the day. Built With HTML CSS JavaScript

Mar 9, 2022

A simple HTML list of To Do tasks built using webpack, JS ES6 and CSS. This app allows users to add and delete tasks to organize their days.

To-Do List "To-do list" is an app that helps to organize your day. It simply lists the things that you need to do and allows you to mark them as compl

Sep 26, 2022

A simple To-do app project made using JavaScript ES6 and Webpack - Microverse. You can add, remove, check tasks, and remove all the tasks that were done at the same time. Feel free to see the live version, if you like it please give it a star!

To Do List a to do list javascript app buit using webpack and es6. Built With HTML CSS JavaScript Wepack Live Demo (if available) Live Demo Link Getti

Dec 17, 2022

🤖 Makes it easy to create bots on discord through a simple command handler

🤖 Makes it easy to create bots on discord through a simple command handler

MyBotHelper.JS 📚 About facilitates the creation of bots via discord.js, the repository already has a main script that automatically synchronizes and

Dec 31, 2022
Owner
qwertyy
tell me any incovenient about the repo 💔qwertyy#0001
qwertyy
This is a To-Do List. It shows a minimalist design with the next features: Add new tasks, edit tasks, markup completed tasks, and erase all completed tasks. Built with JavaScript.

Project Name To Do List Built With HTML CSS JavaScript Live Demo To do List Live Demo Link Getting Started This is a To Do List. It shows a minimalist

Santiago Cárdenas 6 Jun 9, 2022
A simple JS To Do List bundled using Webpack. You can add new tasks, edit existing tasks, check completed tasks, and delete tasks from the list. It is built mainly with Javascript.

To-Do-List A simple HTML list of To Do built using webpack and served by a webpack dev server. Live Link See Demo Built With HTML, CSS, Javascript To

Michael Ugochukwu 3 May 10, 2022
DiscordJs13-handler is the solution for all the discord.js developper who want a complete handler for slash commands

DiscordJs13-handler is the solution for all the discord.js developper who want a complete handler for slash commands

null 9 Jul 2, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A simple to do list app built with HTML, CSS and JavaScript. Users can add daily tasks, edit the tasks, delete the tasks when it's done

To Do List This is a website that allows users to manage the tasks. users can add every task to do and when the task is done users can delete the task

Mustafa Fahimy 8 Jul 21, 2022
A to do list where you can add tasks, mark completed tasks and clear all completed tasks.

To Do List A to do list where you can add tasks, mark completed tasks and clear all completed tasks. You can rearrange the order of the tasks by doubl

Amira 7 Mar 4, 2022
Grayce Muthui 8 Jun 16, 2022