- SEASONAL PROMO - As of Jan 24, the hCAPTCHA rate has been decreased to $1.79/1K!!!
Now supporting New reCAPTCHA/noCAPTCHA API!
Now supporting Geetest challenges!
New support for Funcaptcha!
New support for Hcaptcha!
Death By Captcha also supports DeCaptcher API (both socket and HTTP), Antigate (Anti-Captcha) and 2captcha API!
Death By Captcha API also supports Token authentication (both socket and HTTP), Learn how to use token authentication with our API
Death By Captcha API
Latest version: 4.6
- .NET (C#, Visual Basic)
- C# Selenium
- AutoIt3
- iMacros
- C (client and libs' source code)
- Java
- Maven
- Java Selenium
- Perl 5+
- PHP v5+
- Python v2.5+ and v3.0+
- Python3 client library from pypi
- Python3 Selenium
- Node.js v8.12.0+
- NodeJS Selenium
- Command-line tool for Windows, Linux (i386 and x86-64) (see usage note below)
How to use our API clients
Download the latest client, add it to your application and write something along the lines below, f.i in PHP:
require_once 'deathbycaptcha.php';
// Put your DBC credentials here.
// Use DeathByCaptcha_HttpClient class if you want to use HTTP API.
$client = new DeathByCaptcha_SocketClient(USERNAME, PASSWORD);
// Put the CAPTCHA file name or handler,
// and desired timeout (in seconds) here:
if ($captcha = $client->decode(CAPTCHA_FILE_NAME, TIMEOUT)) {
echo $captcha['text'] . "\n";
// Report the CAPTCHA if solved incorrectly.
// Make sure the CAPTCHA was in fact incorrectly solved!
if ( ... ) {
$client->report($captcha['captcha']);
}
}
// Repeat for other CAPTCHAs
…or using token Authentication in PHP:
require_once 'deathbycaptcha.php';
// Put your DBC credentials here.
// Use DeathByCaptcha_HttpClient class if you want to use HTTP API.
// To use token username must be authtoken.
$client = new DeathByCaptcha_SocketClient("authtoken", token-from-panel);
// Put the CAPTCHA file name or handler,
// and desired timeout (in seconds) here:
if ($captcha = $client->decode(CAPTCHA_FILE_NAME, TIMEOUT)) {
echo $captcha['text'] . "\n";
// Report the CAPTCHA if solved incorrectly.
// Make sure the CAPTCHA was in fact incorrectly solved!
if ( ... ) {
$client->report($captcha['captcha']);
}
}
// Repeat for other CAPTCHAs
…or in C#:
We are using command line dotnet 6+
// Do not forget to reference DeathByCaptcha.dll in your project!
using DeathByCaptcha;
// Put your DBC credentials here.
// Use HttpClient class if you want to use HTTP API.
Client client = (Client) new SocketClient(USERNAME, PASSWORD);
// Put your CAPTCHA file name, stream, or vector of bytes,
// and desired timeout (in seconds) here:
Captcha captcha = client.Decode(CAPTCHA_FILE_NAME, TIMEOUT);
if (captcha.Solved && captcha.Correct) {
Console.WriteLine("CAPTCHA {0}: {1}", captcha.Id, captcha.Text);
// Report the CAPTCHA if solved incorrectly.
// Make sure the CAPTCHA was in fact incorrectly solved!
if ( ... ) {
client.Report(captcha);
}
}
// Repeat for other CAPTCHAs
Do the following comands in the folder whith the README.md file
to run the example:
dotnet new console to create a new project
In your configuration file (it should be something along the lines of
"dbc_api_[version].csproj") add the following line
inside the PropertyGroup tag.
<StartupObject>DeathByCaptcha.[Example]</StartupObject>
Where [Example] is the name of the file with the example you want to run.
So, to run the Funcaptcha example from Funcaptcha.cs
our configuration file should look like this.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<StartupObject>DeathByCaptcha.FuncaptchaExample</StartupObject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
dotnet build to build the project
dotnet run to run the project
dotnet clean to clean the project
Refer to the .Net SDK help for more information
NOTE: If you find an error during the build, delete your "Program.cs"
file in case it's present in your project.
To build the project with mono
follow the instructions in the Makefile-mono file
…or using token authentication in C#:
// Do not forget to reference DeathByCaptcha.dll in your project!
using DeathByCaptcha;
// Put your DBC credentials here.
// Use HttpClient class if you want to use HTTP API.
// Using token authentication in C#/VB, username must be authtoken.
Client client = (Client) new SocketClient("authtoken", token-from-panel);
// Put your CAPTCHA file name, stream, or vector of bytes,
// and desired timeout (in seconds) here:
Captcha captcha = client.Decode(CAPTCHA_FILE_NAME, TIMEOUT);
if (captcha.Solved && captcha.Correct) {
Console.WriteLine("CAPTCHA {0}: {1}", captcha.Id, captcha.Text);
// Report the CAPTCHA if solved incorrectly.
// Make sure the CAPTCHA was in fact incorrectly solved!
if ( ... ) {
client.Report(captcha);
}
}
In the folder where .csproj file is located
Do the following comands to run the example:
dotnet restore to install the requirements
dotnet build to build the project
dotnet run to run the project
dotnet clean to clean the project
// Repeat for other CAPTCHAs
…or using Selenium in C#:
We are using command line dotnet 6+
Make sure we already downloaded selenium browser driver
and double check the driver executable is on PATH
We can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the C# source code.
Download C# Selenium project from the list above
Edit Program.cs and put your credentials there
string _username = "DBC_USERNAME";
string _password = "DBC_PASSWORD";
In the folder where .csproj file is located
Do the following comands to run the example:
dotnet restore to install the requirements
dotnet build to build the project
dotnet run to run the project
dotnet clean to clean the project
// Repeat for other CAPTCHAs
…or using Maven:
Create new Maven project
mvn archetype:generate
-DgroupId=examples
-DartifactId=deathbycaptcha-examples
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=1.4
-DinteractiveMode=false
Include the following dependencies on maven pom.xml file
<dependencies>
<dependency>
<groupId>io.github.deathbycaptcha</groupId>
<artifactId>deathbycaptcha-java-library</artifactId>
<version>0.43</version>
</dependency>
</dependencies>
if the pom.xml is correct.
We can use the imports on our java files.
import com.DeathByCaptcha.AccessDeniedException;
import com.DeathByCaptcha.Client;
import com.DeathByCaptcha.HttpClient;
import com.DeathByCaptcha.SocketClient;
import com.DeathByCaptcha.Captcha;
...
Clean and build the project
mvn clean install -U
Run the project
mvn exec:java -Dexec.mainClass="examples.GetBalance" -Dexec.args=""
mvn exec:java -Dexec.mainClass="examples.ExampleFuncaptcha"
mvn exec:java -Dexec.mainClass="examples.ExampleHcaptcha"
mvn exec:java -Dexec.mainClass="examples.ExampleRecaptchaV2"
...
Refer to Java and Maven project examples to more detail
…or using Selenium in Java:
We are using Maven 3.6+
Make sure we already downloaded selenium browser driver
and double check the driver executable is on PATH
We can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the Java source code.
Download Java Selenium project from the list above
Edit App.java and put your credentials there
Client client = new HttpClient("DBC_USERNAME", "DBC_PASSWORD");
In the folder where pom.xml file is located
Do the following comands to run the example:
mvn clean install -U to clean project and install dependencies
mvn exec:java -Dexec.mainClass="deathbycaptcha.App" to build the project
mvn clean to clean the project
Refer to Java and Maven project examples to more detail
…or using Selenium in NodeJS:
We are using NodeJS v12+
Make sure we already downloaded selenium browser driver
and double check the driver executable is on PATH
We can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the NodeJS source code.
Download NodeJS Selenium project from the list above
Edit nodeSeleniumExample.js and put your credentials there
const USERNAME = 'DBC_USERNAME' // Your DBC username here
const PASSWORD = 'DBC_PASSWORD' // Your DBC password here
In the folder where package.json file is located
Do the following comands to run the example:
npm install //to install dependencies
node recaptcha_example/nodeSeleniumExample.js //to run the example
Refer to NodeJS project examples to more detail
…or using DeathByCaptcha Python3 client library from pypi :
Create new Python3 virtual environment
python3 -m venv venv
Activate the virtual environment
. venv/bin/activate
Install DeathByCaptcha library from pypi
pip install deathbycaptcha-official
Create our python3 script
import deathbycaptcha
# don't forget to import deathbycaptcha library
username = 'username'
password = 'password'
authtoken = ''
...
use the DeathByCaptcha python http client
http_client = deathbycaptcha.HttpClient(username, password, authtoken)
or use the DeathByCaptcha python sockets client
socket_client = deathbycaptcha.SocketClient(username, password, authtoken)
Refer to Python3 project examples to more detail.
…or using Selenium in Python3:
We are using Python v3+
Make sure we already downloaded selenium browser driver
and double check the driver executable is on PATH
We can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the Python3 source code.
Download Python3 Selenium project from the list above
Edit python_selenium_example.py and put your credentials there
USERNAME = 'DBC_USERNAME' # Your DBC username here
PASSWORD = 'DBC_PASSWORD' # Your DBC password here
In the folder where requirements.txt file is located
Do the following comands to run the example:
python3 -m venv venv to create a new python3 venv
. venv/bin/activate to activate the venv
pip3 install -r requirements.txt to install dependencies
python3 python_selenium_example.py
Refer to Python3 project examples to more detail
When using socket API clients, make sure you don`t have outgoing TCP connections to ports 8123–8130 firewalled. Use HTTP API clients if socket API clients do not work for you. The 8123–8130 ports range is for socket API only, do not try to use it with HTTP API!
Note that a call to the decode function/method can return a null value if timeout is reached before the CAPTCHA is solved. If this happens often, increase the timeout used.
For more details see examples included in each API client package and check the clients source code.
How to use our command-line tool
- To check your balance, run:
deathbycaptcha.exe -l USERNAME -p PASSWORD -b
Or using authentication tokendeathbycaptcha.exe -a AUTHTOKEN -b
Your balance will be saved inbalance.txt
file and printed out on the standard output. - To upload a CAPTCHA, run:
deathbycaptcha.exe -l USERNAME -p PASSWORD -c CAPTCHA_FILE_NAME [-t TIMEOUT]
Or using authentication tokendeathbycaptcha.exe -a AUTHTOKEN -c CAPTCHA_FILE_NAME [-t TIMEOUT]
Default CAPTCHA solving timeout is 60 seconds.
If solved, the CAPTCHA ID will be saved inid.txt
, the CAPTCHA text will be saved inanswer.txt
, and both ID and text will be printed out on the standard output separated by a space. - To report an incorrectly solved CAPTCHA, run:
deathbycaptcha.exe -l USERNAME -p PASSWORD -n CAPTCHA_ID
Or using authentication tokendeathbycaptcha.exe -a AUTHTOKEN -n CAPTCHA_ID
HTTP API technical details
Before implementing your own Death By Captcha HTTP API client, please seriously consider using socket API with one of our official clients listed above.
Through our API, it is possible to:
- एक कैप्चा अपलोड करें
- Poll for an uploaded CAPTCHA
- Report incorrectly solved CAPTCHA
- Check credit balance
- Check server status
The API url is http://api.dbcapi.me/api/
. The URL path changes depending on the action desired. All responses from requests made to the API have two common fields:
status
— request status. 0 if there were no errors during internal request processing, 255 otherwise.error
— short explanation of the occurred error. Only returned when status is 255.
For details about correct URL path and other returned fields for a specific action, refer to its section below.
All API responses are returned URL-encoded by default. If JSON encoding is desired, include application/json
in the Accept
header of your request. Note that boolean true will be returned as 1 in URL-encoded responses and as true in JSON-encoded responses. Boolean false will be returned as 0 in URL-encoded responses and as false in JSON-encoded responses.
1. Uploading a CAPTCHA
To upload a CAPTCHA, issue a multipart/form-data
POST request to http://api.dbcapi.me/api/captcha
. The request must contain the following fields:
username
— your Death By Captcha username.password
— your Death By Captcha password.captchafile
— the CAPTCHA image.
In case you are using token authentication:
authtoken
— your Death By Captcha authentication token.captchafile
— the CAPTCHA image.
captchafile
should be either raw CAPTCHA image file, or base64
-encoded CAPTCHA image prepended with base64:
prefix. Image file size is limited to less than 180 KB. When the image will be encoded in base64, the size should be lower than 120 KB. The supported image formats are JPG, PNG, GIF and BMP.
Here is the HTML form that does the trick:
<form action="http://api.dbcapi.me/api/captcha" method="post" enctype="multipart/form-data"> <input type="text" name="username" value=""> <input type="password" name="password" value=""> <input type="file" name="captchafile"> </form>
Or using token authentication:
<form action="http://api.dbcapi.me/api/captcha" method="post" enctype="multipart/form-data"> <input type="text" name="authtoken" value=""> <input type="file" name="captchafile"> </form>
Here is cURL command equivalent:
curl --header 'Expect: ' -F username=YOUR_USERNAME \ -F password=YOUR_PASSWORD \ -F captchafile=@YOUR_CAPTCHA_FILENAME \ http://api.dbcapi.me/api/captcha
Or using token authentication:
curl --header 'Expect: ' -F authtoken=YOUR_AUTHTOKEN \ -F captchafile=@YOUR_CAPTCHA_FILENAME \ http://api.dbcapi.me/api/captcha
base64
-encoded captchafile
field should look like this:
base64:R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAICTAEAOw==
You`ll get one of the following HTTP responses:
-
303 See Other
if your CAPTCHA was successfully uploaded,Location
HTTP header will point you to the uploaded CAPTCHA status page, you may follow theLocation
to get the uploaded CAPTCHA status. Also, the following fields will be returned:
captcha
— id of the uploaded captcha.is_correct
— 1 if an answer has been identified for this captcha or it is still being processed, 0 if processing finished and no answer could be found.text
— captcha answer. An empty string means that the captcha is not solved yet.
status=0&captcha=123&is_correct=1&text=
JSON encoded example:{ "status": 0, "captcha": 123, "is_correct": 1, "text": "" }
-
403 Forbidden
if your Death By Captcha credentials were rejected, or you don`t have enough credits. -
400 Bad Request
if your request did not follow the specification above, or the CAPTCHA was rejected for not being a valid image. -
500 Internal Server Error
if something happened on our side preventing you from uploading the CAPTCHA; if you are sure you are sending properly structured requests with valid CAPTCHA images but the problem persists, please contact our live support and tell them in details how to reproduce the issue. -
503 Service Temporarily Unavailable
when our service is overloaded, try again later.
At this point the CAPTCHA you`ve just uploaded may not be solved yet! If you did not receive the answer in the text key of the server response, you have to poll for it. Refer to Polling for uploaded CAPTCHA status for more details.
2. Polling for uploaded CAPTCHA status
To get an uploaded CAPTCHA`s status, issue a GET request to http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%
, where %CAPTCHA_ID%
is your uploaded CAPTCHA`s ID acquired while uploading the CAPTCHA. You don`t have to supply your Death By Captcha credentials this time. The response will be a HTTP 200 OK
response with the same fields described for the 303 See Other
response of the Uploading a CAPTCHA section.
If the captcha is not solved yet, the text
key will come empty. You will have to keep on polling for this answer. Example responses:
-
URL-encoded response of a correctly solved CAPTCHA
status=0&captcha=1234&is_correct=1&text=tyrone+slothrop
-
JSON-encoded response of a correctly solved CAPTCHA
{ "captcha": 1234, "is_correct": true, "status": 0, "text": "tyrone slothrop" }
-
JSON-encoded response of an incorrectly solved CAPTCHA
{ "captcha": 1234, "is_correct": false, "status": 0, "text": "?" }
-
JSON-encoded response of an inexistent captcha
{ "captcha": 0, "status": 0 }
If you get this response, confirm that the CAPTCHA id you are using to poll for the answer is the same one returned when it was uploaded. If the problem persists, feel free to contact us.
Please don`t poll for a CAPTCHA status more than once in a couple of seconds.
This is considered abusive and might get you banned.
Conserve your and our bandwidth.
3. Reporting incorrectly solved CAPTCHAs
If you think your CAPTCHA was solved incorrectly, report it to Death By Captcha to get your money back. To do so, issue a POST request to http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%/report
with the following fields:
username
— your Death By Captcha username.password
— your Death By Captcha password.
Or using token authentication:
authtoken
— your Death By Captcha authentication token.
The response will be:
200 OK
if report was completed. In this case, your credits will be refunded. The response body will be the same as for a poll (or upload) but theis_correct
field will be 0. Example:{ "captcha": 1234, "is_correct": false, "status": 0, "text": "tyrone slothrop" }
503 Service Unavailable
if report could not be completed. This might be because: 1) captcha corresponding to the provided id was not uploaded by the user reporting it; 2) your user is banned; 3) report was made more than an hour after if was uploaded. In this case, you won`t be refunded.
Abusing this feature will get you banned!
4. Checking credit balance
To check your credit balance, issue a GET or POST request to http://api.dbcapi.me/api
with the following fields:
username
— your Death By Captcha username.password
— your Death By Captcha password.
Or using token authentication:
authtoken
— your Death By Captcha authentication token.
On successful authentication, you`ll get 200 OK
response with your Death By Captcha account details, either URL- or JSON-encoded, with the following fields:
user
— your Death By Captcha account ID;rate
— how much we charge you for one correctly solved CAPTCHA, in US¢;balance
— your current credit balance, in US¢.is_banned
— 1 if user is banned, 0 if not.
Example JSON-encoded response:
{ "is_banned": false, "status": 0, "rate": 0.139, "balance": 455.23, "user": 43122 }
5. Checking server status
In order to receive current server status, issue a GET request to http://api.dbcapi.me/api/status
. Response will have the following fields:
todays_accuracy
— number representing accuracy in percentage (e.g., 99.6 represents 99.6%)solved_in
— average solving time in secondsis_service_overloaded
— 1 if service is overloaded, 0 otherwise
Example JSON-encoded response:
{ "status": 0, "todays_accuracy": 99.9, "solved_in": 5.3, "is_service_overloaded": false }