Literature search europepmc

From mkurman/zorai · View interactive version

Literature search europepmc is an AI agent skill from the GitHub repository mkurman/zorai. Search Europe PMC for scientific literature and download open-access full texts and PDFs. Retrieve full-text XML/plain text by PMCID, get citation lists and bibliography.

How to use this skill

Skill file

Europe PMC Database

A skill for searching, downloading, and exploring open-access papers from

Europe PMC — a comprehensive, free life-science

literature database with over 43 million abstracts and 9 million full-text

articles.

Prerequisites

  1. uv: Read the uv skill and follow its Setup instructions to ensure

uv is installed and on PATH.

  1. User Notification: If LICENSE_NOTIFICATION.txt does not already exist in

this skill directory then (1) prominently notify the user to check the terms

at https://europepmc.org/ and to always check the license of the papers

retrieved by the skill for any restrictions, then (2) create the file

recording the notification text and timestamp.

Core Rules

The script automatically appends OPEN_ACCESS:y to every search query. Do

NOT remove or override this filter.

necessarily have all key dependencies. Do not attempt to pip install or

create new venvs.

API directly. The script handles rate limiting (1 req/s) and errors.

file. Read the output file separately to avoid context overflow.

output AND list the URLs of all papers that were used in producing the

output.

Utility Scripts

All commands are subcommands of scripts/europepmc_api.py. Rate limiting and

retries are handled automatically.

1. Search (`search`)

Search Europe PMC by query. Supports DOI lookup, keyword search, author search,

PMID lookup, and the full

Europe PMC search syntax.

# Look up a paper by DOI
uv run scripts/europepmc_api.py search "DOI:10.1038/s41586-021-03819-2" --output result.json

# Keyword search
uv run scripts/europepmc_api.py search "CRISPR cancer" --max_results 5 --output results.json

# Author search
uv run scripts/europepmc_api.py search "AUTH:Jumper J" --max_results 10 --output results.json

# PMID lookup
uv run scripts/europepmc_api.py search "EXT_ID:34265844 AND SRC:MED" --output result.json

# Sorted by citations
uv run scripts/europepmc_api.py search "machine learning" \
  --sort "CITED desc" --max_results 20 --output results.json

Arguments:

nextCursorMark value from a previous response to get the next page

(publication date descending), P_PDATE_D asc

Output: JSON file with three fields:

Search Syntax Quick Reference:

Note: OPEN_ACCESS:y is automatically appended to all queries. You do not

need to add it manually.

2. Download PDF (`download_pdf`)

Download an open-access PDF from Europe PMC by PMCID.

uv run scripts/europepmc_api.py download_pdf PMC8371605 --output alphafold.pdf

Arguments:

Output: Saves the PDF to the specified file. Exits with an error if the

PMCID is not found or the response is not a valid PDF. Whenever you download a

PDF, check the pdf downloaded is not empty or corrupted.

3. Get Full Text (`get_fulltext`)

Retrieve the full text of an open-access article and save to a file. Returns

plain text (XML tags stripped) by default, or raw XML with --format xml.

# Get plain text (default)
uv run scripts/europepmc_api.py get_fulltext PMC8371605 --output fulltext.txt

# Get raw XML
uv run scripts/europepmc_api.py get_fulltext PMC8371605 --format xml --output fulltext.xml

Arguments:

XML)

Output: Full text written to the specified file. Exits with an error if the

article is not in the Europe PMC open-access subset.

Important: Only articles in the PMC Open Access Subset have full text

available. If retrieval fails, use search to check the isOpenAccess field

and fall back to the abstract.

4. Get Citations (`get_citations`)

Retrieve articles that cite a given paper.

# Get citations for the AlphaFold paper (PMID 34265844)
uv run scripts/europepmc_api.py get_citations MED 34265844 \
  --page_size 25 --output citations.json

Arguments:

(preprints), PAT (patents)

Output: JSON file with hitCount and citations array.

5. Get References (`get_references`)

Retrieve the reference list (bibliography) of a given paper.

# Get references from the AlphaFold paper
uv run scripts/europepmc_api.py get_references MED 34265844 \
  --page_size 100 --output references.json

Arguments:

Output: JSON file with hitCount and references array.

Common Workflows

DOI to PDF

# Step 1: Search for the PMCID
uv run scripts/europepmc_api.py search "DOI:10.1038/s41586-021-03819-2" --output result.json
PMCID=$(jq -r '.results[0].pmcid // empty' result.json)

# Step 2: Download the PDF
uv run scripts/europepmc_api.py download_pdf "$PMCID" --output paper.pdf

PMID to Full Text

# Step 1: Find the PMCID from a PMID
uv run scripts/europepmc_api.py search "EXT_ID:34265844 AND SRC:MED" --output result.json
PMCID=$(jq -r '.results[0].pmcid // empty' result.json)

# Step 2: Get the full text
uv run scripts/europepmc_api.py get_fulltext "$PMCID" --output fulltext.txt

Citation Graph Traversal

# Find what papers cite a landmark study, then check their references
uv run scripts/europepmc_api.py get_citations MED 34265844 --page_size 50 --output citing.json
# Parse a cited paper's PMID and explore its references
uv run scripts/europepmc_api.py get_references MED <CITING_PMID> --output refs.json

Search with Pagination

# First page
uv run scripts/europepmc_api.py search "CRISPR" --max_results 100 --output page1.json
# Extract cursor for next page
CURSOR=$(jq -r '.nextCursorMark // empty' page1.json)
# Next page
uv run scripts/europepmc_api.py search "CRISPR" --max_results 100 --cursor "$CURSOR" --output page2.json
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.