Search arXiv preprint papers (free, no API Key required).
Use Cases
- The user says "search for the latest papers on arXiv about XXX"
- The user needs the latest research in a certain field
- The user needs to download paper PDFs
Search Methods
arXiv API Search
# 按关键词搜索(最近 10 篇)
curl -s "http://export.arxiv.org/api/query?search_query=all:large+language+model+agent&start=0&max_results=10&sortBy=submittedDate&sortOrder=descending" | python3 -c "
import xml.etree.ElementTree as ET
import sys
ns = {'atom': 'http://www.w3.org/2005/Atom'} tree = ET.parse(sys.stdin) root = tree.getroot()
for i, entry in enumerate(root.findall('atom:entry', ns), 1): title = entry.find('atom:title', ns).text.strip().replace('\n', ' ') published = entry.find('atom:published', ns).text[:10] authors = [a.find('atom:name', ns).text for a in entry.findall('atom:author', ns)] summary = entry.find('atom:summary', ns).text.strip()[:200]
# 获取 PDF 链接
pdf_link = ''
for link in entry.findall('atom:link', ns):
if link.get('title') == 'pdf':
pdf_link = link.get('href')
arxiv_id = entry.find('atom:id', ns).text.split('/')[-1]
print(f'{i}. [{published}] {title}')
print(f' 作者: {\", \".join(authors[:3])}{\"...\" if len(authors) > 3 else \"\"}')
print(f' ID: {arxiv_id}')
print(f' PDF: {pdf_link}')
print(f' 摘要: {summary}...')
print()
"
### 按分类搜索
```bash
# 搜索 cs.AI 分类的最新论文
curl -s "http://export.arxiv.org/api/query?search_query=cat:cs.AI&start=0&max_results=5&sortBy=submittedDate&sortOrder=descending"
Search by Author
curl -s "http://export.arxiv.org/api/query?search_query=au:hinton&max_results=5&sortBy=submittedDate&sortOrder=descending"
Download PDF
# 下载论文 PDF
curl -L -o "/tmp/paper.pdf" "https://arxiv.org/pdf/2301.12345"
Generate BibTeX
# 从 arXiv ID 生成 BibTeX
arxiv_id = "2301.12345"
bibtex = f"""@article{{{arxiv_id.replace('.', '_')},
title={{论文标题}},
author={{作者}},
journal={{arXiv preprint arXiv:{arxiv_id}}},
year={{2023}}
}}"""
print(bibtex)
Common arXiv Categories
| Category Code | Field |
|---|---|
| cs.AI | Artificial Intelligence |
| cs.CL | Computational Linguistics (NLP) |
| cs.CV | Computer Vision |
| cs.LG | Machine Learning |
| cs.SE | Software Engineering |
| stat.ML | Statistical Machine Learning |
Output Specifications
- Display the first 5-10 papers
- Each paper includes: title, authors, date, arXiv ID, PDF link
- Sorted by submission date by default (newest first)
- Display the abstract or download the PDF when the user requests it