Skip to content
API
Amazon Captcha

Amazon Captcha

Overview

Amazon Captcha is an authentication system used by Amazon to protect their websites from bots and automated activities. This is a specially distorted text captcha that only appears on Amazon systems.

🛒

Amazon Captcha typically appears during login, product searches, or when Amazon detects unusual behavior from your IP address.

Amazon Captcha Amazon Captcha

1. Create Request

Request

POST https://api.achicaptcha.com/createTask

Parameters

Parameter nameData typeRequired?Description
clientKeystringyesApi key
task.typestringyesImageToTextTask
task.imagestringyesbase64 of Amazon captcha image
task.subTypestringyesamazon

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 Amazon captcha image",
    "subType": "amazon"
  }
}

Response

On success, server returns errorId = 0 and taskId

{
  "errorId": 0,
  "taskId": "f2fc70d6-c76b-4fba-9480-205ac1fe9fb9"
}

2. Get Result

Request

POST https://api.achicaptcha.com/getTaskResult

Parameters

Parameter nameData typeRequired?Description
clientKeystringyesApi key
taskIdstringyesTaskId from (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": "KCXM8P"
}

Status Explanation

  • errorId = 0 and status = ready: Solved successfully, read result in solution
  • errorId = 0 and status = processing: Solving captcha, wait 2 seconds and try again
  • errorId > 0: System error, returns error code and description

Integration Examples

import requests
import time
import base64
 
def solve_amazon_captcha(image_path, 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': 'amazon'
        }
    }
    
    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_amazon_captcha('amazon_captcha.png', 'YOUR_API_KEY')
print('Amazon captcha result:', solution)

Common Error Codes

Error CodeDescriptionNotes
0successSuccess
1processingProcessing
2missing required fieldsMissing required field, check parameters again
3task not supportedTask type not supported
4task creation failedTask creation failed
5client key does not existAPI key does not exist, check API key again
6insufficient account balanceInsufficient account balance, top up credits
7task failed, please create a new taskTask failed, please create a new task
8task ID does not existTask ID does not exist

Best Practices

To achieve the best results when using Achicaptcha API, follow these principles:

1. Image Quality

  • Use high-resolution images
  • Ensure images are not overly blurred or noisy
  • Capture or crop the correct Amazon captcha area

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 number of retries

4. API Key Security

  • Don't hardcode API key in code
  • Use environment variables
  • Don't expose API key on client-side

Useful Links: