API

Untuk tujuan otomatisasi, Death By Captcha (DBC) menyediakan API bagi pengguna dan pengembang untuk diintegrasikan dengan perangkat lunak apa pun yang diberikan.

Proses penyelesaiannya sebagai berikut:

Lihat detail API kami di bawah untuk informasi & sumber daya tambahan untuk mengimplementasikan DBC menggunakan alat dan/atau bahasa pemrograman favorit Anda!

Versi: kapan: 4.6

Klien pihak ketiga

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
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
// 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 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);
    }
}

// Repeat for other CAPTCHAs
We are using command line dotnet 6+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You 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
We are using Maven 3.6+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You 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
We are using NodeJS v12+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You 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
We are using Python v3+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You 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
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.
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

Saat menggunakan klien Socket API, pastikan Anda tidak memiliki koneksi TCP keluar ke port 8123-8130 Firewalled. Gunakan klien HTTP API jika klien Socket API tidak bekerja untuk Anda. Kisaran port 8123-8130 hanya untuk API soket, jangan mencoba menggunakannya dengan HTTP API!

Perhatikan bahwa panggilan ke fungsi/metode decode dapat mengembalikan nilai nol jika batas waktu tercapai sebelum captcha diselesaikan. Jika ini sering terjadi, tingkatkan batas waktu yang digunakan.

Untuk detail lebih lanjut, lihat contoh yang termasuk dalam setiap paket klien API dan periksa kode sumber klien.

  1. Untuk memeriksa saldo Anda, jalankan:
    deathbycaptcha.exe -l USERNAME -p PASSWORD -b
    Atau menggunakan token otentikasi
    deathbycaptcha.exe -a AUTHTOKEN -b
    Saldo Anda akan disimpan di saldo.txt file dan dicetak pada output standar.
  2. Untuk mengunggah captcha, jalankan:
    deathbycaptcha.exe -l USERNAME -p PASSWORD -c CAPTCHA_FILE_NAME [-t TIMEOUT]
    Atau menggunakan token otentikasi
    deathbycaptcha.exe -a AUTHTOKEN -c CAPTCHA_FILE_NAME [-t TIMEOUT]
    Timeout pemecahan captcha default adalah 60 detik.
    Jika diselesaikan, ID captcha akan disimpan di id.txt , teks captcha akan disimpan di jawaban.txt , dan baik ID dan teks akan dicetak di dalam Output standar dipisahkan oleh ruang.
  3. Untuk melaporkan captcha yang diselesaikan secara tidak benar, jalankan:
    deathbycaptcha.exe -l USERNAME -p PASSWORD -n CAPTCHA_ID
    Atau menggunakan token otentikasi
    deathbycaptcha.exe -a AUTHTOKEN -n CAPTCHA_ID

Sebelum menerapkan sendiri Death By Captcha HTTP API Client, harap pertimbangkan dengan serius menggunakan Socket API dengan salah satu klien resmi kami yang tercantum di atas.

URL API adalah http://api.dbcapi.me/api/. jalur url perubahan tergantung pada tindakan yang diinginkan. Semua tanggapan dari permintaan yang dibuat ke API memiliki dua bidang umum:

  • status — status permintaan. 0 Jika tidak ada kesalahan selama pemrosesan permintaan internal, 255 sebaliknya.
  • error — Penjelasan singkat tentang kesalahan yang terjadi. Hanya dikembalikan saat status 255.

Untuk detail tentang jalur URL yang benar dan bidang yang dikembalikan lainnya untuk tindakan tertentu, lihat bagiannya di bawah ini.

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.

Apa yang dimaksud dengan tantangan "captcha normal"?

Bentuk CAPTCHA ini berbasis gambar dan mengharuskan memasukkan urutan huruf atau angka dari gambar yang terdistorsi.

Untuk mengunggah CAPTCHA, kirim permintaan POST multipart/form-data ke http://api.dbcapi.me/api/captcha. Permintaan harus berisi bidang -bidang berikut:

  • username — Anda Death By Captcha nama pengguna.
  • password — Kata sandi Anda Death By Captcha.
  • captchafile — gambar captcha.

Jika Anda menggunakan otentikasi token:

  • authtoken — Token otentikasi Death By Captcha Anda.
  • captchafile — gambar captcha.

captchafile Harus berupa file gambar CAPTCHA mentah atau gambar CAPTCHA yang dienkripsi dalam format base64 dengan awalan base64:. Ukuran file gambar dibatasi kurang dari 180 KB. Ketika gambar akan dienkripsi dalam format base64, ukurannya harus lebih kecil dari 120 KB. Format gambar yang didukung adalah JPG, PNG, GIF, dan BMP.

