Skip to main content
The OpenAlex CLI is the official command-line tool for downloading data from OpenAlex. It handles parallel downloads, checkpointing, and rate limiting so you don’t have to build that yourself.
pip install openalex-official
Work in progress. The CLI currently focuses on work metadata and content downloads. More features (CSV export, other entity types) are coming. Follow development on GitHub.

Quick examples

Download metadata for works on a topic:
openalex download \
  --api-key YOUR_KEY \
  --output ./frogs \
  --filter "topics.id:T10325"
Download metadata + PDFs:
openalex download \
  --api-key YOUR_KEY \
  --output ./frogs \
  --filter "topics.id:T10325" \
  --content pdf
Download metadata + PDFs + TEI XML:
openalex download \
  --api-key YOUR_KEY \
  --output ./frogs \
  --filter "topics.id:T10325" \
  --content pdf,xml
Download by DOI:
openalex download \
  --api-key YOUR_KEY \
  --output ./my-papers \
  --ids "10.1038/nature12373,10.1126/science.1234567"
Pipe in a list of work IDs:
cat work_ids.txt | openalex download \
  --api-key YOUR_KEY \
  --output ./corpus \
  --stdin

Output format

Metadata is saved as JSON files alongside any content you requested:
output/
├── W2741809807.json     # metadata (always saved)
├── W2741809807.pdf      # content (if --content pdf)
├── W2741809807.tei.xml  # content (if --content xml)
└── W1234567890.json

Why use the CLI?

Building a robust bulk downloader is harder than it looks. The CLI handles:
  • Metadata by default — Every work gets a complete JSON file
  • Parallel downloads — Up to 200 concurrent connections
  • Automatic checkpointing — Resume interrupted downloads without re-downloading
  • Adaptive rate limiting — Adjusts to API conditions automatically
  • DOI resolution — Auto-detects DOIs and converts them to OpenAlex IDs
  • Progress tracking — Real-time stats in your terminal
At full speed, you can download thousands of works per hour.

Pricing

Download typeCost
MetadataFree
PDFs$0.01 each
TEI XML$0.01 each
With a free API key ($1/day), you can download unlimited metadata and about 100 content files per day. Need more content? Contact us about enterprise pricing for large-scale projects.

Full documentation

For all options and advanced usage:
openalex download --help
See the GitHub README for complete documentation.