Discover/Nih API
live

Nih APIncbi.nlm.nih.gov

Search PubMed, retrieve full PMC article text, and look up MeSH terms via 5 structured endpoints. Get metadata, abstracts, MeSH headings, and more.

Endpoint health
verified 6d ago
pubmed_search
pubmed_get_article
mesh_search
pmc_get_article
mesh_get_term
5/5 passing latest checkself-healing
Endpoints
5
Updated
21d ago

What is the Nih API?

This API provides access to biomedical literature across three NCBI databases through 5 endpoints covering PubMed search, full article metadata, PMC full-text retrieval, and MeSH vocabulary lookup. The pubmed_search endpoint accepts free-text queries with filters for date range, article type (Clinical Trial, Meta-Analysis, Review), and text availability, returning paginated summaries with PMIDs, DOIs, and PMCIDs. The pmc_get_article endpoint extracts labeled sections including methods, results, and limitations.

Try it
Sort order for results.
Search query string for PubMed.
Maximum number of results to return per request.
Result offset for pagination (0-based).
Filter by publication date range.
Article type filter (e.g. Review, Clinical Trial, Meta-Analysis, Randomized Controlled Trial).
Filter by text availability.
api.parse.bot/scraper/d740e466-9fe1-49a2-94c8-9b7c1e0c30ea/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/d740e466-9fe1-49a2-94c8-9b7c1e0c30ea/pubmed_search?sort=Best+match&query=diabetes+insipidus&retmax=5&retstart=0&date_range=1+year&article_type=Review&text_availability=abstract' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace ncbi-nlm-nih-gov-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: NCBI PubMed & PMC SDK — search articles, fetch details, explore MeSH."""
from parse_apis.ncbi_pubmed_pmc_api import Pubmed, Sort, DateRange, TextAvailability, ResourceNotFound

client = Pubmed()

# Search PubMed for recent review articles on a topic, bounded.
for article in client.articlesummaries.search(
    query="CRISPR gene therapy",
    sort=Sort.MOST_RECENT,
    date_range=DateRange.FIVE_YEARS,
    text_availability=TextAvailability.FREE_FULL_TEXT,
    retmax=5,
    limit=5,
):
    print(article.title, article.pmid, article.is_free)

# Drill into the first result for full metadata.
summary = client.articlesummaries.search(query="diabetes insipidus", limit=1).first()
if summary:
    detail = summary.details()
    print(detail.title, detail.abstract[:120])
    for author in detail.authors[:3]:
        print(author.name, author.affiliations)

# Fetch a PMC full-text article directly by PMCID.
pmc = client.pmcarticles.get(pmcid="PMC7096075")
print(pmc.title, pmc.study_type, pmc.published_date)
print(pmc.patient_friendly_summary[:200])

# Search MeSH terms and drill into tree classification.
mesh_hit = client.meshtermsummaries.search(query="diabetes", limit=1).first()
if mesh_hit:
    full_term = mesh_hit.details()
    print(full_term.term, full_term.mesh_ui, full_term.tree_numbers)

# Typed error handling for a bad PMID.
try:
    client.articles.get(pmid="99999999999")
except ResourceNotFound as exc:
    print(f"Not found: {exc}")

print("exercised: articlesummaries.search / details / articles.get / pmcarticles.get / meshtermsummaries.search / details")
All endpoints · 5 totalmissing one? ·

Full-text search across all PubMed articles. Supports filters for date range, article type, and text availability. Returns paginated article summaries (title, authors, journal, identifiers). Pagination is offset-based via retstart/retmax. Each result carries a PMID usable with pubmed_get_article for full metadata.

Input
ParamTypeDescription
sortstringSort order for results.
queryrequiredstringSearch query string for PubMed.
retmaxintegerMaximum number of results to return per request.
retstartintegerResult offset for pagination (0-based).
date_rangestringFilter by publication date range.
article_typestringArticle type filter (e.g. Review, Clinical Trial, Meta-Analysis, Randomized Controlled Trial).
text_availabilitystringFilter by text availability.
Response
{
  "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": 12840
    },
    "status": "success"
  }
}

About the Nih API

PubMed Search and Article Metadata

The pubmed_search endpoint accepts a query string and optional filters: date_range, article_type (e.g. Randomized Controlled Trial, Meta-Analysis), text_availability, and sort. Pagination is offset-based via retstart and retmax. Results are arrays of summary objects containing pmid, title, authors, journal, pub_date, doi, pmcid, and is_free. The total field gives the full result count for building pagination UIs.

To retrieve complete bibliographic data for a single article, use pubmed_get_article with a pmid. The response includes the full abstract, an authors array where each entry carries both name and affiliations, structured journal info (volume, issue, pub_date), mesh_terms, and keywords. This is the correct endpoint when you need MeSH headings or author institution data that the search summary does not include.

PMC Full-Text Retrieval

