arXiv Scraper: Papers, Abstracts & PDFs

Live-tested arxiv scraper: metadata via the official API, full paper text from HTML pages, bulk JSONL from listing pages, plus the rules and dead ends.

MMotherlode Lab9 min read
Magpie title card: arXiv Scraper: Papers, Abstracts & PDFs

arXiv is the least hostile big site I have ever scraped. The robots.txt explicitly allows /abs, /pdf, /html, and /list, and the organization publishes an official metadata API because it wants programs to read papers. An arxiv scraper’s real work is not getting past defenses — it is picking the right door for each data type, because three of the six doors lead to garbage. Everything below ran on 2026-10-17 from a home connection. One ground rule: arXiv is a nonprofit on donated infrastructure, and its rules are printed in plain text — Crawl-delay 15 on the main site, one API request every 3 seconds. This page stays inside both.

What an arXiv scraper is allowed to take

arXiv prints its rules in arxiv.org/robots.txt, and unlike most sites, the file reads as an access policy rather than a lawyer’s ransom note. I pulled the live file today:

Path robots.txt What lives there
/abs/{id} Allowed Abstract page: title, authors, abstract, submission history
/pdf/{id} Allowed The PDF itself
/html/{id} Allowed Full-text HTML conversion of the paper
/list/{category} Allowed Listing pages: recent papers per category
/search?... Disallowed Query results (off limits to crawlers)
/e-print/{id} Disallowed LaTeX source archive
/refs/{id}, /cits/{id} Disallowed References and citation lists
Crawl-delay 15 seconds Between requests to the main site

That Crawl-delay 15 is the honest headline for bulk plans: a deep crawl of arxiv.org at compliant pace costs 15 seconds per page. A 300-page crawl is over an hour before you have parsed anything. The fast, compliant path for metadata is a different surface: the export API at export.arxiv.org, which arXiv documents for exactly this purpose and whose terms of use set the pace: “make no more than one request every three seconds, and limit requests to a single connection at a time.”

One wrinkle worth knowing before someone quotes robots.txt at you: export.arxiv.org/robots.txt says Disallow: / for everything. That looks like a contradiction: the API host forbids crawling while arXiv begs you to use the API. The resolution is that robots.txt governs crawlers indexing pages, while the API terms govern programs reading metadata. Follow the stated rate limit, don’t open parallel connections, and you are inside the intended use. Past a few thousand papers, stop looping entirely and take arXiv’s bulk routes: a Kaggle metadata snapshot and OAI-PMH feeds updated daily.

Six doors, and what each one returns

I fetched all of these today with Magpie, a local CLI scraper. The vertical is free: no LLM key, no tokens.

You want Door What came back live
Title, authors, abstract, date --vertical arxiv on an /abs/ or /pdf/ URL Clean 5-field record via the export API
Full paper text Plain scrape of /html/{id} 3,329–4,491 words of Markdown per paper
The abstract page as Markdown Plain scrape of /abs/{id} Works, but buried in arXivLabs boilerplate
Text from the PDF Plain scrape of /pdf/{id} 166 words of AttentionIsAllYouNeedAshishVaswani mush
Paper IDs to feed the loop Plain scrape of /list/cs.CL/recent 50 /abs/ links
Search results /search?... Fetches fine mechanically; robots.txt disallows it, so I don’t

Two of those rows hide sharp edges. The search one first: I requested a search URL once to test whether the tool refuses. It doesn’t: the page came back with numbered results and abstracts. arXiv’s robots.txt disallows the path, so treat that fetch as evidence, not a recipe. For keyword search, the export API accepts a search_query parameter, and that is the compliant route.

Metadata and abstracts: the arxiv vertical

Magpie ships a dedicated arxiv vertical that recognizes /abs/{id} and /pdf/{id} URLs and answers them from the export API. One command, typed record, zero parsing:

magpie scrape "https://arxiv.org/abs/1706.03762" --vertical arxiv
{
  "url": "https://arxiv.org/abs/1706.03762",
  "vertical": "arxiv",
  "record": {
    "title": "Attention Is All You Need",
    "authors": ["Ashish Vaswani", "Noam Shazeer", "Niki Parmar",
      "Jakob Uszkoreit", "Llion Jones", "Aidan N. Gomez",
      "Lukasz Kaiser", "Illia Polosukhin"],
    "published": "2017-06-12T17:57:34Z",
    "summary": "The dominant sequence transduction models are based on ...",
    "url": "https://arxiv.org/abs/1706.03762"
  }
}

(abridged; the summary field carries the full abstract, 166 words for this paper)

Five fields per record: title, authors, published, summary, url. The details that make it pleasant:

  • PDF URLs normalize. The same command on https://arxiv.org/pdf/1706.03762 returns the same record, rewritten to the canonical /abs/ URL. Feed it either form.
  • Version suffixes work. /abs/1706.03762v7 returns the paper with the version intact in the page title.
  • Dead IDs fail loudly. A well-formed but nonexistent ID returns a typed error (vertical: arxiv: no entries for 2401.99999), not a null record that poisons your dataset downstream. A URL the vertical doesn’t handle, like /html/..., also fails loudly: “vertical extractor does not handle URL.”

Now the honest gap. The export API’s Atom feed carries more than five fields. The raw response for Mistral 7B includes three category terms (cs.CL, cs.AI, cs.LG), a primary_category, and an author-supplied comment (“Models and code are available at…”). Magpie’s record drops all of those. If your pipeline needs categories or the comment, either parse the Atom feed yourself or run Magpie’s schema extraction over the /abs/ page — extract structured data from text covers that pattern.

One more thing people forget: reuse rights are per paper, not per site. Mistral 7B ships under CC BY 4.0; the Transformer paper carries a Google notice granting table-and-figure reuse only for journalistic or scholarly work, with attribution. The license icon sits on every abstract page. Check it before you redistribute anything.

Full paper text: take the HTML door, not the PDF door

Since late 2023 arXiv has been converting submissions to full-text HTML with LaTeXML, and the coverage is better than “experimental” suggests: Mistral 7B (2023) scraped to 3,329 clean words of Markdown, and the 2017 Transformer paper scraped to 4,491 words, conclusion included. The command is the plain scraper with no vertical at all:

magpie scrape "https://arxiv.org/html/2310.06825v1"

The Markdown comes out structured (###### Abstract, section headings, paragraph flow), ready for an LLM pipeline or plain text analysis. If a paper has no HTML version, its /abs/ page shows no “HTML (experimental)” link; check that link before you build a pipeline that assumes 100% coverage.

The PDF door is the trap. Magpie reads PDFs, so I asked it for the Transformer paper’s text directly:

magpie scrape "https://arxiv.org/pdf/1706.03762"

What came back was 166 words of this:

Providedproperattributionisprovided,Googleherebygrantspermissiontoreproduce
thetablesandfiguresinthispap...

No spaces. Two-column PDF layouts defeat naive text extraction: glyph positions survive, word boundaries do not. My verdict after running both doors: never parse the PDF for text on arXiv. The HTML version exists precisely so you don’t have to.

There’s a separate question people conflate with this: downloading PDFs to build a local library. Magpie extracts records and text; it does not save files to disk. For a PDF library, /pdf/ is robots-allowed, so plain HTTP requests at a polite pace do the job: curl -O in a loop with a sleep between hits.

Bulk: from listing page to JSONL

Listing pages are the discovery mechanism robots.txt actually allows. One fetch of the recent-computational-linguistics page yields 50 paper links:

magpie scrape "https://arxiv.org/list/cs.CL/recent"

The cleaned Markdown contains [arXiv:2610.22355](/abs/2610.22355)-style links. I counted 50 on today’s page. From there, a compliant loop over the export API:

for id in $(magpie scrape "https://arxiv.org/list/cs.CL/recent" \
    | python3 -c "import json,sys,re; print('\n'.join(re.findall(r'/abs/([\w.]+)', json.load(sys.stdin)['markdown'])[:10]))"); do
  magpie scrape "https://arxiv.org/abs/$id" --vertical arxiv >> papers.json
  sleep 3
done

I ran that shape against five landmark papers (Transformer, Mistral 7B, GPT-3, BERT, RoBERTa) with sleep 3 between calls: 25 seconds wall clock, five complete records, every author list and date correct. At one request per 3 seconds, a 1,000-paper run is about 50 minutes. Fine for an overnight corpus build; that’s the deal.

One output gotcha bit me, so it’s worth your five seconds: the appended file is five pretty-printed multi-line objects, not line-delimited JSON (--format jsonl doesn’t compact it either). A line-oriented JSONL reader will choke. Parse it with a decoder loop instead:

import json
dec = json.JSONDecoder()
txt = open("papers.json").read()
i, papers = 0, []
while (j := txt.find("{", i)) >= 0:
    obj, i = dec.raw_decode(txt, j)
    papers.append(obj["record"])

And when “bulk” means millions of rows, the loop is the wrong tool by arXiv’s own guidance; that’s what the Kaggle snapshot and OAI-PMH exist for. If your end goal is alerts on new papers rather than a one-time corpus, get alerts for new arXiv papers covers the watch-mode path, and scraping for machine learning covers what to do with the corpus once you have it. The site-by-site hub at /scrape has the same treatment for other sites.

Where an arXiv scraper still breaks

  • No search. /search is robots-disallowed. The export API’s search_query parameter is the compliant alternative, and Magpie’s vertical does not expose it; you’d hit the API with your own HTTP client for query-driven collection.
  • No citation graphs. /refs and /cits are disallowed. Semantic Scholar and OpenAlex both publish citation data through their own APIs; use those.
  • No LaTeX source. /e-print is disallowed by robots. Read papers, don’t harvest their source trees.
  • Five fields per record. Categories, comments, and DOI fields stay in the Atom feed; the vertical’s record doesn’t carry them.
  • No HTML version on some papers. Scanned and non-LaTeX submissions may never get one. Absence is visible on the /abs/ page. Check before batching.
  • Slow crawls by design. Crawl-delay 15 means a same-domain crawl of arxiv.org crawls literally. The API loop is the better bulk path here.

FAQ

Is scraping arXiv allowed? Yes, within printed limits. robots.txt allows /abs, /pdf, /html, and /list at Crawl-delay 15, disallows /search, /e-print, and citation paths, and the API terms cap programmatic reads at one request every 3 seconds. For anything large, arXiv prefers its bulk routes.

Does arXiv have an official API? Yes: the export API at export.arxiv.org returns Atom XML for any paper ID or query, limited to one request per 3 seconds on a single connection. It is what Magpie’s arxiv vertical calls when you pass --vertical arxiv, which is why the records come back clean and typed.

How do I download arXiv PDFs in bulk? /pdf/{id} is robots-allowed, so scripted downloads at a polite pace are the norm. Magpie extracts data but doesn’t save files, so use curl -O with a sleep. For thousands of papers, arXiv’s bulk-data routes beat per-paper downloads.

Why is text from an arXiv PDF garbled? arXiv papers are two-column PDFs, and naive text extraction returns glyph runs without spaces: AttentionIsAllYouNeed instead of “Attention Is All You Need”. Scrape the /html/{id} version instead (even the 2017 Transformer paper has one); the text comes out clean.

How do I get paper categories or DOI? Magpie’s vertical record carries title, authors, published date, abstract, and URL only. Categories and author comments ride in the raw Atom feed, and the DOI element appears there for papers that have one. Parse the feed directly, or run schema-driven extraction over the abstract page.

Stop renting credits.

One flat price, your machine, your keys.

Download free for Windows, macOS and Linux

Windows · macOS · Linux $49/mo flat, cancel anytime