Skip to content
API
ReCAPTCHA
รูปภาพ

ReCAPTCHA Image (Phone)

ภาพรวม

แก้ Recaptcha ด้วยความเร็วสูงพิเศษ แม่นยำอันดับ 1 ในตลาด เราให้บริการแก้ ReCaptcha Image ทุกประเภทบนโทรศัพท์

📱

บริการนี้ช่วยให้คุณส่งรูปภาพแคปช่าและรับดัชนีของเซลล์ที่จะคลิกเพื่อแก้แคปช่า

ReCAPTCHA Mobile

1. สร้างงาน

คำขอ

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

พารามิเตอร์

ชื่อพารามิเตอร์ชนิดข้อมูลจำเป็น?คำอธิบาย
clientKeystringใช่คีย์ API
task.typestringใช่ReCaptchaPhoneTask
task.subTypestringใช่ค่าเท่ากับ 0
task.imagestringใช่รูปภาพแคปช่าในรูปแบบ base64 จับภาพพื้นที่แสดงรูปภาพแคปช่า (ไม่มีขอบ เฉพาะเซลล์สี่เหลี่ยมเล็กๆ)
task.otherstringใช่คำถาม|จำนวนกริด
• คำถาม: "Select all images with a bus" (full question text shown in the captcha prompt)
• จำนวนกริด: 3 (หรือ 4, 5)
→ other: "Select all images with a bus|4"

ตัวอย่างคำขอ

POST /createTask HTTP/1.1
Host: api.achicaptcha.com
Content-Type: application/json
 
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "ReCaptchaPhoneTask",
    "subType": "0",
    "image": "iVBORw0KGgoAAAANSUhEUgAA...(base64 encoded image)",
    "other": "Select all images with a bus|4"
  }
}

การตอบกลับ

เมื่อสำเร็จ เซิร์ฟเวอร์จะส่งคืน errorId = 0 และ taskId

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

2. รับผลลัพธ์

คำขอ

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

พารามิเตอร์

ชื่อพารามิเตอร์ชนิดข้อมูลจำเป็น?คำอธิบาย
clientKeystringใช่คีย์ API
taskIdstringใช่TaskId ที่ได้รับจาก (1)

ตัวอย่างคำขอ

POST /getTaskResult HTTP/1.1
Host: api.achicaptcha.com
Content-Type: application/json
 
{
  "clientKey": "YOUR_API_KEY",
  "taskId": "f2fc70d6-c76b-4fba-9480-205ac1fe9fb9"
}

การตอบกลับ

{
  "errorId": 0,
  "status": "ready",
  "solution": "0,5,9"
}

หมายเหตุ: สำหรับประเภท "grid" solution คือรายการดัชนีรูปภาพที่จะคลิก เริ่มจาก 0

คำอธิบายสถานะ

  • errorId = 0: แก้ไขสำเร็จ อ่านผลลัพธ์ใน solution
  • errorId = 1: กำลังแก้แคปช่า รอ 2-3 วินาทีแล้วลองอีกครั้ง
  • errorId > 1: ข้อผิดพลาดของระบบ ส่งคืนรหัสข้อผิดพลาดและคำอธิบาย

ตัวอย่างการรวมระบบ

import requests
import time
 
def solve_recaptcha_phone(image_base64, question, grid_count, api_key='YOUR_API_KEY'):
    # Step 1: Create task
    create_task_url = 'https://api.achicaptcha.com/createTask'
    create_task_payload = {
        'clientKey': api_key,
        'task': {
            'type': 'ReCaptchaPhoneTask',
            'subType': '0',
            'image': image_base64,
            'other': f'{question}|{grid_count}'
        }
    }
    
    response = requests.post(create_task_url, json=create_task_payload)
    result = response.json()
    
    if result['errorId'] > 1:
        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-3 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'] > 1:
            raise Exception(result['errorDescription'])
        
        if result['status'] == 'ready':
            return result['solution']  # Returns "0,5,9" - indices to click
        
        # If status == 'processing', continue loop
 
