Find, download, and verify open-access academic-paper PDFs — legally.
Most "get the PDF" tools hand you a URL and stop. paperfetch goes further: it downloads
the file, confirms it's a real PDF, and confirms it's actually the paper you asked for
(title/author match) — so a plausible-but-wrong open PDF is never saved. It pulls only from
legitimately-open sources: arXiv, the OA aggregators (Unpaywall / OpenAlex / Semantic Scholar /
Crossref), gold-OA publishers (MDPI), open conference proceedings (OpenReview / ACL / AAAI),
Europe PMC, and author/repository copies found by an optional web search.
pip install paperfetch # core (curl_cffi + pymupdf)
pip install "paperfetch[scrape]" # + nicer landing-page link extraction (bs4)
pip install "paperfetch[browser]" # + BrightData Scraping-Browser fallback (playwright)CLI:
paperfetch --arxiv 2502.07868 --out papers
paperfetch --doi 10.3390/math12010001 --title "…" --authors "…"
paperfetch --title "ArchetypeTrader: Reinforcement Learning …" --authors "Bo An" --search
paperfetch --doi 10.1145/3772326.3774721 --jsonLibrary:
from paperfetch import fetch_paper
r = fetch_paper(doi="10.3390/math12010001", title="…", authors="…", out="papers")
if r.ok:
print(r.path, "verified=", r.verified, "via", r.source_url)Custom storage (S3, a DB, …) — implement the tiny Storage protocol:
from paperfetch import fetch_paper, Storage
class MyStore: # has(key)->bool, save(key,data,meta)->str, record_failure(key,reason)->None
...
fetch_paper(doi="…", title="…", storage=MyStore())- Direct-URL constructors for known open hosts (arXiv / OpenReview / ACL / AAAI).
- OA aggregators by DOI — Unpaywall, OpenAlex, Semantic Scholar, Crossref (keyless).
- arXiv title search.
- Landing-page scrape of the
citation_pdf_urlmeta tag. - Europe PMC / MDPI gold-OA.
- Web search (
--search, optional) for alternative mirrors — author pages, ResearchGate, repositories — via OpenRouter (perplexity/sonar).
Candidate URLs are deduped, paywalled-publisher hosts are dropped, and direct-PDF / arXiv /
repository URLs are tried first. Every kept PDF is title-verified (unless --no-verify).
--email you@example.com— sent to the OA APIs' polite pool (recommended).--search— needsOPENROUTER_API_KEY.--brightdata/--use-sb— fetch an already-open PDF past anti-bot/Cloudflare via BrightData Web Unlocker / Scraping Browser (needsBRIGHTDATA_WU_*/BRIGHTDATA_SB_*). No-ops without creds.
paperfetch only retrieves content that is already legally open: arXiv, OA-aggregator
locations, gold-OA publishers, open proceedings, Europe PMC, and author/repository copies. It
does not include Sci-Hub or any other paywall-bypass, and it never circumvents access
controls. The optional BrightData fallbacks exist solely to fetch a PDF a host already serves
openly when anti-bot defenses block a plain download — not to access paywalled material. Please
use a real contact email for the OA APIs and respect each source's terms of use.
Extracted from the winterchill papers pipeline. MIT-licensed.