skills/43-wentorai-research-plugins/skills/literature/fulltext/pmc-oai-api/SKILL.md
PubMed Central OAI-PMH metadata harvesting
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research pmc-oai-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PubMed Central (PMC) is a free full-text archive of biomedical and life sciences journal literature at the U.S. National Institutes of Health's National Library of Medicine (NIH/NLM). The PMC OAI-PMH (Open Archives Initiative Protocol for Metadata Harvesting) service provides a standardized interface for systematically harvesting metadata and full-text content from the PMC archive.
The OAI-PMH protocol is an internationally recognized standard for metadata harvesting, widely used by libraries, repositories, and research infrastructure. The PMC implementation allows researchers to programmatically discover and retrieve article metadata, including titles, authors, abstracts, MeSH terms, publication dates, and links to full-text XML and PDF versions. This is particularly valuable for building local search indexes, systematic review pipelines, and text mining corpora.
Biomedical researchers, systematic reviewers, bioinformaticians, medical librarians, and text mining specialists use the PMC OAI-PMH service to harvest large collections of open-access biomedical literature for meta-analyses, natural language processing research, knowledge graph construction, and institutional repository enrichment. PMC contains over 9 million full-text articles, making it one of the largest open-access biomedical literature collections in the world.
No authentication required. The PMC OAI-PMH service is freely accessible without any API key, token, or registration. All requests are made via standard HTTP GET requests. However, users must comply with NCBI usage guidelines and respect the rate limits to ensure fair access for all users.
Retrieve metadata records from PMC in bulk, with optional filtering by date range and metadata set. This is the primary endpoint for systematic metadata harvesting.
GET https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/| Parameter | Type | Required | Description |
|-----------------|--------|----------|---------------------------------------------------------|
| verb | string | Yes | Must be ListRecords |
| metadataPrefix | string | Yes | Metadata format: oai_dc, pmc, or pmc_fm |
| set | string | No | Filter by set (e.g., journal, open access subset) |
| from | string | No | Start date for selective harvesting (YYYY-MM-DD) |
| until | string | No | End date for selective harvesting (YYYY-MM-DD) |
| resumptionToken | string | No | Token for paginating through large result sets |
# Harvest recent open-access records in Dublin Core format
curl "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/?verb=ListRecords&metadataPrefix=oai_dc&from=2024-06-01&until=2024-06-07"
# Harvest PMC full metadata format
curl "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/?verb=ListRecords&metadataPrefix=pmc_fm&from=2024-06-01&until=2024-06-02"
<record> elements, each with <header> (identifier, datestamp, setSpec) and <metadata> (article title, creators, subjects, description, date, identifiers, rights). Includes a <resumptionToken> for fetching subsequent pages.Fetch the complete metadata record for a specific PMC article by its OAI identifier.
GET https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/| Parameter | Type | Required | Description |
|-----------------|--------|----------|----------------------------------------------------|
| verb | string | Yes | Must be GetRecord |
| identifier | string | Yes | OAI identifier (e.g., oai:pubmedcentral.nih.gov:1234567) |
| metadataPrefix | string | Yes | Metadata format: oai_dc, pmc, or pmc_fm |
curl "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/?verb=GetRecord&identifier=oai:pubmedcentral.nih.gov:7096803&metadataPrefix=oai_dc"
<record> element with full metadata in the requested format, including article title, all authors, abstract, journal information, publication date, DOI, PMID, and subject classifications.Retrieve the list of available sets (collections) that can be used to filter records during harvesting. Sets typically correspond to journals, open-access subsets, or subject categories.
GET https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/| Parameter | Type | Required | Description |
|-----------|--------|----------|----------------------|
| verb | string | Yes | Must be ListSets |
curl "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/?verb=ListSets"
<set> elements containing <setSpec> (machine-readable identifier) and <setName> (human-readable name) for each available collection.The PMC OAI-PMH service enforces a rate limit of 3 requests per second. Exceeding this limit may result in temporary IP blocking. NCBI requires users to make no more than 3 requests per second across all NCBI E-utilities and OAI services combined. For bulk harvesting, implement appropriate delays between requests and use the resumptionToken for pagination rather than making parallel requests.
NCBI also requests that users identify themselves by including an email address in the HTTP request headers or by registering for an NCBI API key (which allows up to 10 requests per second).
Harvest new records added since your last sync using date-based selective harvesting:
import requests
import xml.etree.ElementTree as ET
import time
base_url = "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/"
params = {
"verb": "ListRecords",
"metadataPrefix": "oai_dc",
"from": "2024-06-01",
"until": "2024-06-07"
}
all_records = []
while True:
resp = requests.get(base_url, params=params)
root = ET.fromstring(resp.text)
ns = {"oai": "http://www.openarchives.org/OAI/2.0/"}
records = root.findall(".//oai:record", ns)
all_records.extend(records)
token_elem = root.find(".//oai:resumptionToken", ns)
if token_elem is not None and token_elem.text:
params = {"verb": "ListRecords", "resumptionToken": token_elem.text}
time.sleep(0.5) # Respect rate limits
else:
break
print(f"Harvested {len(all_records)} records")
Extract structured metadata from harvested records for indexing:
import requests
import xml.etree.ElementTree as ET
url = "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/"
params = {
"verb": "GetRecord",
"identifier": "oai:pubmedcentral.nih.gov:7096803",
"metadataPrefix": "oai_dc"
}
resp = requests.get(url, params=params)
root = ET.fromstring(resp.text)
dc_ns = "http://purl.org/dc/elements/1.1/"
oai_ns = "http://www.openarchives.org/OAI/2.0/"
metadata = root.find(f".//{{{oai_ns}}}metadata")
if metadata is not None:
title = metadata.find(f".//{{{dc_ns}}}title")
creators = metadata.findall(f".//{{{dc_ns}}}creator")
print(f"Title: {title.text if title is not None else 'N/A'}")
print(f"Authors: {', '.join(c.text for c in creators)}")
List all available journal sets to target specific journal harvesting:
curl "https://pmc.ncbi.nlm.nih.gov/api/oai/v1/mh/?verb=ListSets" | head -100
development
Conduct rigorous thematic analysis (TA) of qualitative data following Braun and Clarke's (2006) six-phase framework. Use whenever the user mentions 'thematic analysis', 'TA', 'Braun and Clarke', 'qualitative coding', 'identifying themes', or asks for help analysing interviews, focus groups, open-ended survey responses, or transcripts to identify patterns. Also trigger for questions about inductive vs theoretical coding, semantic vs latent themes, essentialist vs constructionist epistemology, building a thematic map, or writing up a qualitative findings section. Covers all six phases, the four upfront analytic decisions, the 15-point quality checklist, and the five common pitfalls. Produces a Word document write-up and an annotated thematic map. Does NOT cover IPA, grounded theory, discourse analysis, conversation analysis, or narrative analysis — use a different method for those.
development
Guide users through writing a systematic literature review (SLR) following the PRISMA 2020 framework. Use this skill whenever the user mentions 'systematic review', 'systematic literature review', 'SLR', 'PRISMA', 'PRISMA 2020', 'PRISMA flow diagram', 'PRISMA checklist', or asks for help writing, structuring, or auditing a literature review that follows reporting guidelines. Also trigger when the user asks about inclusion/exclusion criteria for a review, search strategies for databases like Scopus/WoS/PubMed, study selection processes, risk of bias assessment, or narrative synthesis for a review paper. This skill covers the full PRISMA 2020 checklist (27 items), produces a Word document manuscript in strict journal article format, generates an annotated PRISMA flow diagram, and enforces APA 7th Edition referencing throughout. It does NOT cover meta-analysis or statistical pooling. By Chuah Kee Man.
testing
Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance. Use when checking model robustness, verifying lack of pre-intervention effects, or estimating study power.
data-ai
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.