# Usage
image_base64 = 'iVBORw0KGgoAAAANSUhEUgAA...'  # Base64 encoded captcha image
question = 'Select all images with a bus'  # Full question text from the captcha prompt
grid_count = 4  # Grid count (3, 4, or 5)
solution = solve_recaptcha_phone(image_base64, question, grid_count, 'YOUR_API_KEY')
print('Grid indices to click:', solution)  # Example: "0,5,9"
 
# Use solution to click corresponding cells
indices = [int(i) for i in solution.split(',')]
for index in indices:
    # Click cell with corresponding index
    print(f'Click cell index: {index}')

รหัสข้อผิดพลาดทั่วไป

รหัสข้อผิดพลาดคำอธิบายหมายเหตุ
0successสำเร็จ
1processingกำลังประมวลผล
2missing required fieldsขาดฟิลด์ที่จำเป็น ตรวจสอบพารามิเตอร์อีกครั้ง
3task not supportedไม่รองรับประเภทงาน
4task creation failedการสร้างงานล้มเหลว
5client key does not existไม่มีคีย์ API ตรวจสอบคีย์ API อีกครั้ง
6insufficient account balanceยอดเงินในบัญชีไม่เพียงพอ เติมเครดิต
7task failed, please create a new taskงานล้มเหลว โปรดสร้างงานใหม่
8task ID does not existไม่มี ID งาน

แนวทางปฏิบัติที่ดีที่สุด

เพื่อให้ได้ผลลัพธ์ที่ดีที่สุดเมื่อใช้ Achicaptcha API ให้ปฏิบัติตามหลักการเหล่านี้:

1. เตรียมรูปภาพแคปช่า

  • จับภาพพื้นที่แสดงรูปภาพแคปช่าให้ชัดเจน โดยไม่มีขอบหรือองค์ประกอบ UI อื่นๆ
  • รวมเฉพาะเซลล์สี่เหลี่ยมเล็กๆ (กริด) ของแคปช่า
  • รูปภาพในรูปแบบ base64
  • ตรวจสอบให้แน่ใจว่ารูปภาพมีความละเอียดเพียงพอสำหรับการจดจำ

2. กำหนดข้อมูลที่ถูกต้อง

  • รับคำถามจากส่วนข้อความตัวหนาของแคปช่า (ตัวอย่าง: "Select all images with a bus", "Select all squares with traffic lights")
  • กำหนดจำนวนกริดที่ถูกต้อง (3x3, 4x4 หรือ 5x5)
  • จัดรูปแบบ other ให้ถูกต้อง: "question|grid_count" (ตัวอย่าง: "Select all images with a bus|4")

3. ช่วงเวลาการตรวจสอบ

  • รออย่างน้อย 2-3 วินาทีระหว่างการตรวจสอบผลลัพธ์
  • อย่าสแปม API ด้วยคำขอที่ต่อเนื่องกันมากเกินไป
  • ตั้งค่าการหมดเวลาเพื่อหลีกเลี่ยงลูปไม่สิ้นสุด (แนะนำ 120 วินาที)

4. ประมวลผลผลลัพธ์

  • Solution ที่ส่งคืนคือสตริงของดัชนีที่จะคลิก คั่นด้วยเครื่องหมายจุลภาค (ตัวอย่าง: "0,5,9")
  • ดัชนีเริ่มจาก 0 นับจากซ้ายไปขวา บนลงล่าง
  • แยกวิเคราะห์สตริงและคลิกเซลล์ที่เกี่ยวข้อง

5. ตรรกะการลองใหม่

  • ใช้การลองใหม่สำหรับข้อผิดพลาดชั่วคราว เช่น ERROR_NO_SLOT_AVAILABLE
  • ใช้ exponential backoff เมื่อลองใหม่
  • จำกัดจำนวนการลองใหม่สูงสุด

6. ความปลอดภัยของคีย์ API

  • อย่าฮาร์ดโค้ดคีย์ API ในโค้ด
  • ใช้ตัวแปรสภาพแวดล้อม
  • อย่าเปิดเผยคีย์ API ทางฝั่งไคลเอนต์

ลิงก์ที่มีประโยชน์: