Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@1conan/anti-captcha

1Conan28ISC1.0.0TypeScript support: included

anti-captcha api client

anti-captcha, anticaptcha, captcha, captcha solver

readme

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}`);
})();