加载接口文档…
增值税发票 OCR 识别,支持增值税专用发票、普通发票、电子普票,输出 22+ 个结构化字段。 • 双输入模式: - input type=url:传入公网可访问的图片 URL(http/https) - input type=base64:传入 base64 编码字符串(≤6M…
由 极数本源 提供·更新于 3 天前
122
累计调用
2623ms
平均响应
100.00%
服务可用性
300 次/日
免费额度
无 Key 调用
每日 50 次 · QPS 1
登录免费
当前方案每日 300 次 · QPS 2
黄金会员
每日 50,000 次 · QPS 10
钻石会员
每日 100,000 次 · QPS 30
企业会员
企业接口额度 · QPS 120
匿名每日 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://example.com/invoice.jpg |
| 名称 | 类型 | 说明 |
|---|---|---|
| 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;如使用 base64 模式建议 POST |
| 名称 | 类型 | 说明 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| invoice_name | string | 发票名称(如「增值税电子普通发票」) | ||||||||||||||||||||||||
| invoice_code | string | 发票代码(10-12 位数字) | ||||||||||||||||||||||||
| invoice_no | string | 发票号码(8-20 位数字) | ||||||||||||||||||||||||
| invoice_date | string | 开票日期,格式 YYYY-MM-DD 或 YYYY年MM月DD日 | ||||||||||||||||||||||||
| check_code | string | 校验码(20 位数字,部分电子发票无) | ||||||||||||||||||||||||
| machine_num | string | 机器编号(12 位) | ||||||||||||||||||||||||
| total_price | string | 不含税金额(保留为字符串避免浮点精度问题) | ||||||||||||||||||||||||
| total_tax | string | 税额合计 | ||||||||||||||||||||||||
| total_price_and_tax | string | 价税合计(小写) | ||||||||||||||||||||||||
| big_total_price_and_tax | string | 价税合计(大写中文,如「壹佰元整」) | ||||||||||||||||||||||||
| buyer | object | 购方信息对象 | ||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| seller | object | 销方信息对象(结构同 buyer) | ||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| payee | string | 收款人 | ||||||||||||||||||||||||
| reviewer | string | 复核人 | ||||||||||||||||||||||||
| drawer | string | 开票人 | ||||||||||||||||||||||||
| remarks | string | 备注(含税控盘信息、说明等) | ||||||||||||||||||||||||
| items | array | 商品明细数组,每项含名称/规格/数量/单价/金额/税率/税额等字段(具体字段以服务识别结果为准) | ||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | ||||||||||||||||||||||||
{
"code": 0,
"msg": "成功",
"data": {
"invoice_name": "增值税电子普通发票",
"invoice_code": "011002000311",
"invoice_no": "12345678",
"invoice_date": "2024-08-15",
"check_code": "12345 67890 12345 67890",
"machine_num": "499099111111",
"total_price": "94.34",
"total_tax": "5.66",
"total_price_and_tax": "100.00",
"big_total_price_and_tax": "壹佰圆整",
"buyer": {
"name": "某某科技有限公司",
"taxpayer_no": "91110000XXXXXXXXXX",
"address_phone": "北京市XX区XX路XX号 010-12345678",
"account": "中国银行 6217001234567890"
},
"seller": {
"name": "某某商贸有限公司",
"taxpayer_no": "91310000YYYYYYYYYY",
"address_phone": "上海市XX区XX路XX号 021-87654321",
"account": "工商银行 6222001234567890"
},
"payee": "张三",
"reviewer": "李四",
"drawer": "王五",
"remarks": "",
"items": [
{
"name": "*技术服务*软件开发服务",
"specification": "",
"unit": "",
"quantity": "",
"unit_price": "",
"amount": "94.34",
"tax_rate": "6%",
"tax": "5.66"
}
]
},
"request_id": "abc123def456",
"tips": "极数本源 · https://apizero.cn"
}本接口第三方 OCR 服务,识别准确率取决于图片清晰度(建议 ≥1080P 分辨率)。OCR 服务为付费配额接口,请合理使用,避免恶意刷量。识别失败原因可能包括:图片模糊、非发票类型、URL 不可达、base64 数据损坏等。