Jina AI Reader 是一个开源工具,旨在将任意URL转换为大语言模型(LLM)友好的输入格式。该项目由 Jina AI 开发和维护,采用 Apache-2.0 开源许可证,为 AI Agent 和 RAG(检索增强生成)系统提供高质量的网页内容提取服务。
https://r.jina.ai/
前缀原始URL: https://en.wikipedia.org/wiki/Artificial_intelligence
转换URL: https://r.jina.ai/https://en.wikipedia.org/wiki/Artificial_intelligence
https://s.jina.ai/
前缀查询: Who will win 2024 US presidential election?
搜索URL: https://s.jina.ai/Who%20will%20win%202024%20US%20presidential%20election%3F
Image [idx]: [caption]
x-with-generated-alt: true
site=example.com
curl 'https://s.jina.ai/When%20was%20Jina%20AI%20founded%3F?site=jina.ai&site=github.com'
# 启用图片描述
x-with-generated-alt: true
# 转发Cookie设置
x-set-cookie: [cookie_string]
# 绕过缓存
x-no-cache: true
# 自定义缓存容忍度(秒)
x-cache-tolerance: [seconds]
# 指定代理服务器
x-proxy-url: [proxy_url]
# 目标元素选择器
x-target-selector: [css_selector]
# 等待特定元素出现
x-wait-for-selector: [css_selector]
# 设置超时时间
x-timeout: [seconds]
# 返回Markdown格式(绕过可读性过滤)
x-respond-with: markdown
# 返回原始HTML
x-respond-with: html
# 返回纯文本
x-respond-with: text
# 返回网页截图URL
x-respond-with: screenshot
# 启用流式模式
curl -H "Accept: text/event-stream" https://r.jina.ai/[URL]
# 获取JSON格式响应
curl -H "Accept: application/json" https://r.jina.ai/[URL]
JSON响应结构:
{
"url": "原始URL",
"title": "页面标题",
"content": "提取的内容"
}
由于SPA的特殊性,提供了以下解决方案:
对于包含 #
的URL,使用POST方法:
curl -X POST 'https://r.jina.ai/' -d 'url=https://example.com/#/route'
针对显示预加载内容的网页:
curl 'https://example.com/' -H 'x-timeout: 30'
curl 'https://example.com/' -H 'x-wait-for-selector: #content'
curl -H "Accept: text/event-stream" https://r.jina.ai/https://example.com/
Jina AI Reader 是一个功能强大的开源工具,专门为现代AI系统设计,解决了LLM在处理网页内容时面临的格式和质量问题。通过简单的URL前缀添加,就能获得高质量、结构化的网页内容,是构建AI Agent和RAG系统的理想工具