@antiadmin/anticaptchaofficial

中文文档
1.0.57发布于 2026/09/24ISCCommonJS近 30 天下载 7.1万

Official Anti-Captcha.com npm library

原始使用文档
文档目录22 节
  1. Official Anti-Captcha.com npm module
  2. Contents
  3. Module installation:
  4. Import and check your balance in sync mode:
  5. Earn with Anti-Captcha
  6. Solve image captcha:
  7. Recaptcha V2 without proxy:
  8. Recaptcha V2 with proxy:
  9. Recaptcha V3:
  10. HCaptcha without proxy:
  11. Turnstile without proxy:
  12. Turnstile with proxy:
  13. AntiGate Tasks:
  14. Funcaptcha / Arkoselabs without proxy:
  15. Funcaptcha / Arkoselabs via proxy:
  16. Geetest version 3 without proxy
  17. Geetest version 4 without proxy
  18. Image to coordinates
  19. Prosopo captcha
  20. Friendly Captcha without proxy:
  21. Amazon WAF:
  22. Altcha captcha without proxy:

Official Anti-Captcha.com npm module

Contents

Official anti-captcha.com npm package for solving images with text, Recaptcha v2/v3 Enterprise/non-Enterpise, Funcaptcha, GeeTest, HCaptcha.

Anti-captcha is an oldest and cheapest web service dedicated to solving captchas by human workers from around the world. By solving captchas with us you help people in poorest regions of the world to earn money, which not only cover their basic needs, but also gives them ability to financially help their families, study and avoid jobs where they're simply not happy.

To use the service you need to register and topup your balance. Prices start from $0.0005 per image captcha and $0.002 for Recaptcha. That's $0.5 per 1000 for images and $2 for 1000 Recaptchas.

For more technical information and articles visit our documentation page.

Module installation:

npm install @antiadmin/anticaptchaofficial

Import and check your balance in sync mode:

(async() => {
    
    const ac = require("@antiadmin/anticaptchaofficial");
    ac.setAPIKey('YOUR_API_KEY');
    try {
        const balance = await ac.getBalance();
        console.log(`my balance is $${balance}`);
        if (balance <= 0) {
            throw "negative balance"
        }
        console.log("solving a captcha..")
        // const token = await ac.solveRecaptchaV2Proxyless('http://DOMAIN.COM', 'WEBSITE_KEY');
        // const fs = require('fs');
        // const text = await ac.solveImage(fs.readFileSync('captcha.png', { encoding: 'base64' }), true)
    } catch (e) {
        console.log("got error: ", e.toString());
    }
    
})();

Or do the same with promises:

const ac = require("@antiadmin/anticaptchaofficial");
ac.setAPIKey('YOUR_API_KEY');
ac.getBalance()
     .then(balance => {
         console.log('my balance is $' + balance)
         if (balance <= 0) {
             return false;
         }
         console.log("solving a captcha..")
         // ac.solveRecaptchaV2Proxyless('http://DOMAIN.COM', 'WEBSITE_KEY')
         //     .then(token => {
         //         console.log('Got g-response:', token)
         //         // do something
         //     })
         //     .catch(error => {
         //         console.log('test received error ' + error)
         //         return false;
         //     });
     })
     .catch(error => console.log('received error '+error))

Disable verbose output to console:

ac.shutUp();

Request subscription credits balance:
const remainingCredits = await ac.getCreditsBalance();

Earn with Anti-Captcha

Specify softId to earn 10% commission from all captcha spendings with your app. Get your softId in Developers Center.

ac.setSoftId(SOFT_ID_NUMBER);

 

Solve image captcha:

const fs = require('fs');
const captcha = fs.readFileSync('captcha.png', { encoding: 'base64' });

// Additional flags, see https://anti-captcha.com/apidoc/task-types/ImageToTextTask for description:
// ac.settings.phrase = true;                  // 2 words
// ac.settings.case = true;                    // case sensitivity
// ac.settings.numeric = 1;                    // only numbers
// ac.settings.comment = "only green letters"; // text comment for workers
// ac.settings.math = true;                    // math operation like 50+2
// ac.settings.minLength = 1;                  // minimum amount of characters
// ac.settings.maxLength = 10;                 // maximum number of characters
// ac.settings.languagePool = 'en';            // language pool
const text = await ac.solveImage(captcha, true);

Report last solved image captcha as incorrect (must read this before using):

await ac.reportIncorrectImageCaptcha();

 

Recaptcha V2 without proxy:

ac.settings.recaptchaDataSValue = 'set me for google.com domains';
const gresponse = ac.solveRecaptchaV2Proxyless('http://DOMAIN.COM', 'WEBSITE_KEY');
console.log('g-response: '+gresponse);
console.log('google cookies:');
console.log(ac.getCookies());
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

Learn what to do with g-response in this article.

Report last solved Recaptcha v2/v3 as incorrect (must read this before using):

await ac.reportIncorrectRecaptcha();

Report Recaptcha v3 as correctly solved (more info here before using):

await ac.reportCorrectRecaptcha();

Recaptcha V2 with proxy:

const gresponse = await ac.solveRecaptchaV2ProxyOn('http://DOMAIN.COM',
    'WEBSITE_KEY',
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD',
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116',
    'some=cookies');

Solve Recaptcha V2-invisible (note the 3rd parameter "true"):

const gresponse = await ac.solveRecaptchaV2Proxyless('http://DOMAIN.COM', 'WEBSITE_KEY', true)
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Recaptcha V3:

const gresponse = await ac.solveRecaptchaV3('http://DOMAIN.COM',
    'WEBSITE_KEY',
    0.3, //minimum score required: 0.3, 0.7 or 0.9
    'PAGE_ACTION_CAN_BE_EMPTY');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

Solve Recaptcha V2 Enterprise without proxy:

const gresponse = await ac.solveRecaptchaV2EnterpriseProxyless(
    'http://DOMAIN.COM', 
    'WEBSITE_KEY', 
    {   //enterprise payload:
        "s" : "SOME_TOKEN",
        "action" : "form_submit"
    },
    false);
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

HCaptcha without proxy:

const token = await ac.solveHCaptchaProxyless('http://DOMAIN.COM', 'WEBSITE_KEY', 'FULL USER AGENT HERE');

// use this userAgent for posting the form with token!
const userAgent = ac.getHcaptchaUserAgent();

//some Hcaptchas also produce "respkey" value, this is how to get it:
const respKey = ac.getHcaptchaRespKey();

Report last solved Hcaptcha as incorrect:

await ac.reportIncorrectHcaptcha();

 

Turnstile without proxy:

const token = await ac.solveTurnstileProxyless('http://DOMAIN.COM', 'WEBSITE_KEY', 'optional_action', 'optional_cData_token');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Turnstile with proxy:

const token = await ac.solveTurnstileProxyOn('http://DOMAIN.COM',
    'WEBSITE_KEY',
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD',
    'optional_action',
    'optional_cData_token');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

AntiGate Tasks:

const solution = await ac.solveAntiGateTask(
    'http://antigate.com/logintest.php', 
    'Sign-in and wait for control text', 
    { 
        "login_input_css": "#login",
        "login_input_value": "the login",
        "password_input_css": "#password",
        "password_input_value": "the password",
        "control_text": "You have been logged successfully" 
    });
console.log('cookies: ', solution.cookies);
console.log('localStorage: ', solution.localStorage);
console.log('url: ', solution.url);

same with a proxy:

const solution = await ac.solveAntiGateTask(
    'http://antigate.com/logintest.php', 
    'Sign-in and wait for control text', 
    { 
        "login_input_css": "#login",
        "login_input_value": "the login",
        "password_input_css": "#password",
        "password_input_value": "the password",
        "control_text": "You have been logged successfully" 
    },
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD');

Send a task with a delayed variable and push it after a few seconds:

const taskId = await ac.sendAntiGateTask('http://antigate.com/logintest2fa.php',
    'Sign-in with 2FA and wait for control text',
    {
        "login_input_css": "#login",
        "login_input_value": "the login",
        "password_input_css": "#password",
        "password_input_value": "the password",
        "2fa_input_css": "#2facode",
        "2fa_input_value": "_WAIT_FOR_IT_",
        "control_text": "You have been logged successfully"
    });
await ac.delay(5000); //simulate a delay in 2FA retrieval
await ac.pushAntiGateVariable('2fa_input_value', '349001');
const solution = await ac.waitForResult(taskId);

console.log('solution:');
console.log(solution);

 

Funcaptcha / Arkoselabs without proxy:

//optional data blob:
ac.settings.funcaptchaDataBlob = 'blob value here is any, or leave it empty';
const token = await ac.solveFunCaptchaProxyless(
    'https://www.thewebsite.com/path',
    'site-key');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Funcaptcha / Arkoselabs via proxy:

//optional data blob:
ac.settings.funcaptchaDataBlob = 'blob value here is any, or leave it empty';
const token = await ac.solveFunCaptchaProxyOn(
    'https://www.thewebsite.com/path',
    'site-key', 
    'http',
    '1.2.3.4',
    3128,
    'proxy-login',
    'proxy-password',
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116',
    '');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Geetest version 3 without proxy

See tutorial how to find these parameters.

const token = await ac.solveGeeTestProxyless(
    'https://www.thewebsite.com/path',
    'gt key 32 bytes',
    'challenge value 32 bytes',
    'optional.api-domain.com');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Geetest version 4 without proxy

See tutorial how to find these parameters.

const token = await ac.solveGeeTestV4Proxyless(
    'https://www.thewebsite.com/path',
    'captchaId key 32 bytes',
    'optional.api-domain.com',
    {
        'riskType': 'slide' //example
    });
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Image to coordinates

const fs = require('fs');
const captcha = fs.readFileSync('captcha.png', { encoding: 'base64' });
const coordinates = await ac.solveImageToCoordinates(captcha, "Select all objects in specified order", "points");

Report last solved image captcha as incorrect:

await ac.reportIncorrectImageCaptcha();

 

Prosopo captcha

const token = await ac.solveProsopoProxyless('http://DOMAIN.COM', 'WEBSITE_KEY');

 

Solve Prosopo captcha with proxy:

const token = await ac.solveProsopoProxyOn('http://DOMAIN.COM',
    'WEBSITE_KEY',
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Friendly Captcha without proxy:

const token = await ac.solveFriendlyCaptchaProxyless('http://DOMAIN.COM', 'WEBSITE_KEY');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Solve Friendly Captcha with proxy:

const token = await ac.solveFriendlyCaptchaProxyOn('http://DOMAIN.COM',
    'WEBSITE_KEY',
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Amazon WAF:

Two options here:

  1. When captcha is at the bot filtering page and you need aws-was-token cookie:

without proxy:

const token = await ac.solveAmazonProxyless('http://DOMAIN.COM', 
    'key_value_from_window.gokuProps_object',
    'iv_value_from_window.gokuProps_object',
    'context_value_from_window.gokuProps_object',
    'https://e9b10f157f38.9a96e8b4.us-gov-west-1.captcha.awswaf.com/e9b10f157f38/76cbcde1c834/2a564e323e7b/captcha.js', //optional
    'https://e9b10f157f38.9a96e8b4.us-gov-west-1.token.awswaf.com/e9b10f157f38/76cbcde1c834/2a564e323e7b/challenge.js'  //optional
); 
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

with proxy:

const token = await ac.solveAmazonProxyOn('http://DOMAIN.COM',
    'key_value_from_window.gokuProps_object',
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD',
    'iv_value_from_window.gokuProps_object',
    'context_value_from_window.gokuProps_object',
    'https://e9b10f157f38.9a96e8b4.us-gov-west-1.captcha.awswaf.com/e9b10f157f38/76cbcde1c834/2a564e323e7b/captcha.js', //optional
    'https://e9b10f157f38.9a96e8b4.us-gov-west-1.token.awswaf.com/e9b10f157f38/76cbcde1c834/2a564e323e7b/challenge.js'  //optional
);
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());
  1. When captcha is a standalone widget which is triggered by user's action:

without proxy:

const token = await ac.solveAmazonWidgetProxyless('http://DOMAIN.COM', 
    'widget_api_key',     // get key from AwsWafCaptcha.renderCaptcha function
    'https://164cb210e333.edge.captcha-sdk.awswaf.com/164cb210e333/jsapi.js' // full path to jsapi.js integration script
); 
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

with proxy:

const token = await ac.solveAmazonWidgetProxyOn('http://DOMAIN.COM',
    'widget_api_key',
    'https://164cb210e333.edge.captcha-sdk.awswaf.com/164cb210e333/jsapi.js', // full path to jsapi.js integration script
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD'
);
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

For more details visit Anti-Captcha Amazon WAF documentation.


 

Altcha captcha without proxy:

// with challenge URL:
const token = await ac.solveAltchaProxyless('http://DOMAIN.COM', '/some/challenge/url');

// with challenge JSON retrieved from challengeurl:
const token = await ac.solveAltchaProxyless('http://DOMAIN.COM', '', '{"algorithm":"SHA-256","challenge":"2a40f7ba3393f9513011179de41c7221f14e563856de2f647233a00accf9c28b","salt":"08d7f273d79df143355b9e5n","signature":"1de2bbf282420aef6ca0a84c38c85e2b1e40023d28bef72278d735555a8f47fb"}');
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Solve Altcha captcha with proxy:

// with challenge URL:
const token = await ac.solveAltchaProxyOn('http://DOMAIN.COM',
    '/some/challenge/url',
    null,
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD');

// with challenge JSON retrieved from challengeurl:
const token = await ac.solveAltchaProxyOn('http://DOMAIN.COM',
    '',
    '{"algorithm":"SHA-256","challenge":"2a40f7ba3393f9513011179de41c7221f14e563856de2f647233a00accf9c28b","salt":"08d7f273d79df143355b9e5n","signature":"1de2bbf282420aef6ca0a84c38c85e2b1e40023d28bef72278d735555a8f47fb"}',
    'http', //http, socks4, socks5
    'PROXY_IP',
    'PROXY_PORT',
    'PROXY_LOGIN',
    'PROXY_PASSWORD');

// in case you need it and it is available:
console.log('worker\'s user-agent:');
console.log(ac.getUserAgent());

 

Other available task types with similar method calls, see source code:

await ac.solveRecaptchaV2EnterpriseProxyOn( ... ); //Recaptcha V2 Enterprise with proxy
await ac.solveRecaptchaV3Enterprise( ... ); //Recaptcha V3 Enterprise
await ac.solveHCaptchaProxyOn( ... ); //hCaptcha with proxy
await ac.solveGeeTestProxyOn( ... ); //Solve Geetest with proxy
await ac.solveGeeTestV4ProxyOn( ... ); //Bypass Geetest V4 with proxy

版本与发布记录

@antiadmin/anticaptchaofficial 共发布 57 个版本,首次发布于 2020/09/19;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.0.57latest2026/09/241 个月前
1.0.562026/06/184 个月前
1.0.552025/10/181.1 年前
1.0.542025/10/011.1 年前
1.0.532025/07/051.3 年前
1.0.522025/05/211.5 年前

关于 @antiadmin/anticaptchaofficial 的常见问题

@antiadmin/anticaptchaofficial 是什么?

Official Anti-Captcha.com npm library

如何安装 @antiadmin/anticaptchaofficial?

在项目目录运行 npm install @antiadmin/anticaptchaofficial,或使用 pnpm add / yarn add / bun add。

@antiadmin/anticaptchaofficial 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/antiadmin__anticaptchaofficial 是否存在。

@antiadmin/anticaptchaofficial 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@antiadmin/anticaptchaofficial 可以商用吗?

@antiadmin/anticaptchaofficial 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@antiadmin/anticaptchaofficial 的下载量有多少?

根据 npm 官方下载统计,@antiadmin/anticaptchaofficial 在 2026/10/06 – 2026/11/04 这 30 天内被下载 71,309 次,日均约 2,377 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@antiadmin/anticaptchaofficial 还在维护吗?

最新版本 1.0.57 发布于 2026/09/24(1 个月前);至今共发布 57 个版本,其中过去 12 个月发布了 2 个;首次发布于 2020/09/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。