Community研究與資料分析github.com

arXiv 學術論文搜尋

透過免費的 REST API 搜尋並取得 arXiv 上的學術論文,無需 API 金鑰或額外相依套件,僅需 curl。

arXiv 學術論文搜尋 是什麼?

這個技能讓 AI 代理能夠直接與 arXiv 的公開 API 互動,進行學術論文的搜尋、擷取與解析。它不需要任何 API 金鑰或第三方套件,只依賴 curl 和 Python 標準函式庫,因此設定快速且可攜性高。支援所有主流平台,包括 Claude Code、Cursor、Codex 等,只要環境內有 curl 與 Python 即可使用。技能涵蓋完整的學術研究流程:從搜尋論文、以乾淨格式解析 XML 結果、讀取摘要與全文 PDF,到利用 Semantic Scholar API 取得引用數據與相關論文推薦。另外也內建 BibTeX 文獻條目產生功能,並提供 helper script (scripts/search_arxiv.py) 來簡化常見操作。Rate limit 方面,arXiv 約每秒 0.3 次請求,Semantic Scholar 每秒 1 次(若使用 API 金鑰可提升至 100 次)。整體而言,這個技能將終端環境轉化為強大的學術研究工具,非常適合需要快速進行文獻回顧與引文分析的開發者或研究人員。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add 0x-Shashi/grok-skill-converter

Installed? Explore more 研究與資料分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

arXiv 學術論文搜尋 是做什麼的?

透過 arXiv 免費的 REST API 搜尋並取得學術論文。無需 API 金鑰,無需額外相依套件——僅需 curl。

快速參考

動作指令
搜尋論文curl "https://export.arxiv.org/api/query?search_query=all:QUERY&max_results=5"
取得特定論文curl "https://export.arxiv.org/api/query?id_list=2402.03300"
閱讀摘要(網頁)web_extract(urls=["https://arxiv.org/abs/2402.03300"])
閱讀全文(PDF)web_extract(urls=["https://arxiv.org/pdf/2402.03300"])

搜尋論文

API 回傳 Atom XML。可使用 grep/sed 解析,或透過 python 管道輸出取得乾淨格式。

基本搜尋

curl -s "https://export.arxiv.org/api/query?search_query=all:GRPO+reinforcement+learning&max_results=5"

乾淨輸出(將 XML 解析為可讀格式)

curl -s "https://export.arxiv.org/api/query?search_query=all:GRPO+reinforcement+learning&max_results=5&sortBy=submittedDate&sortOrder=descending" | python -c "
import sys, xml.etree.ElementTree as ET
ns = {'a': 'http://www.w3.org/2005/Atom'}
root = ET.parse(sys.stdin).getroot()
for i, entry in enumerate(root.findall('a:entry', ns)):
    title = entry.find('a:title', ns).text.strip().replace('\n', ' ')
    arxiv_id = entry.find('a:id', ns).text.strip().split('/abs/')[-1]
    published = entry.find('a:published', ns).text[:10]
    authors = ', '.join(a.find('a:name', ns).text for a in entry.findall('a:author', ns))
    summary = entry.find('a:summary', ns).text.strip()[:200]
    cats = ', '.join(c.get('term') for c in entry.findall('a:category', ns))
    print(f'{i+1}. [{arxiv_id}] {title}')
    print(f'   作者: {authors}')
    print(f'   發表日期: {published} | 類別: {cats}')
    print(f'   摘要: {summary}...')
    print(f'   PDF: https://arxiv.org/pdf/{arxiv_id}')
    print()
"

搜尋語法

前綴搜尋範圍範例
all:所有欄位all:transformer+attention
ti:標題ti:large+language+models
au:作者au:vaswani
abs:摘要abs:reinforcement+learning
cat:類別cat:cs.AI
co:註解co:accepted+NeurIPS

布林運算子

# AND(使用 + 時為預設)
search_query=all:transformer+attention

# OR
search_query=all:GPT+OR+all:BERT

# AND NOT
search_query=all:language+model+ANDNOT+all:vision

# 精確片語
search_query=ti:"chain+of+thought"

