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 系統的理想工具