All skills
iflytek avatar

/iflytek-ocr-invoice

@0515799
by iflytekiflytek/ifly-skills218 stars
27

Use when user asks to recognize invoices, extract receipt data, or OCR bills and tickets. Recognize and extract structured data from invoices, receipts, and bills using iFlytek OCR API (科大讯飞票据识别). Supports VAT invoices, taxi receipts, train tickets, toll invoices, medical bills, bank receipts, and more.

Use this Skill: https://skilld.dev/gh/iflytek/ifly-skills/iflytek-ocr-invoice

This session only. Nothing lands on disk.

README.md

≈484 tokens on demand. Your agent reads this file only when SKILL.md points to it.

iFly OCR Invoice

基于讯飞票据识别 API,从发票、收据、账单等票据图片中提取结构化字段。对应脚本为 scripts/invoice.py,纯 Python 标准库实现,无需安装第三方依赖。

前置条件

  1. 在讯飞控制台开通票据识别服务。
  2. 配置环境变量:
export IFLY_APP_ID="your_app_id"
export IFLY_API_KEY="your_api_key"
export IFLY_API_SECRET="your_api_secret"

兼容说明:设置任意 IFLY_* 凭证变量(包括空值)后,仅使用该组,缺项报错;未设置标准组时,依次尝试 XFYUN_*、XFEI_*,不跨组拼接。旧前缀会在 stderr 输出一次不含凭证值的迁移提示。

快速开始

# 识别增值税发票
python3 scripts/invoice.py ./vat_invoice.jpg

# 识别医疗票据并输出原始响应
python3 scripts/invoice.py ./medical_bill.png --raw

# 识别出租车票
python3 scripts/invoice.py ./taxi_receipt.jpg

参数说明

参数 说明
image 票据图片或 PDF 路径
--raw 输出原始 API JSON

限制说明

  • 完整文档与错误码说明见 SKILL.md。

参考链接

扩展说明

支持格式

脚本按文件后缀自动识别类型,支持:

  • png
  • jpg / jpeg
  • bmp
  • gif
  • tif / tiff
  • pdf

输出说明

  • 默认输出为人类可读的字段列表,例如票据类型、发票代码、发票号码、日期、金额等。
  • 传入 --raw 时输出完整 JSON,适合调试或二次处理。

适用场景

  • 发票录入
  • 报销单据结构化提取
  • 出租车票、火车票、医疗票据归档

实现说明

  • 鉴权方式为 HMAC-SHA256。
  • 默认接口地址为 https://api.xf-yun.com/v1/private/sc45f0684。

Source: SKILL.md on GitHub

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill provides invoice and receipt OCR capabilities using the iFlytek API. It uses a Python script with standard libraries, manages credentials securely via environment variables, and communicates only with the vendor's official API endpoint. No malicious patterns were detected.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 0515799. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated last week
Other metadata
metadata
{
  "homepage": "https://www.xfyun.cn/services/ocr",
  "openclaw": "{\"emoji\":\"🧾\",\"dimensions\":[\"票据识别\",\"发票OCR\"],\"user_instructions\":[\"识别这张发票\",\"提取发票信息\",\"帮我OCR这张票据\"],\"requires\":{\"bins\":[\"python3\"],\"env\":[\"IFLY_APP_ID\",\"IFLY_API_KEY\",\"IFLY_API_SECRET\"]},\"primaryEnv\":\"IFLY_API_KEY\"}"
}

README badge

README badge for iflytek/ifly-skills/iflytek-ocr-invoice