> For the complete documentation index, see [llms.txt](https://docs.nested-knowledge.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nested-knowledge.com/guides/write-a-search-query/pubmed.md).

# PubMed

Learn how to write a PubMed search query.

PubMed is the National Library of Medicine's (NLM) free database of biomedical and life sciences citations, including MEDLINE. Nested Knowledge searches it through NLM's Application Programming Interface (API).

PubMed is usually the first source in a biomedical or clinical systematic review, since it covers the core indexed journal literature in the field and uses Boolean Operators.

### Write A Boolean Query

Use AND, OR, and NOT to combine search terms, quotation marks for an exact phrase, and parentheses to group terms and set priority order. For example:

```
stroke AND (trevo OR solitaire) AND "modified Rankin Scale"
```

retrieves publications containing all of the following, anywhere in the record:

* The word stroke, or a term PubMed's Automatic Term Mapping treats as equivalent
* The word trevo or the word solitaire, with the same term-mapping applied
* The exact phrase "modified Rankin Scale"

Quotation marks also turn off Automatic Term Mapping for that phrase. Asterisks work as a truncation operator.

### Search Specific Fields

Add a field to a term with `term[FIELD]`, using one of PubMed's pre-specified fields or filters. A misspelled or unrecognized field is ignored, and the term searches as plain text instead.

#### MeSH fields

PubMed indexes articles using the [MeSH controlled vocabulary](https://www.nlm.nih.gov/mesh/meshhome.html). Add one of these fields when your term of interest sits in the MeSH hierarchy:

* `[mh]` / `[MESH]` / `[MESH TERMS]` — searches the full MeSH hierarchy below your term
* `[MESH MAJOR TOPIC]` — searches only terms indexed as a [Major Topic](https://www.nlm.nih.gov/bsd/disted/meshtutorial/principlesofmedlinesubjectindexing/majortopics/index.html)
* `[MESH SUBHEADING]` — searches a specific qualifier of the heading; see [NLM's guidance](https://www.nlm.nih.gov/bsd/indexing/training/SUB_010.html)

`stroke[MESH MAJOR TOPIC]` returns only studies where stroke (or a term below it) is a Major Topic; `stroke[MESH]` returns any study tagged at or below stroke in the hierarchy. Any field tag, including these, turns off Automatic Term Mapping.

#### Author, Journal, And Other Named Fields

* Author — `name[AUTHOR]`
* Journal — `name[JOURNAL]`
* Publisher — `name[PUBLISHER]`
* Volume — `number[VOLUME]`
* Issue — `number[ISSUE]`

#### Filter By Study Traits

* Publication type — one of PubMed's [supported types](https://pubmed.ncbi.nlm.nih.gov/help/#publication-types), for example `review[PT]`
* Full text available — append `full text[SB]`
* Publication date — `(YYYY-MM-DD[Date - Publication] : YYYY-MM-DD[Date - Publication])`. Only the year is required, and PubMed treats 3000 as "through the present" — for example, `(2015[Date - Publication] : 3000[Date - Publication])`, or the shorter `(2015:3000[pdat])`
* Language — `language[LANGUAGE]`
* See PubMed's [full filter list](https://pubmed.ncbi.nlm.nih.gov/help/#help-filters) for others

#### Filter By Study Contents

* Title only — `term[TITLE]`
* Title or abstract — `term[TITLE/ABSTRACT]`
* Text word — `term[TEXT WORD]`, which spans title, abstract, MeSH terms and subheadings, publication types, substance names, and several other non-MeSH indexed fields; see NLM's [text word guidance](https://pubmed.ncbi.nlm.nih.gov/help/#tw) for the full list

### Build A Strong Search

The guidance below applies across PubMed and EuropePMC.

#### PICO Framework

If you're searching for clinical studies, PICOs (Patients, Interventions/Comparators, and Outcomes) is a useful frame for organizing your search terms into concepts before you combine them.

#### Automatic Term Mapping

PubMed expands most searches beyond your literal term using [Automatic Term Mapping](https://pubmed.ncbi.nlm.nih.gov/help/#automatic-term-mapping) (ATM), checking each term against a subject translation table (including MeSH), a journals table, the author index, and an investigator index. This catches synonyms and close matches you didn't type. Quotation marks and field tags both turn ATM off for that term. To see how ATM expanded a given search, view its [Search History](/review-workflow/literature-search/add-search/automatic-search.md#set-optional-search-details) in Search.

#### Expanding Or Narrowing

If a search returns too few of the records you want:

* Add synonyms with OR
* Remove overly specific or extraneous terms
* Remove quotation marks

If a search returns too many irrelevant records:

* Replace general terms with more specific ones
* Add AND-linked filters for a second concept, study type, or date range
* Add quotation marks where appropriate

### Sourcing And Copyright

Nested Knowledge sources all PubMed data from NLM via its API, and both NK and its users are bound by NLM's terms for that data. NLM assumes no responsibility for how users handle copyrighted material returned by a search, including transmitting, reproducing, or redistributing it — see the [NLM Copyright Statement](https://www.nlm.nih.gov/web_policies.html#copyright). If you use PubMed data, attribute results to PubMed or NLM, per NLM's [Downloading NLM Data](https://www.nlm.nih.gov/databases/download.html) guidance.

Nested Knowledge likewise assumes no responsibility for a user's handling of copyrighted material retrieved this way, and may remove materials from a project under its [Copyright Policy](/policies/policies/legal-and-compliance-policies/copyright-compliant-policy.md).

### FAQs

<details>

<summary>Why doesn't my search return a record I expected?</summary>

Check whether a field tag or quotation mark turned off Automatic Term Mapping for that term — an exact-phrase or field-limited search won't pick up synonyms the way an unqualified term would.

</details>

<details>

<summary>Can I combine MeSH fields with keyword fields in the same query?</summary>

Yes — combine them with AND/OR/NOT the same as any other terms, for example `stroke[MESH] AND thrombectomy`.

</details>

<details>

<summary>Does PubMed searching cost anything beyond my Nested Knowledge subscription?</summary>

No. PubMed's API is free to search; there's no separate license or subscription to arrange, unlike Embase.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nested-knowledge.com/guides/write-a-search-query/pubmed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
