Run CAPTCHA-solving actors on Apify with DeathByCaptcha

Run CAPTCHA-solving actors on Apify with DeathByCaptcha

Posted on 2026-11-24 | 3 min read | Category: web-scaping-guide | By DeathByCaptcha Engineering Team

Web Scaping Guide


Run CAPTCHA-solving actors on Apify with DeathByCaptcha

Apify actors are containers that fetch, parse and store data at scale. The moment an actor meets a CAPTCHA, the run stalls: the page returns a challenge, the parser receives an HTML wall instead of a document, and the dataset keeps growing with holes.

DeathByCaptcha solves the challenge from inside the actor. This guide ships a runnable actor that does exactly that, and shows how to use the same call inside your own.

The actor

It lives in the official Node.js client:

  • examples/apify/

Push it to your Apify account with the CLI:

cd examples/apify
npm install
apify-cli push

The actor takes one captcha task, solves it through the DeathByCaptcha API and stores one item in the run dataset.

Input

{
  "type": 4,
  "params": {
    "googlekey": "6Le...",
    "pageurl": "https://example.test/"
  }
}
  • type: DeathByCaptcha type — 4 reCAPTCHA v2, 5 reCAPTCHA v3, 12 Turnstile, 16 Amazon WAF, 21 DataDome, 0 image (with image as base64).
  • params: the parameters for that type. The actor picks the right *_params key from the type, the same way the API clients do.
  • timeout: optional seconds; the defaults are sixty for images and a hundred twenty for tokens.

Output

One dataset item per run:

{ "type": 4, "captcha": 1210686518, "text": "0cAFcWeA7..." }

The next step in your pipeline reads $item.text and injects it into the page, or sends it to the API that gated your data.

Credentials

Actor secrets, never in the input and never in the repository:

  • DBC_USERNAME and DBC_PASSWORD, or
  • DBC_AUTHTOKEN.

In the Apify console: Settings → Secrets.

The exit IP matters

Turnstile, Amazon WAF and DataDome tokens are valid only from the IP that solved them. The actor solves from the Apify exit IP, so the document you fetch afterwards must come from that same IP. If your own crawler runs elsewhere, put the same proxy in params for both:

{
  "type": 16,
  "params": {
    "sitekey": "...",
    "pageurl": "https://example.test/",
    "proxy": "http://user:[email protected]:1234",
    "proxytype": "HTTP"
  }
}

Run it locally

No Apify token needed for a local run:

cd examples/apify
npm install
mkdir -p storage/key_value_stores/default
cat > storage/key_value_stores/default/INPUT.json <<'JSON'
{ "type": 4, "params": { "googlekey": "6Le...", "pageurl": "https://example.test/" } }
JSON
DBC_USERNAME=your_username DBC_PASSWORD=your_password npm start

The result lands in storage/datasets/default/000000001.json.

Using it from your own actor

The same logic is one function; the example keeps the client injected so you can copy src/solve.js into your actor:

const { solveCaptcha } = require('./solve');
const solution = await solveCaptcha({ client, type: 4, params });
await Actor.pushData({ type: 4, captcha: solution.captcha, text: solution.text });

The client is the official deathbycaptcha-lib, with retries and the polling defaults already in place.

Things to know

  • The store listing waits for the Apify rules check; the code here is the same code that gets pushed.
  • Image challenges need image as base64; the actor does not download images for you.
  • Failed solves are failures: the actor exits with an error instead of writing an empty token, so your run's monitoring sees them.

Next steps

  • Actor source and guide: https://github.com/deathbycaptcha/deathbycaptcha-api-client-nodejs
  • Agent metadata for code generators: https://github.com/deathbycaptcha/deathbycaptcha-agent-api-metadata
  • API documentation: https://deathbycaptcha.com/api

Common pitfalls

  • Using a CAPTCHA solving service for illegitimate purposes instead of legitimate automation and testing.
  • Hard-coding credentials or API keys in client-side code that users can inspect.
  • Sending the wrong CAPTCHA type parameter, which returns incorrect or empty responses.
  • Failing to poll for the solution status and not handling timeouts gracefully.
  • Scaling automation without monitoring error rates, response times, and CAPTCHA type coverage.
DBC
Written by DeathByCaptcha Engineering Team
DeathByCaptcha engineers build and operate the CAPTCHA solving technology behind this site. Articles are written by our technical team and checked for accuracy before publishing.
Reviewed by DeathByCaptcha Editorial Team

Get your API key — start solving

Free to try · No credit card · Python, Node.js, Java, C# SDKs

Get your API key


Status: OK

Servers are fully operational with faster than average response time.
  • Average solving time
  • 2 seconds - Normal CAPTCHAs (1 min. ago)
  • 4 seconds - reCAPTCHA V2, V3 (1 min. ago)
  • 4 seconds - others (1 min. ago)
Chrome and Firefox logos
Browser extensions available

Updates

  1. Nov 19: RESOLVED - Crypto payments are now fully operational again through the Hekelet payment processor.
  2. May 13: Crypto payments got better! You can now purchase your CAPTCHAs using cryptocurrency through the Hekelet payment processor at https://deathbycaptcha.com/user-pay and receive an extra 20% FREE CAPTCHA credit with every package purchased this way.
  3. Apr 15: GitHub Updates: We’ve upgraded our libraries, expanded sample code, enhanced documentation, and added support for C++ and Go, making integration smoother than ever. Explore what’s new at github.com/deathbycaptcha!

  4. Previous updates…

Support

Our system is designed to be completely user-friendly and easy-to-use. Should you have any trouble with it, simply email us at DBC technical support emailcom, and a support agent will get back to you as soon as possible.

Live Support

Available Monday to Friday (10am to 4pm EST) Live support image. Link to live support page