CaptchaAI API Documentation
CaptchaAI is an AI-powered image and CAPTCHA recognition service. captchaAI's main purpose is solving your CAPTCHAs in a quick and cost effictive way by using AI "Artificial Intelligence".
Introduction
We provide an API that allows you to automate the process and integrate your software with our service.
We also have a software to emulate other captcha services. Check CaptchaAI Emulator
There are few simple steps to solve your captcha or recognize the image:
- 1. Send your image or captcha to our server.
- 2. Get the ID of your task.
- 3. Start a cycle that checks if your task is completed.
- 4. Get the result.
Captcha types
Type of captcha/method | Description |
---|---|
Normal Captcha | 27,500+ image captchas including, Solve Media, Google captcha, reCAPTCHA v1, Facebook captcha, etc. |
reCAPTCHA V2 | Google reCaptcha V2 |
reCAPTCHA V3 | Google reCaptcha V3 |
hCaptcha | hCaptcha |
Solving Captchas
Our API is based on HTTP requests and supports both HTTP and HTTPS protocols.
API endpoints:
https://ocr.captchaai.com/in.php
is used to submit a captchahttps://ocr.captchaai.com/res.php
is used to get the captcha solution
NEW For image captcha, now you can use https://ocr.captchaai.com/solve.php
instead of in.php
to directly get the results.
The process of solving captchas with captchaai is really easy and it's mostly the same for all types of captchas:
- Get your API key from your API key. Each user is given a unique authentication token, we call it API key. It's a 32-characters string that looks like:
347bc2896fc1812d3de5ab56a0bf4ea7
This key will be used for all your requests to our server. - Submit a HTTP POST request to our API URL:
https://ocr.captchaai.com/in.php
with parameters corresponding to the type of your captcha.
Server will return captcha ID or an error code if something went wrong. - Make a timeout: 20 seconds for reCAPTCHA, 5 seconds for other types of captchas.
- Submit a HTTP GET request to our API URL:
https://ocr.captchaai.com/res.php
to get the result.
If captcha is already solved server will return the answer in format corresponding to the type of your captcha.
By default answers are returned as plain text like: OK|Your answer. But answer can also be returned as JSON {"status":1,"request":"TEXT"} if json parameter is used.
If captcha is not solved yet server will return CAPCHA_NOT_READY result. Repeat your request in 5 seconds.
If something went wrong server will return an error code.
Normal Captcha
Normal Captcha is an image that contains distored but human-readable text. To solve the captcha user have to type the text from the image.
To solve the captcha with our service you have to submit the image with HTTP POST request to our API URL: https://ocr.captchaai.com/in.php
Server accepts images in multipart or base64 format.
NEW For image captcha, now you can use https://ocr.captchaai.com/solve.php
instead of in.php
to directly get the results.
Multipart sample form
<form method="post" action="https://ocr.captchaai.com/in.php" enctype="multipart/form-data">
<input type="hidden" name="method" value="post">
Your key:
<input type="text" name="key" value="YOUR_APIKEY">
The CAPTCHA file:
<input type="file" name="file">
<input type="submit" value="Upload and get the ID">
</form>
YOUR_APIKEY is Your API key.
Base64 sample form
<form method="post" action="https://ocr.captchaai.com/in.php">
<input type="hidden" name="method" value="base64">
Your key:
<input type="text" name="key" value="YOUR_APIKEY">
The CAPTCHA file body in base64 format:
<textarea name="body">BASE64_FILE</textarea>
<input type="submit" value="Upload and get the ID">
</form>
YOUR_APIKEY is here your API key.
BASE64_FILE is base64-encoded image body.
You can provide additional parameters with your request to define what kind of captcha you'resending and to help OCR servers to solve your captcha correctly. You can find the full list of parameters in the table below.
If everything is fine server will return the ID of your captcha as plain text, like:OK|123456789 or as JSON {"status":1,"request":"123456789"} if json parameter was used.
If something went wrong server will return an error. See Error Handling chapter for the list of errors.
Make a 5 seconds timeout and submit a HTTP GET request to our API URL: https://ocr.captchaai.com/res.php
providing the captcha ID. The list of parameters is in the table below.
If everything is fine and your captcha is solved server will return the answer as plain text, like: OK|TEXT or as JSON {"status":1,"request":"TEXT"} if json parameter was used.
Otherwise server will return CAPCHA_NOT_READY that means that your captcha is not solved yet. Just repeat your request in 5 seconds.
If something went wrong server will return an error. See Error Handling chapter for the list of errors.
List of POST request parameters for https://ocr.captchaai.com/in.php
POST parameter | Type | Required | Description |
---|---|---|---|
key | String | Yes | your API key |
method | String | Yes | post - defines that you're sending an image with multipart form base64 - defines that you're sending a base64 encoded image |
file | File | Yes* | Captcha image file. * - required if you submit image as a file (method=post) |
body | String | Yes* | Base64-encoded captcha image * - required if you submit image as Base64-encoded string (method=base64) |
module | String | No | NEW Choose from custom image modules for perfect results. List of available modules: * common-1 * common-2 * collection-1 * collection-2 * collection-3 * collection-4 * collection-5 * ... Full list of custom image modules [authentication required] |
json | Integer Default: 0 | No | 0 - server will send the response as plain text 1 - tells the server to send the response as JSON |
List of GET request parameters for https://ocr.captchaai.com/res.php
GET parameter | Type | Required | Description |
---|---|---|---|
key | String | Yes | your API key |
action | String | Yes | get - get the asnwer for your captcha |
id | Integer | Yes | ID of captcha returned by in.php. |
json | Integer Default: 0 | No | 0 - server will send the response as plain text 1 - tells the server to send the response as JSON |
header_acao | Integer Default: 0 | No | 0 - disabled 1 - enabled. If enabled res.php will include Access-Control-Allow-Origin:* header in the response. Used for cross-domain AJAX requests in web applications. |
Request URL example:
https://ocr.captchaai.com/res.php?key=347bc2896fc1812d3de5ab56a0bf4ea7&action=get&id=123456789