ncbi.nlm.nih.gov APIncbi.nlm.nih.gov ↗
Search PubMed, retrieve full PMC article text, and look up MeSH terms via a structured API. Covers metadata, abstracts, affiliations, and clinical filters.
curl -X GET 'https://api.parse.bot/scraper/d740e466-9fe1-49a2-94c8-9b7c1e0c30ea/pubmed_search?query=diabetes&retmax=5' \ -H 'X-API-Key: $PARSE_API_KEY'
Search PubMed for articles with various filters. Returns paginated results with article summaries including title, authors, journal, and identifiers.
| Param | Type | Description |
|---|---|---|
| sort | string | Sort order. Accepted values: Best match, Most recent. |
| queryrequired | string | Search query string. |
| retmax | integer | Maximum number of results to return. |
| retstart | integer | Result offset for pagination. |
| date_range | string | Publication date range filter. Accepted values: 1 year, 5 years, 10 years. |
| article_type | string | Article type filter (e.g. Review, Clinical Trial). |
| text_availability | string | Text availability filter. Accepted values: abstract, free full text, full text. |
{
"type": "object",
"fields": {
"items": "array of article summary objects with pmid, title, authors, journal, pub_date, doi, pmcid, is_free",
"total": "integer total count of matching articles"
},
"sample": {
"data": {
"items": [
{
"doi": "10.1016/j.ecl.2020.05.012",
"pmid": "32741486",
"pmcid": "",
"title": "Diabetes Insipidus: An Update.",
"authors": [
"Refardt J",
"Winzeler B",
"Christ-Crain M"
],
"is_free": false,
"journal": "Endocrinol Metab Clin North Am",
"pub_date": "2020 Sep"
}
],
"total": 1115964
},
"status": "success"
}
}About the ncbi.nlm.nih.gov API
This API gives programmatic access to three NCBI databases — PubMed, PubMed Central, and MeSH — across 5 endpoints. Use pubmed_search to query millions of biomedical articles with filters for article type, date range, and text availability, then call pubmed_get_article to pull full bibliographic metadata including author affiliations, MeSH terms, and structured abstracts for any PMID.
PubMed Search and Article Metadata
The pubmed_search endpoint accepts a query string and optional filters: article_type (e.g. "Review", "Clinical Trial"), date_range (1, 5, or 10 years), text_availability (abstract, free full text, full text), and sort order. It returns a total count and a paginated items array. Each item includes pmid, title, authors, journal, pub_date, doi, pmcid, and an is_free flag. Use retstart and retmax together to walk through large result sets.
Full Article Detail
pubmed_get_article takes a single pmid and returns a complete bibliographic record: abstract (full text), keywords, mesh_terms (array of MeSH heading strings), and authors as an array of objects each containing name and affiliations. The companion pmc_get_article endpoint accepts a pmcid and returns the article's full_text (truncated at 20,000 characters) plus conditionally populated structured fields — findings, outcomes, population, limitations — extracted when the article contains clearly labeled sections. Not every PMC article will populate all structured fields.
MeSH Vocabulary Lookup
mesh_search queries the Medical Subject Headings controlled vocabulary and returns matching term objects with id, mesh_ui (D-number), term, synonyms, and definition. Once you have a numeric id, pass it to mesh_get_term for the full record including tree_numbers, which encode where the term sits in the MeSH hierarchy. These endpoints are useful for normalizing terminology across a literature corpus or building query expansions.
- Aggregate clinical trial records on a specific drug by filtering
pubmed_searchwitharticle_type: Clinical Trial - Build a citation database by resolving PMIDs to full bibliographic metadata including
doi,journal, andmesh_terms - Extract structured findings and limitations from systematic reviews using
pmc_get_article - Expand search queries with controlled vocabulary synonyms retrieved via
mesh_search - Track author affiliations and institutional output by parsing the
affiliationsfield frompubmed_get_article - Filter literature to open-access papers using
text_availability: free full textinpubmed_search - Map a term's position in the medical taxonomy using
tree_numbersfrommesh_get_term
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does NCBI have an official developer API?+
What does `pmc_get_article` return for articles that lack clearly labeled sections?+
findings, outcomes, population, and limitations — are populated only when the article contains recognizably labeled sections. For articles without that structure, those fields return empty strings. The full_text field (up to 20,000 characters) and title, authors, study_type, and source_url are returned regardless.Can I retrieve reference lists or citation counts for a PubMed article?+
How does pagination work in `pubmed_search`?+
retstart as the zero-based offset and retmax to control page size. The response always includes a total field showing the full count of matching articles, so you can calculate how many pages exist before fetching them.