The pmc_get_article endpoint accepts a pmcid (with or without the PMC prefix) and returns structured section text: population, findings, outcomes, and limitations fields are extracted when present in the article. The full_text field contains the complete article text truncated at 20,000 characters. For publisher-restricted articles, full_text falls back to the abstract. A source_url and study_type field are also returned.

MeSH Vocabulary Lookup

The mesh_search endpoint queries the Medical Subject Headings vocabulary and returns matching descriptors with mesh_ui (D-number), term, definition, and synonyms. The numeric id from those results can be passed to mesh_get_term to retrieve tree_numbers — the hierarchical classification codes that indicate where a concept sits within the MeSH taxonomy — along with the full scope note and all entry terms.

Reliability & maintenanceVerified

The Nih API is a managed, monitored endpoint for ncbi.nlm.nih.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when ncbi.nlm.nih.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official ncbi.nlm.nih.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6d ago
Latest check
5/5 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a systematic review tool that filters PubMed for Randomized Controlled Trials using article_type and extracts structured sections via pmc_get_article
  • Map disease terminology hierarchies by resolving MeSH tree_numbers with mesh_get_term for a given condition
  • Aggregate author affiliations across a research topic by fetching pmid lists from pubmed_search and resolving each with pubmed_get_article
  • Identify free full-text articles on a topic using the is_free flag in pubmed_search results, then retrieve their full_text from pmc_get_article
  • Extract limitations sections from clinical studies at scale using the limitations field returned by pmc_get_article
  • Link publications to standardized vocabulary by cross-referencing mesh_terms in pubmed_get_article responses with MeSH definitions from mesh_get_term
  • Track publication volume over time for a research area by querying pubmed_search with date_range and reading the total count
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does NCBI have an official developer API?+
Yes. NCBI provides the Entrez Programming Utilities (E-utilities) at https://www.ncbi.nlm.nih.gov/home/develop/api/. It covers PubMed, PMC, and other NCBI databases with documented endpoints for search, fetch, and link operations.
What does pmc_get_article return for restricted articles?+
For articles where the publisher has not deposited full text in PubMed Central, the full_text field falls back to the abstract rather than returning an error. The findings, outcomes, population, and limitations fields will be empty in that case. The pmcid and source_url are still returned.
How does pagination work in pubmed_search?+
Pagination is offset-based. Use retstart to set the zero-based starting position and retmax to control how many records are returned in a single response. The total field in the response gives the complete match count, which lets you calculate the number of pages needed to walk through all results.
Does the API return citation counts or impact factor data?+
Not currently. The API returns bibliographic metadata, abstract text, MeSH headings, and full article sections, but citation counts, h-index, and journal impact factor are not included in any response field. You can fork this API on Parse and revise it to add an endpoint pulling from a citation database.
Can I retrieve clinical trial registration numbers or supplementary data links?+
Those fields are not currently exposed. The pubmed_get_article endpoint returns doi, pmid, pmcid, authors, abstract, mesh_terms, and keywords. You can fork this API on Parse and revise it to surface additional structured fields such as trial registry identifiers from the article XML.
Page content last updated . Spec covers 5 endpoints from ncbi.nlm.nih.gov.
Related APIs in HealthcareSee all →
pubmed.ncbi.nlm.nih.gov API
Search and retrieve biomedical literature from PubMed and NCBI databases. Supports keyword search, advanced field-tag queries, clinical filters, citation matching, date filtering, publication type filtering, and direct E-utilities access.
pmc.ncbi.nlm.nih.gov API
Search millions of full-text biomedical research articles and access their metadata, citations, and related papers from PubMed Central. Find articles by topic, discover similar research, explore journal collections, and retrieve detailed citation information to support your literature review and research.
mdpi.com API
Access MDPI's open-access academic content programmatically. Search across thousands of peer-reviewed articles, retrieve full structured text, extract key findings, and browse journal metadata including impact factors and CiteScores.
clinicaltrials.gov API
Search and retrieve comprehensive information about clinical trials worldwide, including study details, eligibility criteria, locations, and outcomes data. Access structured metadata and statistics to find relevant research studies matching your specific medical conditions or research interests.
springer.com API
Search and retrieve metadata for millions of articles, books, and journals from Springer Nature's research library using DOI or ISBN lookups, with powerful filtering and pagination options. Get detailed information about academic publications including journal details, article metadata, and book information to power your research tools and discovery applications.
blast.ncbi.nlm.nih.gov API
Compare DNA and protein sequences against NCBI's massive biological databases to find matching sequences and analyze genetic similarities. Submit alignment jobs, monitor their progress, and retrieve detailed results in structured format to support genomics research and sequence analysis.
npidb.org API
Search for healthcare providers and organizations by name to instantly retrieve their credentials, contact information, and specialty taxonomy codes from the National Provider Identifier database. Look up detailed provider profiles to verify qualifications and find the right medical professionals for your needs.
examine.com API
Search and explore evidence-based information about supplements, health conditions, and outcomes with detailed supplement profiles, study summaries, and categorized health data. Get comprehensive overviews of how specific supplements affect various health conditions backed by scientific research.