National Library of Medicine Search API

Search Entrez databases for matching records.

OpenAPI Specification

national-library-of-medicine-search-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: NCBI E-utilities Discovery Search API
  description: The Entrez Programming Utilities (E-utilities) are a public API to the NCBI Entrez system, providing access to all Entrez databases including PubMed, PMC, Gene, Nuccore, and Protein. The E-utilities are a suite of nine server-side programs that accept a fixed URL syntax for search, link, and retrieval operations. Maintained by the National Center for Biotechnology Information (NCBI), part of the U.S. National Library of Medicine.
  version: '1.0'
  contact:
    name: NCBI Information Engineering Branch
    url: https://www.ncbi.nlm.nih.gov/home/about/contact/
    email: eutilities@ncbi.nlm.nih.gov
  license:
    name: NCBI Public Domain
    url: https://www.ncbi.nlm.nih.gov/home/about/policies/
servers:
- url: https://eutils.ncbi.nlm.nih.gov/entrez/eutils
  description: NCBI E-utilities production server
tags:
- name: Search
  description: Search Entrez databases for matching records.
paths:
  /esearch.fcgi:
    get:
      tags:
      - Search
      summary: Search a database
      description: Returns a list of UIDs matching a text query, optionally posting the results to the Entrez History server for downstream operations.
      operationId: eSearch
      parameters:
      - name: db
        in: query
        required: true
        description: Database to search (e.g. pubmed, pmc, gene, protein, nuccore).
        schema:
          type: string
          default: pubmed
      - name: term
        in: query
        required: true
        description: Entrez text query, URL-encoded.
        schema:
          type: string
      - name: usehistory
        in: query
        description: Set to 'y' to post UIDs to the History server.
        schema:
          type: string
          enum:
          - y
          - n
      - name: retmax
        in: query
        description: Maximum number of UIDs to return (default 20, max 10000).
        schema:
          type: integer
      - name: retstart
        in: query
        description: Sequential index of the first UID to return (zero-based).
        schema:
          type: integer
      - name: retmode
        in: query
        description: Output format.
        schema:
          type: string
          enum:
          - xml
          - json
      - name: api_key
        in: query
        description: NCBI API key for higher rate limits.
        schema:
          type: string
      responses:
        '200':
          description: Successful search response with UID list.
  /egquery.fcgi:
    get:
      tags:
      - Search
      summary: Global cross-database query
      description: Returns the number of records in every Entrez database matching a single text query.
      operationId: eGQuery
      parameters:
      - name: term
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Per-database hit counts.