Download the PHP package deathbycaptcha/deathbycaptcha-api-php without Composer

On this page you can find all versions of the php package deathbycaptcha/deathbycaptcha-api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package deathbycaptcha-api-php

DeathByCaptcha

Python Node.js .NET Java PHP Perl C C++ Go

📖 Introduction

The DeathByCaptcha PHP client is the official library for DeathByCaptcha — a trusted bypass captcha service used across thousands of automation pipelines. It provides a simple, well-documented interface that works as a captcha solver for bots, web scrapers, and any workflow where CAPTCHAs block access to the data you need. It supports both the HTTPS API (encrypted transport — recommended when security is a priority) and the socket-based API (faster and lower latency, recommended for high-throughput production workloads). Compatible with PHP 7.4+.

Key features:

Quick start example (HTTP):

🚌 Transport options: Use DeathByCaptcha_HttpClient for encrypted HTTPS communication — credentials and data travel over TLS. Use DeathByCaptcha_SocketClient for lower latency and higher throughput — it is faster but communicates over a plain TCP connection to api.dbcapi.me on ports 8123–8130.


Tests Status

Tests Coverage


🗂️ Index

🛠️ Installation

📦 From Composer (Recommended)

🐙 From GitHub Repository

For the latest development version or to contribute:

Then include the library in your PHP script:

See INSTALL.md for full requirements and setup details.

🚀 How to Use DBC API Clients

🔌 Common Clients' Interface

All clients must be instantiated with your DeathByCaptcha credentials — username and password. Replace DeathByCaptcha_HttpClient with DeathByCaptcha_SocketClient to use the socket transport instead.

Transport Class Best for
HTTPS DeathByCaptcha_HttpClient Encrypted TLS transport — safer for credential handling and network-sensitive environments
Socket DeathByCaptcha_SocketClient Plain TCP — faster and lower latency, recommended for high-throughput production workloads

All clients share the same interface. Below is a summary of every available method and its pseudo-code signature.

Method Signature Returns Description
upload() upload($captchaFile) array or NULL Upload a CAPTCHA for solving without waiting. $captchaFile is a file path or open file resource; pass type-specific params as second array argument.
decode() decode($captcha=null, $extra=[], $timeout=null) array or NULL Upload and poll until solved or timed out. Preferred method for most integrations.
get_captcha() get_captcha($captchaId) array or NULL Fetch status and result of a previously uploaded CAPTCHA by its numeric ID.
report() report($captchaId) bool Report a CAPTCHA as incorrectly solved to request a refund. Only report genuine errors.
get_balance() get_balance() float Return the current account balance in US cents.

📬 CAPTCHA Result Object

All methods that return a solved CAPTCHA return an associative array with the following keys:

Key Type Description
"captcha" int Numeric CAPTCHA ID assigned by DBC
"text" string Solved text or token (the value you inject into the page)
"is_correct" bool Whether DBC considers the solution correct

💡 Full Usage Example

🔑 Credentials & Configuration

For detailed information about setting up credentials for different CI environments:

⚡ Quick Setup

See QUICKSTART.md for a step-by-step introduction.

🧩 CAPTCHA Types Quick Reference & Examples

This section covers every supported CAPTCHA type, how to run the corresponding example scripts, and ready-to-copy code snippets. Start with the Quick Start below, then use the Type Reference to find the type you need.

🏁 Quick Start

  1. 📦 Install the library (see Installation)
  2. 📂 Navigate to the examples/ directory and run the script for the type you need:

⚠️ Always run examples from the examples/ directory so the images/ folder is accessible to scripts that need it.

Before running any script, add your DBC credentials inside it:

📋 Type Reference

The table below maps every supported type to its use case, a code snippet, and the corresponding example file in examples/.

Type ID CAPTCHA Type Use Case Quick Use PHP Sample
0 Standard Image Basic image CAPTCHA snippet open
2 reCAPTCHA Coordinates Deprecated — do not use for new integrations
3 reCAPTCHA Image Group Deprecated — do not use for new integrations
4 reCAPTCHA v2 Token reCAPTCHA v2 token solving snippet open
5 reCAPTCHA v3 Token reCAPTCHA v3 with risk scoring snippet open
25 reCAPTCHA v2 Enterprise reCAPTCHA v2 Enterprise tokens snippet open
8 GeeTest v3 Geetest v3 verification snippet open
9 GeeTest v4 Geetest v4 verification snippet open
11 Text CAPTCHA Text-based question solving snippet open
12 Cloudflare Turnstile Cloudflare Turnstile token snippet open
13 Audio CAPTCHA Audio CAPTCHA solving snippet open
14 Lemin Lemin CAPTCHA snippet open
15 Capy Capy CAPTCHA snippet open
16 Amazon WAF Amazon WAF verification snippet open
17 Siara Siara CAPTCHA snippet open
18 MTCaptcha Mtcaptcha CAPTCHA snippet open
19 Cutcaptcha Cutcaptcha CAPTCHA snippet open
20 Friendly Captcha Friendly Captcha snippet open
21 DataDome Datadome verification snippet open
23 Tencent Tencent CAPTCHA snippet open
24 ATB ATB CAPTCHA snippet open