# 組合搜尋
search_query=au:hinton+AND+cat:cs.LG

排序與分頁

參數選項
sortByrelevance, lastUpdatedDate, submittedDate
sortOrderascending, descending
start結果偏移量(從 0 開始)
max_results結果數量(預設 10,最多 30000)
# cs.AI 類別最新 10 篇論文
curl -s "https://export.arxiv.org/api/query?search_query=cat:cs.AI&sortBy=submittedDate&sortOrder=descending&max_results=10"

取得特定論文

# 透過 arXiv ID
curl -s "https://export.arxiv.org/api/query?id_list=2402.03300"

# 多篇論文
curl -s "https://export.arxiv.org/api/query?id_list=2402.03300,2401.12345,2403.00001"

產生 BibTeX

在取得論文詮釋資料後,可產生 BibTeX 文獻條目:

{% raw %}

curl -s "https://export.arxiv.org/api/query?id_list=1706.03762" | python -c "
import sys, xml.etree.ElementTree as ET
ns = {'a': 'http://www.w3.org/2005/Atom', 'arxiv': 'http://arxiv.org/schemas/atom'}
root = ET.parse(sys.stdin).getroot()
entry = root.find('a:entry', ns)
if entry is None: sys.exit('找不到論文')
title = entry.find('a:title', ns).text.strip().replace('\n', ' ')
authors = ' and '.join(a.find('a:name', ns).text for a in entry.findall('a:author', ns))
year = entry.find('a:published', ns).text[:4]
raw_id = entry.find('a:id', ns).text.strip().split('/abs/')[-1]
cat = entry.find('arxiv:primary_category', ns)
primary = cat.get('term') if cat is not None else 'cs.LG'
last_name = entry.find('a:author', ns).find('a:name', ns).text.split()[-1]
print(f'@article{{{last_name}{year}_{raw_id.replace(\".\", \"\")},')
print(f'  title     = {{{title}}},')
print(f'  author    = {{{authors}}},')
print(f'  year      = {{{year}}},')
print(f'  eprint    = {{{raw_id}}},')
print(f'  archivePrefix = {{arXiv}},')
print(f'  primaryClass  = {{{primary}}},')
print(f'  url       = {{https://arxiv.org/abs/{raw_id}}}')
print('}')
"

{% endraw %}

閱讀論文內容

找到論文後,閱讀其內容:

# 摘要頁面(快速,包含詮釋資料與摘要)
web_extract(urls=["https://arxiv.org/abs/2402.03300"])

# 全文(PDF → markdown,透過 Firecrawl)
web_extract(urls=["https://arxiv.org/pdf/2402.03300"])

如需在本機處理 PDF,請參閱 ocr-and-documents 技能。

常用類別

類別領域
cs.AI人工智慧
cs.CL計算語言學與自然語言處理
cs.CV電腦視覺
cs.LG機器學習
cs.CR密碼學與安全
stat.ML機器學習(統計學)
math.OC最佳化與控制
physics.comp-ph計算物理

完整列表:https://arxiv.org/category_taxonomy

輔助腳本

scripts/search_arxiv.py 腳本負責處理 XML 解析,並提供乾淨的輸出:

python scripts/search_arxiv.py "GRPO reinforcement learning"
python scripts/search_arxiv.py "transformer attention" --max 10 --sort date
python scripts/search_arxiv.py --author "Yann LeCun" --max 5
python scripts/search_arxiv.py --category cs.AI --sort date
python scripts/search_arxiv.py --id 2402.03300
python scripts/search_arxiv.py --id 2402.03300,2401.12345

無需額外相依套件——僅使用 Python 標準函式庫。


Semantic Scholar(引用、相關論文、作者介紹)

arXiv 本身不提供引用資料或推薦。請使用 Semantic Scholar API 來取得這些資訊——免費,基本使用無需金鑰(每秒 1 次請求),回傳 JSON 格式。

取得論文詳細資訊 + 引用數

# 透過 arXiv ID
curl -s "https://api.semanticscholar.org/graph/v1/paper/arXiv:2402.03300?fields=title,authors,citationCount,referenceCount,influentialCitationCount,year,abstract" | python -m json.tool

