hCaptcha 求解器
通过提供 base64 编码的图片和题目文本来解决 hCaptcha 图片挑战。API 使用 PopularCaptchaImage 任务类型,支持三种挑战模式。
支持的模式
| 模式 | questionType | 说明 | 响应 |
|---|---|---|---|
| 格子 / 分类 | objectClassify | 从九宫格中选择所有匹配的图片 | boolean[] —— 每张图片一个 |
| 点击 | objectClick | 点击目标对象的中心 | {x, y}[] 坐标 |
| 拖放 | objectDrag | 将拼图块拖到正确位置 | {start, end}[] 坐标 |
创建任务 —— 格子 / 分类
最常见的模式。提交 base64 编码的格子图和题目文本。
POST
/createTaskHostapi.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"
}
任务参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
type | string | ✅ | PopularCaptchaImage 或 PopularClassification |
questionType | string | ✅ | objectClassify、objectClick 或 objectDrag |
question | string | ✅ | 挑战指令文本 |
queries | string[] | ✅ | base64 编码的图片(格子或主图) |
examples | string[] | 仅拖放 | 拖放任务的目标对象 |
screenshort | boolean | 否 | 若图片是截图,设为 true |
API 演练场
POST
Log in to auto-fill your API key
Payload
Response
Hit Send to see response
⌘ + Enter
Parameters
Error Codes
terminal