加载接口文档…
2.2万
累计调用
1444ms
平均响应
99.73%
服务可用性
300 次/日
免费额度
复制文档地址
https://apizero.cn/aidocs/ocr-text/raw.md匿名每日 5 次、QPS 1;登录用户每日 30 次、QPS 2(全部免费)。OCR 结果缓存 1 小时,相同图片只实际调用服务一次。
| 名称 | 类型 | 说明 |
|---|---|---|
| input_type | string | 必填 · 输入类型:url=图片URL / base64=图片base64编码 · 示例:url |
| input_data | string | 必填 · 图片数据。input_type=url 时为 http/https 完整 URL;input_type=base64 时为 base64 字符串(最大 6MB,可选 data:image/jpeg;base64, 前缀) · 示例:https://dummyimage.com/400x100/000/fff.png&text=Hello+World |
| 名称 | 类型 | 说明 |
|---|---|---|
| Authorization | string | 可选 · 推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。 |
| Content-Type | string | 必填 · POST 请求体类型,固定 application/x-www-form-urlencoded |
| 名称 | 类型 | 说明 |
|---|---|---|
| input_type | string | 回传输入类型(url 或 base64) |
| text_count | number | 识别到的文本行数 |
| text_list | array | 按原图顺序的逐行文本数组(字符串数组) |
| full_text | string | 用换行符 \n 拼接的完整文本字符串,便于前端直接展示 |
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn |
{
"code": 0,
"msg": "成功",
"data": {
"input_type": "url",
"text_count": 3,
"text_list": [
"商品名称:无线蓝牙耳机",
"单价:¥299.00",
"数量:2"
],
"full_text": "商品名称:无线蓝牙耳机\n单价:¥299.00\n数量:2"
},
"request_id": "abc123def456",
"tips": "极数本源 · https://apizero.cn"
}本接口第三方 OCR 服务,识别准确率取决于图片清晰度(建议 ≥720P 分辨率、文字清晰无遮挡)。OCR 服务为付费配额,请合理使用。识别失败原因可能包括:图片模糊、文字被遮挡、URL 不可达、base64 数据损坏等。