Request
https://api.zapi.ink/v1/research:pubmed/searchSend 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
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| term | string | query | Yes | Entrez query. Supports field tags such as [au], [ti], [mesh] and boolean operators Example: covid-19 vaccine |
| db | enum: 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 | gtr | query | No | Entrez database. Default pubmed Example: pubmed |
| page | number | query | No | Page number. Default 1 Example: 1 |
| limit | number | query | No | UIDs per page. Default 20, max 500 Example: 20 |
| sort | enum: relevance | pubDate | author | journalName | mostRecent | query | No | Sort order. Default is the database default Example: relevance |
| field | string | query | No | Limit the whole term to one search field Example: title |
| datetype | enum: pdat | edat | mdat | query | No | Date field the range applies to Example: pdat |
| mindate | string | query | No | Range start, YYYY/MM/DD Example: 2020/01/01 |
| maxdate | string | query | No | Range end, YYYY/MM/DD Example: 2021/12/31 |
| reldate | number | query | No | Limit to the last N days instead of a range Example: 30 |
| usehistory | enum: true | false | query | No | Store the result set on the history server and return webEnv/queryKey Example: true |
Code examples
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"
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);
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
{ "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.
