Skill Tracer
Skills › Scientific Agent Skills › paper-lookup › pubtator.md

pubtator.md

155 lines · skills/paper-lookup/references/pubtator.md at 5f2bc03

Open on GitHub
1# PubTator3
2
3NCBI text-mined annotations on PubMed abstracts (and some PMC full text): genes,
4diseases, chemicals, species, variants, and cell lines, plus typed relations.
5Use it when the user wants *entities in a paper* or papers that mention a
6normalized entity (`@CHEMICAL_remdesivir`), not when they want a citation list.
7
8Europe PMC has a separate Annotations API. PubMed search
9does not normalize "remdesivir" to a concept ID. PubTator3 APIs are **not** the
10old PubTator / `CBBresearch` endpoints.
12All figures below verified 2026-09-10.

PubTator3

NCBI text-mined annotations on PubMed abstracts (and some PMC full text): genes, diseases, chemicals, species, variants, and cell lines, plus typed relations. Use it when the user wants entities in a paper or papers that mention a normalized entity (@CHEMICAL_remdesivir), not when they want a citation list.

Europe PMC has a separate Annotations API. PubMed search does not normalize "remdesivir" to a concept ID. PubTator3 APIs are not the old PubTator / CBBresearch endpoints.

All figures below verified 2026-09-10.

Raw lines 1 to 13
14## Base URL
16```
17https://www.ncbi.nlm.nih.gov/research/pubtator3-api
18```
20Docs: https://www.ncbi.nlm.nih.gov/research/pubtator3/api

Base URL

https://www.ncbi.nlm.nih.gov/research/pubtator3-api

Docs: https://www.ncbi.nlm.nih.gov/research/pubtator3/api

Raw lines 14 to 21
22## Authentication
24None.

Authentication

None.

Raw lines 22 to 25
26## Rate Limits
28No more than **3 requests per second**. Serialize. For bulk annotation dumps use
29the FTP site (`https://ftp.ncbi.nlm.nih.gov/pub/lu/PubTator3/`) rather than the
30API.

Rate Limits