📝 Per-Type Code Snippets

Minimal usage snippet for each supported type. Use these as a starting point and refer to the full example files in examples/ for complete implementations.

🖼️ Sample Type 0: Standard Image

Official description: Supported CAPTCHAs Full sample: example.Normal_Captcha.php


🤖 Sample Type 4: reCAPTCHA v2 Token

Official description: reCAPTCHA Token API (v2) Full sample: example.reCAPTCHA_v2.php


🤖 Sample Type 5: reCAPTCHA v3 Token

Official description: reCAPTCHA v3 Full sample: example.reCAPTCHA_v3.php


🏢 Sample Type 25: reCAPTCHA v2 Enterprise

Official description: reCAPTCHA v2 Enterprise Full sample: example.reCAPTCHA_v2_Enterprise.php


🧩 Sample Type 8: GeeTest v3

Official description: GeeTest Full sample: example.Geetest_v3.php


🧩 Sample Type 9: GeeTest v4

Official description: GeeTest Full sample: example.Geetest_v4.php


💬 Sample Type 11: Text CAPTCHA

Official description: Text CAPTCHA Full sample: example.Textcaptcha.php


☁️ Sample Type 12: Cloudflare Turnstile

Official description: Cloudflare Turnstile Full sample: example.Turnstile.php


🔊 Sample Type 13: Audio CAPTCHA

Official description: Audio CAPTCHA Full sample: example.Audio.php


🔵 Sample Type 14: Lemin

Official description: Lemin Full sample: example.Lemin.php


🏴 Sample Type 15: Capy

Official description: Capy Full sample: example.Capy.php


🛡️ Sample Type 16: Amazon WAF

Official description: Amazon WAF Full sample: example.Amazon_Waf.php


🔍 Sample Type 17: Siara

Official description: Siara Full sample: example.Siara.php


🔒 Sample Type 18: MTCaptcha

Official description: MTCaptcha Full sample: example.Mtcaptcha.php


✂️ Sample Type 19: Cutcaptcha

Official description: Cutcaptcha Full sample: example.Cutcaptcha.php


💚 Sample Type 20: Friendly Captcha

Official description: Friendly Captcha Full sample: example.Friendly.php


� Sample Type 21: DataDome

Official description: DataDome Full sample: example.Datadome.php


🔷 Sample Type 23: Tencent

Official description: Tencent Full sample: example.Tencent.php


🏷️ Sample Type 24: ATB

Official description: ATB Full sample: example.Atb.php

📚 CAPTCHA Types Extended Reference

Full API-level documentation for selected CAPTCHA types: parameter references, payload schemas, request/response formats, token lifespans, and integration notes.

⛔ reCAPTCHA Image-Based API — Deprecated (Types 2 & 3)

⚠️ Deprecated. Types 2 (Coordinates) and 3 (Image Group) are legacy image-based reCAPTCHA challenge methods that are no longer used at captcha solving. Do not use them for new integrations — use the reCAPTCHA Token API (v2 & v3) instead.


🔐 reCAPTCHA Token API (v2 & v3)

The Token-based API solves reCAPTCHA challenges by returning a token you inject directly into the page form, rather than clicking images. Given a site URL and site key, DBC solves the challenge on its side and returns a token valid for one submission.


❓ reCAPTCHA v2 API FAQ

What's the Token Image API URL? To use the Token Image API you will have to send a HTTP POST Request to http://api.dbcapi.me/api/captcha

What are the POST parameters for the Token image API?

The proxy parameter is optional, but we strongly recommend to use one to prevent token rejection by the provided page due to inconsistencies between the IP that solved the captcha (ours if no proxy is provided) and the IP that submitted the token for verification (yours). Note: If proxy is provided, proxytype is a required parameter.

Full example of token_params:

Example of token_params for google search captchas:

What's the response from the Token image API? The token image API response has the same structure as regular captchas' response. Refer to Polling for uploaded CAPTCHA status for details about the response. The token will come in the text key of the response. It's valid for one use and has a 2 minute lifespan. It will be a string like the following:


🔎 What is reCAPTCHA v3?

This API extends the reCAPTCHA v2 Token API with two additional parameters: action and minimal score (min_score). reCAPTCHA v3 returns a score from each user, that evaluate if user is a bot or human. Then the website uses the score value that could range from 0 to 1 to decide if will accept or not the requests. Lower scores near to 0 are identified as bot. The action parameter at reCAPTCHA v3 is an additional data used to separate different captcha validations like for example login, register, sales, etc.


❓ reCAPTCHA v3 API FAQ

