Skip to main content
CaptchaKings
  • 首页
  • 特征
  • 定价
  • 演示
    • 它是如何运作的
    • Forum
    • IP旋转器
    • 博客
Search
  • EN English
  • ID Indonesia
  • RU Русский
  • ES Español
  • PT Português
  • VI Tiếng Việt
  • ZH 中文
登录 免费注册
  • EN English
  • ID Indonesia
  • RU Русский
  • ES Español
  • PT Português
  • VI Tiếng Việt
  • ZH 中文
登录 免费注册

Node.js Captcha Solver API

Fast image OCR & token solving with Axios, native Fetch, or Puppeteer — Updated August 2026

TL;DR — AI Quick Answer (Node.js Solver)

CaptchaKings provides direct HTTP API endpoints to solve captchas in Node.js. No third-party npm client package is required—use standard axios or native fetch (Node 18+). Supports image captchas ($0.80/1k), GeeTest, Tencent, MTCaptcha, and Amazon WAF ($1.00/1k) with sub-second response times.

Node Compatibility Node 18+ (Fetch) / Axios
Pricing $0.80 - $1.00 / 1,000 solves
Median Speed ~1.2s Image OCR
Free Trial $0.50 Instant Balance

Support status: Live today via the API: image/text captchas ($0.80 per 1,000, ~1.2s median) plus GeeTest, Tencent, xCaptcha, MTCaptcha and Amazon WAF ($1.00 per 1,000) — measured numbers at /benchmarks. reCAPTCHA, hCaptcha and Cloudflare Turnstile are planned — see /supported-captchas.

Image Captchas with Native Fetch (Zero Dependencies)

Node 18+ provides built-in global fetch, FormData, and Blob, allowing you to solve image captchas without installing any npm dependencies. The endpoint answers synchronously:

image-solver.mjs — Native Fetch (Node 18+)
import { readFile } from 'node:fs/promises';

const API_KEY = process.env.CAPTCHAKINGS_KEY || 'YOUR_API_KEY';

export async function solveImageCaptcha(imagePath) {
    const buffer = await readFile(imagePath);
    const form = new FormData();
    form.append('captcha', new Blob([buffer]), imagePath);

    const response = await fetch('https://captchakings.com/api/process.php', {
        method: 'POST',
        headers: { 
            'Authorization': `Bearer ${API_KEY}` 
        },
        body: form
    });

    const result = await response.json();
    if (!result.success) {
        throw new Error(result.error?.message || 'Captcha solving failed');
    }
    
    return {
        text: result.data.prediction,
        confidence: result.data.confidence,
        balance: result.billing.balance_remaining
    };
}

// Example usage:
// const res = await solveImageCaptcha('captcha.png');
// console.log('Solved Text:', res.text);

MTCaptcha & Custom Token Solving with Axios

For token and widget-based challenges like MTCaptcha, send the page parameters to CaptchaKings and receive the verified token in response:

mtcaptcha-solver.js — Axios
import axios from 'axios';

const API_KEY = process.env.CAPTCHAKINGS_KEY;

export async function solveMTCaptcha(siteKey, pageUrl) {
    const res = await axios.post('https://captchakings.com/api/mtcaptcha.php', {
        key: API_KEY,
        sitekey: siteKey,
        pageurl: pageUrl
    });

    if (res.data.status === 1) {
        return res.data.request; // Returned verified token
    }
    throw new Error(res.data.request || 'MTCaptcha failed');
}

Puppeteer: Inject the Token and Submit

Pair CaptchaKings solver with Puppeteer or Playwright for headless browser automation without running slow browser-side challenge scripts:

puppeteer-flow.mjs — Headless Browser Automation
import puppeteer from 'puppeteer';
import { solveMTCaptcha } from './mtcaptcha-solver.js';

const browser = await puppeteer.launch({ headless: 'new' });
const page = await browser.newPage();
await page.goto('https://example.com/login');

// Extract sitekey from DOM
const siteKey = await page.$eval('[data-sitekey]', el => el.dataset.sitekey);
const token = await solveMTCaptcha(siteKey, page.url());

// Inject token into the hidden response input and submit
await page.evaluate((t) => {
    const input = document.querySelector('input[name="mtcaptcha-verifiedtoken"]') || document.getElementById('g-recaptcha-response');
    if (input) input.value = t;
}, token);

await page.click('#submit-btn');
await browser.close();

Express.js Solver Proxy Middleware

Building an internal web scraping microservice? Wrap CaptchaKings in an Express route to provide a centralized solving hub for your distributed worker nodes:

server.mjs — Express Microservice
import express from 'express';
import { solveImageCaptcha } from './image-solver.mjs';