No more than 3 requests per second. Serialize. For bulk annotation dumps use the FTP site (https://ftp.ncbi.nlm.nih.gov/pub/lu/PubTator3/) rather than the API.

Raw lines 26 to 31
32## Key Endpoints

Key Endpoints

Raw lines 32 to 33
34### 1. Resolve a mention to an entity ID
36```
37GET /entity/autocomplete/?query={text}&concept={type}&limit={n}
38```
40`concept` is optional (`chemical`, `disease`, `gene`, `species`, `variant`,
41`cellline`).
43```
44GET /entity/autocomplete/?query=remdesivir&limit=3
45```
47Returns a JSON array. First hit (verified):
49```json
51 "_id": "@CHEMICAL_remdesivir",
52 "biotype": "chemical",
53 "db_id": "C000606551",
54 "db": "ncbi_mesh",
55 "name": "remdesivir"
57```
59Search with `_id` (`@CHEMICAL_remdesivir`), not the display name. Nearby
60synonyms (`@CHEMICAL_GS_441524_triphosphate`) are different entities.

1. Resolve a mention to an entity ID

GET /entity/autocomplete/?query={text}&concept={type}&limit={n}

concept is optional (chemical, disease, gene, species, variant, cellline).

GET /entity/autocomplete/?query=remdesivir&limit=3

Returns a JSON array. First hit (verified):

{
  "_id": "@CHEMICAL_remdesivir",
  "biotype": "chemical",
  "db_id": "C000606551",
  "db": "ncbi_mesh",
  "name": "remdesivir"
}

Search with _id (@CHEMICAL_remdesivir), not the display name. Nearby synonyms (@CHEMICAL_GS_441524_triphosphate) are different entities.

Raw lines 34 to 61
62### 2. Search papers by text, entity, or relation
64```
65GET /search/?text={query}&page={n}
66```
68`text` may be free text, an `@TYPE_name` entity ID, a boolean combination, or a
69relation:
71```
72@CHEMICAL_Doxorubicin AND @DISEASE_Neoplasms
73relations:ANY|@CHEMICAL_Doxorubicin|@DISEASE_Neoplasms
74relations:ANY|@CHEMICAL_Doxorubicin|DISEASE
75```
77```
78GET /search/?text=@CHEMICAL_remdesivir
79```
81Verified: `count` 23295, `page_size` 10, `current` 1, `total_pages` 2330,
82`results` length 10. First result `pmid` is an **integer** (`37711410`); `_id`
83is a string. Page with `page` (1-based). There is no cursor.
85Do not use this as a general PubMed replacement. Rank is entity-centric.

2. Search papers by text, entity, or relation

GET /search/?text={query}&page={n}

text may be free text, an @TYPE_name entity ID, a boolean combination, or a relation:

@CHEMICAL_Doxorubicin AND @DISEASE_Neoplasms
relations:ANY|@CHEMICAL_Doxorubicin|@DISEASE_Neoplasms
relations:ANY|@CHEMICAL_Doxorubicin|DISEASE
GET /search/?text=@CHEMICAL_remdesivir

Verified: count 23295, page_size 10, current 1, total_pages 2330, results length 10. First result pmid is an integer (37711410); _id is a string. Page with page (1-based). There is no cursor.

Do not use this as a general PubMed replacement. Rank is entity-centric.

Raw lines 62 to 86
87### 3. Export annotations for PMIDs
89```
90GET /publications/export/{format}?pmids={id,id}&full={true|false}
91```
93`format` is `pubtator`, `biocxml`, or `biocjson`. `full=true` (PMC full text)
94works only for `biocxml` / `biocjson`.
96```
97GET /publications/export/biocjson?pmids=29355051
98```
100The JSON is **not** a bare BioC document. It is:
102```json
103{ "PubTator3": [ { "_id": "29355051|None", "id": "29355051", "passages": [...], "relations": [...] } ] }
104```
106Verified on PMID 29355051: one document, two passages, first passage has 5
107annotations. An annotation looks like:
109```json
111 "infons": {
112 "type": "Species",
113 "database": "ncbi_taxonomy",
114 "normalized_id": 112863,
115 "biotype": "species"
116 },
117 "text": "Lycium barbarum",
118 "locations": [{"offset": 14, "length": 15}]
120```
122Read `PubTator3[0].passages[].annotations`. A 200 with `"PubTator3": []` is
123"no documents," not a transport success you can ignore.

3. Export annotations for PMIDs

GET /publications/export/{format}?pmids={id,id}&full={true|false}

format is pubtator, biocxml, or biocjson. full=true (PMC full text) works only for biocxml / biocjson.

GET /publications/export/biocjson?pmids=29355051

The JSON is not a bare BioC document. It is:

{ "PubTator3": [ { "_id": "29355051|None", "id": "29355051", "passages": [...], "relations": [...] } ] }

Verified on PMID 29355051: one document, two passages, first passage has 5 annotations. An annotation looks like:

{
  "infons": {
    "type": "Species",
    "database": "ncbi_taxonomy",
    "normalized_id": 112863,
    "biotype": "species"
  },
  "text": "Lycium barbarum",
  "locations": [{"offset": 14, "length": 15}]
}

Read PubTator3[0].passages[].annotations. A 200 with "PubTator3": [] is "no documents," not a transport success you can ignore.

Raw lines 87 to 124
125### 4. Related entities
127```
128GET /relations?e1={entityId}&type={relation}&e2={entity_type}
129```
131Relation types include `treat`, `cause`, `interact`, `associate`,
132`positive_correlate`, `negative_correlate`, `prevent`, `inhibit`, `stimulate`,
133`drug_interact`, `cotreat`, `convert`, and `compare`. `e1` must be an autocomplete `_id`; `type` and `e2` are optional. Related entity types include gene, disease, chemical, and variant.

4. Related entities

GET /relations?e1={entityId}&type={relation}&e2={entity_type}

Relation types include treat, cause, interact, associate, positive_correlate, negative_correlate, prevent, inhibit, stimulate, drug_interact, cotreat, convert, and compare. e1 must be an autocomplete _id; type and e2 are optional. Related entity types include gene, disease, chemical, and variant.

Raw lines 125 to 134
135## Typical Workflow
1371. Autocomplete the user's string → `@CHEMICAL_…` / `@DISEASE_…`.
1382. Search with that ID (and a relation if they asked "what does X treat?").
1393. Export `biocjson` for the PMIDs you will report, and list the annotations.
1404. For the paper itself (abstract, OA PDF), go to PubMed / Europe PMC /
141 Unpaywall. PubTator full-text annotations cover a subset; check returned passages before claiming full-text coverage.

Typical Workflow

  1. Autocomplete the user's string → @CHEMICAL_… / @DISEASE_….
  2. Search with that ID (and a relation if they asked "what does X treat?").
  3. Export biocjson for the PMIDs you will report, and list the annotations.
  4. For the paper itself (abstract, OA PDF), go to PubMed / Europe PMC / Unpaywall. PubTator full-text annotations cover a subset; check returned passages before claiming full-text coverage.
Raw lines 135 to 142
143## Failure Modes
145| What you did | What happens | What to do |
146|---|---|---|
147| Parsed export JSON as BioC root | No `passages` at the top level | Descend into `PubTator3` |
148| Searched `remdesivir` and treated hits as exact-chemical papers | Keyword search, not the concept | Autocomplete, then search `@CHEMICAL_remdesivir` |
149| Called the old `pubtator-api` or `CBBresearch` URL | May still 200, but the contract changed | Use `pubtator3-api` |
150| `full=true` with `format=pubtator` | No full text | Use `biocjson` or `biocxml` |
151| Parallel fan-out | Easy to exceed 3 req/s | Serialize |

Failure Modes

What you didWhat happensWhat to do
Parsed export JSON as BioC rootNo passages at the top levelDescend into PubTator3
Searched remdesivir and treated hits as exact-chemical papersKeyword search, not the conceptAutocomplete, then search @CHEMICAL_remdesivir
Called the old pubtator-api or CBBresearch URLMay still 200, but the contract changedUse pubtator3-api
full=true with format=pubtatorNo full textUse biocjson or biocxml
Parallel fan-outEasy to exceed 3 req/sSerialize
Raw lines 143 to 152
153## Official sources reviewed 2026-09-30
155- https://www.ncbi.nlm.nih.gov/research/pubtator3/api

Official sources reviewed 2026-09-30

  • https://www.ncbi.nlm.nih.gov/research/pubtator3/api
Raw lines 153 to 155