Sources › Research › PubMed › Search

PubMed Search API

esearch: term -> UID list. The 10,000-record window is upstream's, not ours; past it the history server (usehistory + epost) is the only way through.

PubMedGET /searchAll plans1 Zap

Request

GET
https://api.zapi.ink/v1/research:pubmed/search

Send your key in the x-api-key header. The response is JSON in the { project, data, timestamp } envelope, and an identical request is served from cache for 5 minutes.

Parameters

NameTypeInRequiredDescription
termstringqueryYesEntrez query. Supports field tags such as [au], [ti], [mesh] and boolean operators Example: covid-19 vaccine
dbenum: pubmed | protein | nuccore | ipg | nucleotide | structure | genome | grasp | annotinfo | assembly | bioproject | biosample | blastdbinfo | books | cdd | clinvar | dbvar | gene | gds | geoprofiles | medgen | mesh | nlmcatalog | omim | orgtrack | pmc | proteinclusters | pcassay | protfam | pccompound | pcsubstance | seqannot | snp | sra | taxonomy | biocollections | gtrqueryNoEntrez database. Default pubmed Example: pubmed
pagenumberqueryNoPage number. Default 1 Example: 1
limitnumberqueryNoUIDs per page. Default 20, max 500 Example: 20
sortenum: relevance | pubDate | author | journalName | mostRecentqueryNoSort order. Default is the database default Example: relevance
fieldstringqueryNoLimit the whole term to one search field Example: title
datetypeenum: pdat | edat | mdatqueryNoDate field the range applies to Example: pdat
mindatestringqueryNoRange start, YYYY/MM/DD Example: 2020/01/01
maxdatestringqueryNoRange end, YYYY/MM/DD Example: 2021/12/31
reldatenumberqueryNoLimit to the last N days instead of a range Example: 30
usehistoryenum: true | falsequeryNoStore the result set on the history server and return webEnv/queryKey Example: true

Code examples

cURL
curl -X GET "https://api.zapi.ink/v1/research:pubmed/search?term=covid-19+vaccine&db=pubmed&page=1&limit=20&sort=relevance&field=title&datetype=pdat&mindate=2020%2F01%2F01&maxdate=2021%2F12%2F31&reldate=30&usehistory=true" \
  -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
JavaScript
const res = await fetch("https://api.zapi.ink/v1/research:pubmed/search?term=covid-19+vaccine&db=pubmed&page=1&limit=20&sort=relevance&field=title&datetype=pdat&mindate=2020%2F01%2F01&maxdate=2021%2F12%2F31&reldate=30&usehistory=true", {
  method: "GET",
  headers: {
    "x-api-key": "zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
  },
});
const data = await res.json();
console.log(data);
Python
import requests

res = requests.get(
    "https://api.zapi.ink/v1/research:pubmed/search",
    params={"term":"covid-19 vaccine","db":"pubmed","page":"1","limit":"20","sort":"relevance","field":"title","datetype":"pdat","mindate":"2020/01/01","maxdate":"2021/12/31","reldate":"30","usehistory":"true"},
    headers={"x-api-key":"zpi_xxxxxxxxxxxxxxxxxxxxxxxx"},
)
print(res.json())

Example response

200 OK · application/json
{
  "project": "research:pubmed",
  "data": {
    "db": "pubmed",
    "page": 1,
    "term": "covid-19 vaccine",
    "count": 0,
    "items": [],
    "limit": 3,
    "total": 0,
    "webEnv": "MCID_6a937c9f6cbc51515203019e",
    "hasMore": false,
    "nextPage": null,
    "provider": "pubmed",
    "queryKey": "1",
    "warnings": [
      "No items found."
    ],
    "translations": [],
    "queryTranslation": "\"covid-19\"[Title] AND \"vaccine\"[Title] AND 2020/01/01:2021/12/31[Date - Publication] AND 2026/07/30:2026/08/29[Date - Publication]"
  },
  "timestamp": "2026-08-30T00:49:24Z"
}

Frequently asked questions

How do I call the PubMed Search API?

Send a GET request to https://api.zapi.ink/v1/research:pubmed/search?term=covid-19+vaccine with your Zapi key in the x-api-key header. Parameters — required: term; optional: db, page, limit, sort, field, datetype, mindate, maxdate, reldate, usehistory. The response is JSON in the { project, data, timestamp } envelope.

What does the PubMed Search API return?

esearch: term -> UID list. The example response has the fields db, page, term, count, items, limit, total, webEnv.

Is the PubMed Search API free?

Yes. It is on the Zapi free tier: 600 Zap a month with one API key and no credit card. Each call costs 1 Zap. Paid plans raise the limits.

Can an AI assistant call the PubMed Search API?

Yes. Add the Zapi MCP server (https://mcp.zapi.ink/mcp) to Claude, Cursor or another MCP client and ask in plain words; it calls run_scraper with scraper "pubmed" and endpoint "search".

What other PubMed API endpoints are there?

It has 4 endpoints. Besides Search: Abstract, Databases, Summary.