Berikut adalah formulir HTML yang berhasil:

<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>

Atau menggunakan otentikasi token:

<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>

Ini setara perintah CURL:

curl --header 'Expect: ' -F username=YOUR_USERNAME  -F password=YOUR_PASSWORD  -F captchafile=@YOUR_CAPTCHA_FILENAME http://api.dbcapi.me/api/captcha

Atau menggunakan otentikasi token:

curl --header 'Expect: ' -F authtoken=YOUR_AUTHTOKEN  -F captchafile=@YOUR_CAPTCHA_FILENAME http://api.dbcapi.me/api/captcha

base64-encoded captchafile bidang akan terlihat seperti ini:

base64:R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAICTAEAOw==

Anda akan mendapatkan salah satu dari tanggapan HTTP berikut:

  • 303 See Other lainnya jika captcha Anda berhasil diunggah, Lokasi header http akan mengarahkan Anda ke halaman Status CaptCHA yang diunggah, Anda dapat mengikuti lokasi ke Dapatkan status captcha yang diunggah. Juga, bidang -bidang berikut akan dikembalikan:
    • captcha — ID captcha yang diunggah.
    • is_correct — 1 Jika jawaban telah diidentifikasi untuk captcha ini atau masih diproses, 0 jika pemrosesan selesai dan tidak ada jawaban yang dapat ditemukan.
    • text — Jawaban captcha. String kosong berarti bahwa captcha belum terpecahkan.
    Contoh URL yang disandikan:
    status=0&captcha=123&is_correct=1&text=
    JSON Excoded Contoh:
    { "status": 0, "captcha": 123, "is_correct": 1, "text": "" }
  • 403 Forbidden Jika Death By Captcha kredensial ditolak, atau Anda tidak memiliki cukup kredit.
  • 400 Bad Request Jika permintaan Anda tidak mengikuti spesifikasi di atas, atau captcha ditolak karena tidak menjadi gambar yang valid.
  • 500 Internal Server Error Jika sesuatu terjadi di pihak kami, mencegah Anda mengunggah captcha; Jika Anda yakin Anda mengirimkan permintaan terstruktur dengan baik dengan gambar captcha yang valid tetapi masalahnya tetap ada, silakan hubungi dukungan langsung kami dan beri tahu mereka secara rinci bagaimana mereproduksi masalah ini.
  • 503 Service Temporarily Unavailable Ketika layanan kami kelebihan beban, coba lagi nanti.

Pada titik ini CAPTCHA yang baru saja Anda unggah mungkin belum terselesaikan! Jika Anda tidak menerima jawaban di kunci text dari respons server, Anda harus polling untuk itu. Lihat Polling untuk status CAPTCHA yang diunggah untuk detail lebih lanjut.

Untuk mendapatkan status captcha yang diunggah, keluarkan permintaan mendapatkan http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%, dimana %CAPTCHA_ID% adalah ID CAPTCHA yang Anda unggah yang diperoleh saat mengunggah CAPTCHA. Anda tidak perlu memasok kredensial Death By Captcha Anda kali ini. Responsnya akan menjadi respons HTTP 200 OK dengan bidang yang sama yang dijelaskan untuk respons 303 Lihat Lainnya dari bagian Mengunggah CAPTCHA.

Jika captcha belum terpecahkan, tombol text akan kosong. Anda harus terus melakukan pemungutan suara untuk jawaban ini. Tanggapan contoh:

  • Respon yang dikodekan URL dari captcha yang diselesaikan dengan benar
    status=0&captcha=1234&is_correct=1&text=tyrone+slothrop
  • Respon yang dikodekan JSON dari captcha yang diselesaikan dengan benar
    { "captcha": 1234, "is_correct": true,"status": 0, "text": "tyrone slothrop" }
  • Respon yang dikodekan JSON dari captcha yang salah dipecahkan
    { "captcha": 1234, "is_correct": false, "status": 0, "text": "?" }
  • Respons Captcha yang tidak dikodekan JSON
    { "captcha": 0, "status": 0 }
    Jika Anda mendapatkan respons ini, konfirmasikan bahwa ID CAPTCHA yang Anda gunakan untuk melakukan jajak pendapat untuk jawabannya sama dengan yang dikembalikan saat diunggah. Jika masalahnya tetap ada, jangan ragu untuk hubungi kami.

Harap Don`t Poll untuk status captcha lebih dari sekali dalam beberapa detik.
Ini dianggap sebagai penyalahgunaan dan bisa membuat Anda diblokir.
Hemat bandwidth Anda dan kami.

Jika Anda berpikir captcha Anda diselesaikan secara tidak benar, laporkan ke Death By Captcha untuk mendapatkan uang Anda kembali. Untuk melakukannya, keluarkan permintaan pos ke http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%/report dengan bidang berikut:

  • username — Anda Death By Captcha nama pengguna.
  • password — Kata sandi Anda Death By Captcha.

Atau menggunakan token otentikasi:

  • authtoken — Token otentikasi Death By Captcha Anda.

Responsnya adalah:

  • 200 OK Jika laporan selesai. Dalam hal ini, kredit Anda akan dikembalikan. Badan respons akan sama dengan untuk jajak pendapat (atau unggahan) tetapi bidang is_correct akan menjadi 0. Contoh:
    { "captcha": 1234, "is_correct": false,"status": 0, "text": "tyrone slothrop" }
  • 503 Service Unavailable Jika laporan tidak dapat diselesaikan. Ini mungkin karena:
    1) captcha yang sesuai dengan ID yang disediakan tidak diunggah oleh pengguna yang melaporkannya;
    2) Pengguna Anda dilarang;
    3) laporan dibuat lebih dari satu jam Setelah jika diunggah. Dalam hal ini, Anda tidak akan dikembalikan.

Menyalahgunakan fitur ini akan membuat Anda dilarang!

Untuk memeriksa saldo kredit Anda, mengeluarkan permintaan GET atau POST ke http://api.dbcapi.me/api dengan bidang berikut:

  • username — Anda Death By Captcha nama pengguna.
  • password — Kata sandi Anda Death By Captcha.

Atau menggunakan token otentikasi:

  • authtoken — Token otentikasi Death By Captcha Anda.

Pada otentikasi yang berhasil, Anda akan mendapatkan 200 OK respons dengan Death By Captcha detail akun, baik url- atau json-encoded, dengan bidang berikut:

  • user — ID akun Anda Death By Captcha;
  • rate — Berapa banyak kami membebankan Anda untuk satu CAPTCHA yang diselesaikan dengan benar, dalam US¢;
  • balance — Saldo kredit Anda saat ini, dalam US¢.
  • is_banned — 1 Jika pengguna dilarang, 0 jika tidak.

Contoh respons yang dikodekan JSON:

{ "is_banned": false, "status": 0, "rate": 0.139,"balance": 455.23, "user": 43122 }

Untuk menerima status server saat ini, keluarkan permintaan GET ke http://api.dbcapi.me/api/status. Respons akan memiliki bidang berikut:

  • todays_accuracy — Angka yang mewakili akurasi dalam persentase (mis., 99,6 mewakili 99,6%)
  • solved_in — rata -rata memecahkan waktu dalam hitungan detik
  • is_service_overloaded — 1 Jika layanan kelebihan beban, 0 sebaliknya

Contoh respons yang dikodekan JSON:

{ "status": 0, "todays_accuracy": 99.9, "solved_in": 5.3,"is_service_overloaded": false }
Death By Captcha API juga mendukung otentikasi token (baik soket dan http), cara menggunakan otentikasi token dengan API kami .

Status: OK

Server beroperasi penuh dengan waktu respons yang lebih cepat dari rata-rata.
  • Waktu penyelesaian rata-rata
  • 2 detik - Normal CAPTCHAs (1 menit. yang lalu)
  • 36 detik - reCAPTCHA V2, V3, etc (1 menit. yang lalu)
  • 31 detik - hCAPTCHA & yang lain (1 menit. yang lalu)
Chrome and Firefox logos
Ekstensi browser tersedia

Pembaruan

  1. Feb 26: NEW TYPE ADDED - Now supporting Friendly CAPTCHA!! See the details at https://deathbycaptcha.com/api/friendly
  2. Nov 22: Now supporting Amazon WAF!! See the details at https://deathbycaptcha.com/api/amazonwaf
  3. Nov 01: Today our Socket API was affected by a technical issue for a few hours. It's now sorted and back to 100%, working optimally. We sincerely apologize for the inconvenience this may have caused you. If you were affected, please don't hesitate to contact us: https://deathbycaptcha.com/contact and we'll be happy to assist/compensate you!

  4. পূর্ববর্তী আপডেট…

Mendukung

Sistem kami dirancang untuk sepenuhnya ramah pengguna dan mudah digunakan. Jika Anda memiliki masalah dengan itu, cukup email kami diEmail dukungan teknis DBC com, dan agen dukungan akan menghubungi Anda sesegera mungkin.

Dukungan Langsung

Tersedia Senin hingga Jumat (10 pagi hingga 4 sore EST) Live support image. Link to live support page