What is action in reCAPTCHA v3? Is a new parameter that allows processing user actions on the website differently. To find this we need to inspect the javascript code of the website looking for call of grecaptcha.execute function. Example:

Sometimes it's really hard to find it and we need to look through all javascript files. We may also try to find the value of action parameter inside ___grecaptcha_cfg configuration object. Also we can call grecaptcha.execute and inspect javascript code. The API will use "verify" default value it if we won't provide action in our request.

What is min-score in reCAPTCHA v3 API? The minimal score needed for the captcha resolution. We recommend using the 0.3 min-score value, scores highers than 0.3 are hard to get.

What are the POST parameters for the reCAPTCHA v3 API?

The proxy parameter is optional, but we strongly recommend to use one to prevent rejection by the provided page due to inconsistencies between the IP that solved the captcha (ours if no proxy is provided) and the IP that submitted the solution for verification (yours). Note: If proxy is provided, proxytype is a required parameter.

Full example of token_params:

What's the response from reCAPTCHA v3 API? The response has the same structure as regular captcha. Refer to Polling for uploaded CAPTCHA status for details about the response. The solution will come in the text key of the response. It's valid for one use and has a 1 minute lifespan.


🛡️ Amazon WAF API (Type 16)

Amazon WAF Captcha (also referred to as AWS WAF Captcha) is part of the Intelligent Threat Mitigation system within Amazon AWS. It presents image-alignment challenges that DBC solves by returning a token you set as the aws-waf-token cookie on the target page.

API URL: Send a HTTP POST request to http://api.dbcapi.me/api/captcha

POST parameters:

waf_params payload fields:

Parameter Required Description
proxy Optional* Proxy URL with credentials. E.g. http://user:[email protected]:3128
proxytype Required if proxy set Proxy protocol. Currently only HTTP is supported.
sitekey Required Amazon WAF site key found in the page's captcha script (value of the key parameter)
pageurl Required Full URL of the page showing the Amazon WAF challenge (must include the path)
iv Required Value of the iv parameter found in the captcha script on the page
context Required Value of the context parameter found in the captcha script on the page
challengejs Optional URL of the challenge.js script referenced on the page
captchajs Optional URL of the captcha.js script referenced on the page

The proxy parameter is optional but strongly recommended — using a proxy prevents token rejection caused by IP inconsistencies between the solving machine (DBC) and the submitting machine (yours). 📌 Note: If proxy is provided, proxytype is required.

Full example of waf_params:

With optional challengejs and captchajs:

Response: The API returns a token string valid for one use with a 1-minute lifespan. Once received, set it as the aws-waf-token cookie on the target page before submitting the form:


🌐 Cloudflare Turnstile API (Type 12)

Cloudflare Turnstile is a CAPTCHA alternative that protects pages without requiring user interaction in most cases. DBC solves it by returning a token you inject into the target form or pass to the page's callback.

API URL: Send a HTTP POST request to http://api.dbcapi.me/api/captcha

POST Parameter Description
username Your DBC account username
password Your DBC account password
type 12 — specifies this is a Turnstile API request
turnstile_params JSON-encoded payload (see fields below)

turnstile_params payload fields:

Field Required Description
proxy Optional Proxy URL with optional credentials. E.g. http://user:[email protected]:3128
proxytype Required if proxy set Proxy connection protocol. Currently only HTTP is supported.
sitekey Required The Turnstile site key found in data-sitekey attribute, the captcha iframe URL, or the turnstile.render call. E.g. 0x4AAAAAAAGlwMzq_9z6S9Mh
pageurl Required Full URL of the page hosting the Turnstile challenge, including path. E.g. https://testsite.com/xxx-test
action Optional Value of the data-action attribute or the action option passed to turnstile.render.

📌 Note: The proxy parameter is optional but strongly recommended to avoid rejection due to IP inconsistency between the solver and the submitter. If proxy is provided, proxytype becomes required.

Example turnstile_params (basic):

Example turnstile_params with optional action:

Response: The API returns a token string valid for one use with a 2-minute lifespan. Submit it via the input[name="cf-turnstile-response"] field (or input[name="g-recaptcha-response"] when reCAPTCHA compatibility mode is enabled), or pass it to the callback defined in turnstile.render / data-callback:


⚙️ Continuous Integration

This project is configured for automated testing on multiple platforms:

GitHub Actions

GitLab CI/CD

Both CI systems run the full test suite (74 tests, 158 assertions) on every push and pull request, ensuring compatibility across PHP versions 7.4+.


Test Status by PHP Version

PHP Version Status
7.4 LTS PHP 7.4
8.1 LTS PHP 8.1
8.3 PHP 8.3

Code Quality

Check Status
Integration Tests Integration
PHP Linting Lint
PHPStan Analysis PHPStan

⚖️ Responsible Use

See Responsible Use Agreement.


All versions of deathbycaptcha-api-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package deathbycaptcha/deathbycaptcha-api-php contains the following files

Loading the files please wait ...