@1conan/anti-captcha
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

anti-captcha

API wrapper for Anti Captcha

Example

import { AntiCaptcha, RecaptchaV2ProxylessResult, TaskType } from '@1conan/anti-captcha';

const ac = new AntiCaptcha('<insert clientKey>');

(async () => {
  const balance = await ac.getBalance();
  console.log(`Balance: ${balance}`);

  const taskId = await ac.createTask({
    type: TaskType.RecaptchaV2Proxyless,
    websiteURL: 'https://example.com',
    websiteKey: '<insert recaptcha public key>',
    isInvisible: true,
  });
  console.log(`Task ID: ${taskId}`);

  const result = await ac.getTaskResult<RecaptchaV2ProxylessResult>(taskId);

  const solvingTime = (result.solvedAt.getTime() - result.createdAt.getTime()) / 1000;

  console.log(`Cost: US$${result.cost}`);
  console.log(`Solving Time: ${solvingTime.toFixed(2)} seconds`);
  console.log(`Result: ${result.gRecaptchaResponse}`);
})();
const { AntiCaptcha, TaskType } = require('@1conan/anti-captcha');

const ac = new AntiCaptcha('<insert clientKey>');

(async () => {
  const balance = await ac.getBalance();
  console.log(`Balance: ${balance}`);

  const taskId = await ac.createTask({
    type: TaskType.RecaptchaV2Proxyless,
    websiteURL: 'https://example.com',
    websiteKey: '<insert recaptcha public key>',
    isInvisible: true,
  });
  console.log(`Task ID: ${taskId}`);

  const result = await ac.getTaskResult(taskId);

  const solvingTime = (result.solvedAt.getTime() - result.createdAt.getTime()) / 1000;

  console.log(`Cost: US$${result.cost}`);
  console.log(`Solving Time: ${solvingTime.toFixed(2)} seconds`);
  console.log(`Result: ${result.gRecaptchaResponse}`);
})();

Package Sidebar

Install

npm i @1conan/anti-captcha

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

24.9 kB

Total Files

31

Last publish

Collaborators

  • 1conan