图像转文字(Image To Text)求解器
使用 OcrImage 任务类型解决标准的文本验证码。支持自定义约束,包括纯数字、区分大小写、字符长度等。
创建任务
POST
/createTaskHostapi.captchasonic.com
Content-Typeapplication/json
{
"apiKey": "YOUR_API_KEY",
"task": {
"type": "OcrImage",
"queries": ["BASE64_CAPTCHA_IMAGE"],
"module": "probot",
"numeric": false,
"case": false,
"minLength": 4,
"maxLength": 6
}
}
响应
{
"code": 200,
"msg": "",
"answers": ["ABC12"]
}
任务参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
type | string | ✅ | OcrImage 或 ImageToTextTask |
queries | string[] | ✅ | base64 编码的验证码图片 |
module | string | 否 | OCR 模块 ID(如 probot) |
numeric | boolean | 否 | 若验证码仅包含数字,设为 true |
case | boolean | 否 | 若答案区分大小写,设为 true |
minLength | integer | 否 | 预期字符数下限 |
maxLength | integer | 否 | 预期字符数上限 |
API 演练场
POST
Log in to auto-fill your API key
Payload
Response
Hit Send to see response
⌘ + Enter
Parameters
Error Codes
terminal