Text Captcha
Overview
A standard text captcha is an image containing distorted text that is readable by humans. To solve the captcha image, users must enter the text from the image.
Text captcha can include numbers, letters, or a combination of both. They typically use image distortions, noise, and various fonts to make automated reading difficult.

1. Create Task
Request
POST https://api.achicaptcha.com/createTask
Parameters
| Parameter | Data Type | Required? | Description |
|---|---|---|---|
clientKey | string | yes | API key |
task.type | string | yes | ImageToTextTask |
task.image | string | yes | Base64 of the image |
task.subType | string | yes | One of the following types: common, amazon, microsoft, facebook, garena, artistshot, gmx, 11166, houssam |
Request Example
POST /createTask HTTP/1.1
Host: api.achicaptcha.com
Content-Type: application/json
{
"clientKey": "Your API_KEY",
"task": {
"type": "ImageToTextTask",
"image": "base64 encoded image",
"subType": "gmx"
}
}Response
On success, the server will return errorId = 0 and taskId
{
"errorId": 0,
"taskId": "f2fc70d6-c76b-4fba-9480-205ac1fe9fb9"
}2. Get Result
Request
POST https://api.achicaptcha.com/getTaskResult
Parameters
| Parameter | Data Type | Required? | Description |
|---|---|---|---|
clientKey | string | yes | API key |
taskId | string | yes | TaskId from step (1) |
Request Example
POST /getTaskResult HTTP/1.1
Host: api.achicaptcha.com
Content-Type: application/json
{
"clientKey": "Your API_KEY",
"taskId": "f2fc70d6-c76b-4fba-9480-205ac1fe9fb9"
}Response
{
"errorId": 0,
"status": "ready",
"solution": "swamn"
}Status Explanation
errorId = 0andstatus = ready: Successfully solved, read result insolution.texterrorId = 0andstatus = processing: Captcha is being solved, wait 2 seconds and try againerrorId > 0: System error, error code and description provided
SubType Options
Achicaptcha supports various types of text captcha through the subType parameter:
| SubType | Description |
|---|---|
common | Common text captcha, most popular |
amazon | Amazon-specific captcha with special distortion |
microsoft | Captcha used on Microsoft services |
facebook | Facebook captcha with distinctive fonts |
garena | Captcha on Garena platform |
artistshot | Captcha from Artistshot website |
gmx | GMX email captcha |
11166 | Special captcha type with code 11166 |
houssam | Specific captcha type named Houssam |
discord | Discord-specific captcha type |
okvip | OKVIP-specific captcha type |
shopee | Shopee-specific captcha type |
Typically subType: common can handle all types of text captcha. If your website's text captcha is too specific, please contact admin (opens in a new tab) for support.
Integration Examples
import requests
import time
import base64
def solve_captcha(image_path, sub_type='common', api_key='YOUR_API_KEY'):
# Read and encode image
with open(image_path, 'rb') as image_file:
image_base64 = base64.b64encode(image_file.read()).decode('utf-8')
# Step 1: Create task
create_task_url = 'https://api.achicaptcha.com/createTask'
create_task_payload = {
'clientKey': api_key,
'task': {
'type': 'ImageToTextTask',
'image': image_base64,
'subType': sub_type
}
}
response = requests.post(create_task_url, json=create_task_payload)
result = response.json()
if result['errorId'] != 0:
raise Exception(result['errorDescription'])
task_id = result['taskId']
# Step 2: Get result
get_result_url = 'https://api.achicaptcha.com/getTaskResult'
while True:
time.sleep(2) # Wait 2 seconds
get_result_payload = {
'clientKey': api_key,
'taskId': task_id
}
response = requests.post(get_result_url, json=get_result_payload)
result = response.json()
if result['errorId'] != 0:
raise Exception(result['errorDescription'])
if result['status'] == 'ready':
return result['solution']
# If status == 'processing', continue loop
# Usage
solution = solve_captcha('captcha.png', 'common', 'YOUR_API_KEY')
print('Captcha result:', solution)Common Error Codes
| Error Code | Description | Notes |
|---|---|---|
| 0 | success | Success |
| 1 | processing | Processing |
| 2 | missing required fields | Missing required fields, check parameters |
| 3 | task not supported | Task type not supported |
| 4 | task creation failed | Task creation failed |
| 5 | client key does not exist | API key does not exist, check your API key |
| 6 | insufficient account balance | Insufficient account balance, add more credits |
| 7 | task failed, please create a new task | Task failed, please create a new task |
| 8 | task ID does not exist | Task ID does not exist |
Best Practices
To achieve the best results when using Achicaptcha API, follow these principles:
1. Image Quality
- Use images with good resolution
- Ensure images are not too blurry or noisy
- Choose the appropriate
subTypefor your captcha type
2. Polling Interval
- Wait at least 2 seconds between result checks
- Don't spam the API with too many consecutive requests
- Have a timeout to avoid infinite loops
3. Retry Logic
- Implement retry for temporary errors like
ERROR_NO_SLOT_AVAILABLE - Use exponential backoff when retrying
- Limit maximum retry attempts
4. API Key Security
- Don't hardcode API key in code
- Use environment variables
- Don't expose API key on client-side
Useful Links: