Skip to content

hCaptcha 求解器

通过提供 base64 编码的图片和题目文本来解决 hCaptcha 图片挑战。API 使用 PopularCaptchaImage 任务类型,支持三种挑战模式。

支持的模式

模式questionType说明响应
格子 / 分类objectClassify从九宫格中选择所有匹配的图片boolean[] —— 每张图片一个
点击objectClick点击目标对象的中心{x, y}[] 坐标
拖放objectDrag将拼图块拖到正确位置{start, end}[] 坐标

创建任务 —— 格子 / 分类

最常见的模式。提交 base64 编码的格子图和题目文本。

POST/createTask
Hostapi.captchasonic.com
Content-Typeapplication/json
{
    "apiKey": "YOUR_API_KEY",
    "task": {
        "type": "PopularCaptchaImage",
        "questionType": "objectClassify",
        "question": "Select all images with a bus",
        "queries": ["BASE64_IMG_1", "BASE64_IMG_2", "..."]
    }
}

响应

{
    "code": 200,
    "msg": "",
    "answers": [true, false, true, true, false, true, true, true, true],
    "questionType": "objectClassify",
    "meta": { "pass_report": true, "fail_report": true }
}

每个 answers[i] 对应 queries[i] —— true 表示该图片与题目匹配。

创建任务 —— 点击

提交一张图片。求解器会返回目标对象的坐标。

{
    "apiKey": "YOUR_API_KEY",
    "task": {
        "type": "PopularCaptchaImage",
        "questionType": "objectClick",
        "question": "Click on the center of the cat",
        "queries": ["BASE64_MAIN_IMAGE"]
    }
}

响应

{
    "code": 200,
    "answers": [[{ "x": 142, "y": 205 }]],
    "questionType": "objectClick"
}

创建任务 —— 拖放

queries 中提交背景图,在 examples 中提交拼图块。

{
    "apiKey": "YOUR_API_KEY",
    "task": {
        "type": "PopularCaptchaImage",
        "questionType": "objectDrag",
        "question": "Drag the puzzle piece to the gap",
        "queries": ["BASE64_BACKGROUND"],
        "examples": ["BASE64_PUZZLE_PIECE"]
    }
}

响应

{
    "code": 200,
    "answers": [[{ "start": [100, 200], "end": [150, 250] }]],
    "questionType": "objectDrag"
}

任务参数

字段类型必填说明
typestringPopularCaptchaImagePopularClassification
questionTypestringobjectClassifyobjectClickobjectDrag
questionstring挑战指令文本
queriesstring[]base64 编码的图片(格子或主图)
examplesstring[]仅拖放拖放任务的目标对象
screenshortboolean若图片是截图,设为 true

API 演练场

POST
Log in to auto-fill your API key
Payload
Response

Hit Send to see response

⌘ + Enter

Parameters

apiKeystringYOUR_API_KEY
taskobject{...}
typestringPopularCaptchaImage
questionTypestringobjectClassify
questionstringSelect all images with a bus
queriesarray[2 items]

Error Codes

1KEY_DOES_NOT_EXIST
2NO_SLOT_AVAILABLE
3ZERO_BALANCE
10ERROR_BAD_PARAMETERS
12ERROR_CAPTCHA_UNSOLVABLE
14PLAN_EXPIRED
16RATE_LIMITED
17DAILY_LIMIT_EXCEEDED
18QUOTA_LIMIT_EXCEEDED
21SERVICE_UNAVAILABLE
Code
terminal