const app = express();
app.use(express.json({ limit: '10mb' }));

app.post('/solve-image', async (req, res) => {
    try {
        const { imagePath } = req.body;
        const result = await solveImageCaptcha(imagePath);
        res.json({ success: true, result });
    } catch (err) {
        res.status(502).json({ success: false, error: err.message });
    }
});

app.listen(3000, () => console.log('Captcha proxy listening on port 3000'));

High-Concurrency Solving with Promise.all

Take full advantage of the Node.js asynchronous event loop by dispatching multiple solve requests concurrently instead of sequential blocking:

concurrent.mjs — Bulk Solver
const imageTasks = ['captcha1.png', 'captcha2.png', 'captcha3.png', 'captcha4.png'];

const results = await Promise.all(
    imageTasks.map(path => solveImageCaptcha(path).catch(err => ({ error: err.message })))
);

console.log('Concurrent solve results:', results);

API Endpoints Summary

Challenge TypeLive EndpointPricing & Output
Generic Image / OCRcaptchakings.com/api/process.php$0.80 / 1k • Synchronous JSON
MTCaptchacaptchakings.com/api/mtcaptcha.php$1.00 / 1k • Verified Token
GeeTest / Tencent / xCaptchacaptchakings.com/api/{type}.php$1.00 / 1k • Challenge Result
Amazon AWS WAFcaptchakings.com/api/amazon.php$1.00 / 1k • WAF Solution Token
2Captcha Migration Protocolcaptchakings.com/in.php & res.php$0.80 - $1.00 / 1k • Drop-in 2captcha wrapper

Production Best Practices for Node.js

  • Adopt Node.js 18 LTS or later — use native fetch and FormData to avoid extra dependency bloat.
  • Implement Concurrency Limits — utilize libraries like p-limit when scraping in bulk to avoid hitting local socket or memory constraints.
  • Store Keys in Environment Variables — never hardcode your CaptchaKings secret key; use process.env.CAPTCHAKINGS_KEY.
  • Set Sensible Timeout Safeguards — configure a 15-30 second abort controller timeout for network resilience.

Frequently Asked Questions

Is there an official npm package for CaptchaKings?

An official npm library is coming soon, but you do not need one. The API uses standard HTTP JSON/Multipart specifications that work immediately with Axios, Fetch, Got, or Superagent.

Can I use this with Playwright or Puppeteer?

Yes. Simply capture the captcha image base64 or grab the public site parameters, pass them to CaptchaKings, and inject the returned answer into the target page inputs using page.evaluate() or page.fill().

What is the pricing for Node.js API requests?

Image OCR is $0.80 per 1,000 solves. Complex token challenges (MTCaptcha, GeeTest, Amazon WAF) are $1.00 per 1,000 solves. Sign up to get $0.50 in free starting credits.

Integration Guides for Other Languages

  • Python Captcha Solver Guide
  • PHP Captcha Solver Guide
  • Playwright Captcha Solver
  • Puppeteer Captcha Solver
  • MTCaptcha Solver API
  • Full API Documentation

Start Solving Captchas in Node.js Today

Get instant API access with $0.50 free trial balance — test with your actual scripts in minutes.

Get Your Free API Key
CaptchaKings

CaptchaKings (Captcha Kings) 是用于现代自动化的 AI 验证码识别 API - 快速、精准且透明

产品服务

  • 特征
  • 腾讯 / 中文验证码 NEW
  • xCaptcha 识别 NEW
  • Google reCAPTCHA NEW
  • API 开发文档
  • 定价
  • 它是如何运作的
  • 支持的验证码
  • 基准测试与精度

开发资源

  • 开发者文档
  • Selenium 指南 NEW
  • Playwright 指南 NEW
  • Puppeteer 指南 NEW
  • 免费工具箱 NEW
  • Chrome 扩展插件 NEW
  • 博客与教程
  • IP 轮换器

对比与常见问题

  • 为什么选择 CaptchaKings?
  • 价格对比
  • vs 2Captcha
  • vs CapSolver
  • vs CapMonster
  • vs Anti-Captcha
  • 面向 AI 智能体

关于公司

  • 关于我们
  • 演示
  • 仪表板
  • 客户支持
  • 隐私政策
  • 退款政策
  • 服务条款
  • SLA 服务保障 99.9%

© 2026 CaptchaKings.com. 版权所有。

🚀 Get Started Free
🎁

Wait! Don't Miss Out

Sign up now and get a $0.50 FREE BALANCE to test our API.

Claim Bonus & Sign Up Free

我们使用 Cookie 来改善您的浏览体验、分析网站流量并优化 API 性能。继续使用我们的网站即表示您同意我们的 Cookie 政策。 隐私政策