很多有用的文字根本不是以文本形式存在的:促销横幅、截图、扫描页面、包装照片,还有外语菜单。手动抄写很慢,而图片既不能搜索,也不能翻译。Lovely Router 通过 Google Lens 替你读取图片。发送图片链接,以 JSON 返回文字,按图片张数从预付费余额中计费,还可以在同一次调用中要求翻译。用一个 API 密钥,就能从脚本、数据管道或 AI 智能体中使用。
交给你的 AI 智能体
把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。
读取并翻译图片和截图中的文字. Use the Lovely Router data tools: each returns JSON and is billed per result.
- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <the inputs (links, keywords or accounts) and how many results you need>工作原理
托管或找到图片
工具读取公开的图片链接,支持 JPEG、PNG、WebP、BMP、TIFF 和 HEIC。
选择需要的详细程度
把
outputDetail设为text_only只获取纯文本;如果还需要结构和位置,就设为paragraphs、lines、words或full。用language提示图片中的语言;需要翻译时再加上translateTo。使用这些文字
搜索、存储、交给模型处理,或者与同一张图片的上一个版本做对比。
一次请求读取图片中的文字
读取图片中的文字(OCR)在 imageUrl 中接受一个图片链接。一张图片对应一条结果:
curl https://lovelyrouter.com/v1/tools/image-ocr/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"imageUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
"outputDetail": "text_only"
},
"max_results": 1
}'运行超过 60 秒仍未结束时会返回 202;轮询方法见运行工具。要处理很多张图片,请为每张图片各发起一次运行。
每张图片返回什么
| 字段组 | 你能获得的内容 |
|---|---|
| 文本 | 图片中找到的全部文字 |
| 结构 | 段落、行或单词,取决于 outputDetail |
| 位置 | 段落、行或单词在图片中的位置 |
| 翻译 | 以 translateTo 中设置的语言给出的文字 |
使用 text_only 时只返回文字。需要工具能返回的全部内容时,选择 full。
实用配方
从外语网站收集横幅图片,逐张运行并把 translateTo 设为 en,给商品运营团队一张英文的优惠对照表。
把客服截图交给工具处理,把文字与工单一起存储,这样只出现在图片里的错误信息也能搜到。
用 paragraphs 保持阅读顺序,再把文字交给模型来总结或提取所需字段。
用 text_only 读取你自己的设计稿,与批准的文案对比,找出错别字和过期的价格。
把这个工具提供给 AI 智能体,当页面返回的是图片而不是文字时,它可以读取图片,而不是直接放弃。
更想直接用自然语言提问?连接 MCP 服务器,然后对 Claude Code 或 Cursor 说:"读取这个图片 URL 中的文字,翻译成英文,并告诉我优惠内容是什么。把 max_results 设为 1。"
搭配其他工具
图片总有来源。下面这些工具可以找到或截取图片:
用 Google Lens 识别图片中的文字:全文,或带位置的段落、行和单词;可选翻译。
网页的整页截图(PNG 或 PDF),返回图片链接。
爬取整个网站(或其中一部分),把每个页面转成干净、可直接给 LLM 使用的 Markdown。适合 RAG 和文档站点。
Google 广告透明度中心中某广告主的广告:形式、文案、投放日期、地区。
website-screenshot把页面截取为 PNG 或 PDF,并返回图片链接,可以直接送去做 OCR。website-crawl把整个网站转成 markdown,每个页面一条结果。google-ads-transparency列出竞争对手的广告,需要同时获取这些广告的文案时可以使用。
关于从公开网络提取数据的更多内容,请看网页数据提取。
费用说明
按图片付费:启动运行时会预留它的最高费用,即每次调用费加上每张图片的费用乘以 max_results,结束后按实际返回的结果结算,预留的剩余部分退回你的余额。失败或超时的运行只为已交付的图片付费,在开始时就被拒绝的运行不收费。
读取 500 张图片,就按 500 张图片计费。没有订阅,也没有每月最低消费:最低充值 $5,工具和模型共用一个余额。上方卡片显示的是当前价格;价格页面列出了所有工具。
常见问题
它能读取哪些图片格式?+
通过公开链接读取 JPEG、PNG、WebP、BMP、TIFF 和 HEIC。
能读取私有文件或本地文件吗?+
输入必须是公开的图片链接。请把文件上传到可以被访问的地方,再传入该链接。
它能翻译文字吗?+
可以。把 translateTo 设为 ISO 639-1 代码,例如 en、de 或 es,文字就会同时被翻译。用 language 提示图片中的语言。
怎样获取单词的位置?+
把 outputDetail 设为 words、lines 或 paragraphs 可获得带位置的文字,设为 full 也可以。text_only 只返回文字。
需要订阅吗?+
不需要。你向预付费余额充值,每次运行从中扣费。失败的运行只为已交付的结果付费,不会自动续费。