# 透過 Semantic Scholar 論文 ID 或 DOI
curl -s "https://api.semanticscholar.org/graph/v1/paper/DOI:10.1234/example?fields=title,citationCount"

取得某篇論文的被引用資料(哪些論文引用了它)

curl -s "https://api.semanticscholar.org/graph/v1/paper/arXiv:2402.03300/citations?fields=title,authors,year,citationCount&limit=10" | python -m json.tool

取得某篇論文的參考文獻(它引用了哪些論文)

curl -s "https://api.semanticscholar.org/graph/v1/paper/arXiv:2402.03300/references?fields=title,authors,year,citationCount&limit=10" | python -m json.tool

搜尋論文(arXiv 搜尋的替代方案,回傳 JSON)

curl -s "https://api.semanticscholar.org/graph/v1/paper/search?query=GRPO+reinforcement+learning&limit=5&fields=title,authors,year,citationCount,externalIds" | python -m json.tool

取得論文推薦

curl -s -X POST "https://api.semanticscholar.org/recommendations/v1/papers/" \
  -H "Content-Type: application/json" \
  -d '{"positivePaperIds": ["arXiv:2402.03300"], "negativePaperIds": []}' | python -m json.tool

作者介紹

curl -s "https://api.semanticscholar.org/graph/v1/author/search?query=Yann+LeCun&fields=name,hIndex,citationCount,paperCount" | python -m json.tool

有用的 Semantic Scholar 欄位

title, authors, year, abstract, citationCount, referenceCount, influentialCitationCount, isOpenAccess, openAccessPdf, fieldsOfStudy, publicationVenue, externalIds(包含 arXiv ID、DOI 等)


完整研究流程

  1. 探索:python scripts/search_arxiv.py "你的主題" --sort date --max 10
  2. 評估影響力:curl -s "https://api.semanticscholar.org/graph/v1/paper/arXiv:ID?fields=citationCount,influentialCitationCount"
  3. 閱讀摘要:web_extract(urls=["https://arxiv.org/abs/ID"])
  4. 閱讀全文:web_extract(urls=["https://arxiv.org/pdf/ID"])
  5. 尋找相關研究:curl -s "https://api.semanticscholar.org/graph/v1/paper/arXiv:ID/references?fields=title,citationCount&limit=20"
  6. 取得推薦:POST 到 Semantic Scholar 推薦端點
  7. 追蹤作者:curl -s "https://api.semanticscholar.org/graph/v1/author/search?query=NAME"

速率限制

API速率驗證
arXiv約每秒 0.3 次請求無需
Semantic Scholar每秒 1 次無需(使用 API 金鑰可提升至每秒 100 次)

備註

  • arXiv 回傳 Atom XML——請使用輔助腳本或解析片段取得乾淨輸出
  • Semantic Scholar 回傳 JSON——可透過 python -m json.tool 管道輸出以提升可讀性
  • arXiv ID 格式:舊格式(hep-th/0601001)與新格式(2402.03300)
  • PDF:https://arxiv.org/pdf/{id}——摘要:https://arxiv.org/abs/{id}
  • HTML(若可用):https://arxiv.org/html/{id}
  • 如需在本機處理 PDF,請參閱 ocr-and-documents 技能

ID 版本控制

  • arxiv.org/abs/1706.03762 永遠解析到最新版本
  • arxiv.org/abs/1706.03762v1 指向特定不可變版本
  • 產生引用時,請保留您實際閱讀的版本後綴,以防止引用漂移(後續版本可能大幅更改內容)
  • API <id> 欄位回傳的是帶有版本號的 URL(例如 http://arxiv.org/abs/1706.03762v7)

已撤回論文

論文可能在提交後被撤回。發生這種情況時:

  • <summary> 欄位會包含撤稿通知(請尋找 "withdrawn" 或 "retracted" 關鍵字)
  • 詮釋資料欄位可能不完整
  • 在將某個結果視為有效的論文之前,請務必檢查摘要內容。

相關技能