# MeSH

> Look up MeSH, the Medical Subject Headings the U.S. National Library of Medicine indexes PubMed with: the official heading for a subject, its tree numbers and place in the hierarchy, synonyms (entry terms), definition and allowed subheadings (qualifiers), plus supplementary concept records for chemicals, drugs and rare diseases with the headings they map to, and drugs' pharmacological actions. Use it to tag content with standard headings, expand a search with synonyms and narrower headings, or build a precise PubMed query. Every action reads; no account or API key required.

App · 15 actions. Web page: https://docs.lodol.com/docs/integrations/mesh

## Actions

### Build PubMed search

Build a PubMed search for a MeSH heading or supplementary concept, with its exact name and the right search tag: optionally narrowed to subheadings or to articles where it is a main topic, without the headings below it, or widened with its entry terms as title and abstract words. Returns the query and a link that runs it; the PubMed integration's search takes the query as it is.

**Inputs**

- Heading or supplementary concept (`heading`, text, required): A heading's ID (D009203), a supplementary concept's ID (C000718217), or either's exact name.
- Subheadings (`subheadings`, list): Only articles indexed with the heading under any of these subheadings. Leave empty for all of them. Headings only.
- Main topic only (`major_topic_only`, true/false): Only articles where the heading is a main topic. Off by default. Default: `false`.
- Include narrower headings (`include_narrower`, true/false): Also find articles indexed with the headings below it, as PubMed does by default. On by default. Default: `true`.
- Add entry terms as text words (`add_entry_terms`, true/false): Also search titles and abstracts for the heading's name and synonyms, to catch articles not yet indexed. Off by default. Default: `false`.

**Outputs**

- `heading_id` (text): The heading's (or supplementary concept's) MeSH ID.
- `heading_name` (text): Its exact name, as the search uses it.
- `include_narrower` (true/false): True when the headings below it are found too.
- `kind` (text): heading or supplementary_concept.
- `major_topic_only` (true/false): True when only articles with it as a main topic are found.
- `pubmed_url` (text): A link that runs the search on pubmed.ncbi.nlm.nih.gov.
- `query` (text): The PubMed search, ready for PubMed's search box or Search step.
- `subheadings` (list): The subheadings the search narrows to, by name.
- `summary` (text): One line saying what came back.
- `text_words` (list): The names searched for in titles and abstracts too.
- `type` (text): Its type in words: Topical heading, Geographic heading, Publication type, Check tag, Subheading, or a supplementary concept's type (Chemical, Disease, Organism, Population, Protocol, Anatomy).

**Example output**

```json
{
  "heading_id": "D009203",
  "heading_name": "Myocardial Infarction",
  "include_narrower": true,
  "kind": "heading",
  "major_topic_only": true,
  "pubmed_url": "https://pubmed.ncbi.nlm.nih.gov/?term=%28%22Myocardial+Infarction%2Fdrug+therapy%22%5BMajr%5D+OR+%22Myocardial+Infarction%2Fsurgery%22%5BMajr%5D%29",
  "query": "(\"Myocardial Infarction/drug therapy\"[Majr] OR \"Myocardial Infarction/surgery\"[Majr])",
  "subheadings": [
    "drug therapy",
    "surgery"
  ],
  "summary": "PubMed search for Myocardial Infarction: (\"Myocardial Infarction/drug therapy\"[Majr] OR \"Myocardial Infarction/surgery\"[Majr])",
  "text_words": [],
  "type": "Topical heading"
}
```

### Check heading and subheading

Check whether MeSH allows a subheading with a heading, such as Ofloxacin/adverse effects, and get the pair's ID. For a pair it doesn't allow, NLM often names the heading to use instead: Heart/abnormalities points to Heart Defects, Congenital.

**Inputs**

- Heading (`heading`, text, required): The heading's MeSH ID, such as D009203, or its exact name. 'Search headings' finds either.
- Subheading (`subheading`, text, required): Pick a subheading, or type its ID (Q000009), name (adverse effects) or abbreviation (AE).
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `abbreviation` (text): The subheading's two-letter abbreviation.
- `allowed` (true/false): True when MeSH allows the subheading with the heading.
- `found` (true/false): True when MeSH has both the heading and the subheading.
- `heading_id` (text): The heading's MeSH ID.
- `heading_name` (text): The heading's name.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `pair_id` (text): The pair's MeSH ID, such as D015242Q000009.
- `pair_name` (text): The pair as PubMed writes it, such as Ofloxacin/adverse effects.
- `subheading_id` (text): The subheading's MeSH ID.
- `subheading_name` (text): The subheading's name.
- `summary` (text): One line saying what came back.
- `use_instead_id` (text): For a pair MeSH does not allow, the ID of the heading (or pair) NLM says to use instead, when it names one.
- `use_instead_name` (text): Its name, such as Heart Defects, Congenital.

**Example output**

```json
{
  "abbreviation": "AB",
  "allowed": false,
  "found": true,
  "heading_id": "D006321",
  "heading_name": "Heart",
  "mesh_year": "current",
  "pair_id": "D006321Q000002",
  "pair_name": "Heart/abnormalities",
  "subheading_id": "Q000002",
  "subheading_name": "abnormalities",
  "summary": "Heart/abnormalities is not allowed; use Heart Defects, Congenital (D006330) instead",
  "use_instead_id": "D006330",
  "use_instead_name": "Heart Defects, Congenital"
}
```

### Get broader headings

Get every heading above a heading in the MeSH trees: its direct parents, all its ancestors up to the top of each tree, and one readable path per tree number, such as Diseases > Cardiovascular Diseases > Heart Diseases > Myocardial Ischemia > Myocardial Infarction. Useful for tagging with broader subjects.

**Inputs**

- Heading (`heading`, text, required): The heading's MeSH ID, such as D009203, or its exact name. 'Search headings' finds either.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `ancestor_count` (number): How many headings sit above it.
- `ancestor_ids` (list): The IDs of every heading above it, in the same order.
- `ancestors` (list): Every heading above it, the top of each tree first.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `id` (text): The record's MeSH ID, such as D009203.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The heading's name.
- `parent_count` (number): How many headings sit directly above it.
- `parents` (list): The headings directly above it.
- `paths` (list): One path from the top of a tree for each tree number.
- `summary` (text): One line saying what came back.
- `tree_numbers` (list): The heading's own tree numbers.
- `url` (text): The record's page in NLM's MeSH Browser.

**Example output**

```json
{
  "ancestor_count": 9,
  "ancestor_ids": [
    "D002318",
    "D013568",
    "D006331",
    "D010335",
    "D014652",
    "D007511",
    "D017202",
    "D009336",
    "D007238"
  ],
  "ancestors": [
    {
      "id": "D002318",
      "level": 1,
      "name": "Cardiovascular Diseases",
      "tree_numbers": [
        "C14"
      ]
    },
    {
      "id": "D013568",
      "level": 1,
      "name": "Pathological Conditions, Signs and Symptoms",
      "tree_numbers": [
        "C23"
      ]
    },
    {
      "id": "D006331",
      "level": 2,
      "name": "Heart Diseases",
      "tree_numbers": [
        "C14.280"
      ]
    },
    {
      "id": "D010335",
      "level": 2,
      "name": "Pathologic Processes",
      "tree_numbers": [
        "C23.550"
      ]
    },
    {
      "id": "D014652",
      "level": 2,
      "name": "Vascular Diseases",
      "tree_numbers": [
        "C14.907"
      ]
    },
    {
      "id": "D007511",
      "level": 3,
      "name": "Ischemia",
      "tree_numbers": [
        "C23.550.513"
      ]
    },
    {
      "id": "D017202",
      "level": 3,
      "name": "Myocardial Ischemia",
      "tree_numbers": [
        "C14.280.647",
        "C14.907.585"
      ]
    },
    {
      "id": "D009336",
      "level": 3,
      "name": "Necrosis",
      "tree_numbers": [
        "C23.550.717"
      ]
    },
    {
      "id": "D007238",
      "level": 4,
      "name": "Infarction",
      "tree_numbers": [
        "C23.550.513.355",
        "C23.550.717.489"
      ]
    }
  ],
  "found": true,
  "id": "D009203",
  "mesh_year": "current",
  "name": "Myocardial Infarction",
  "parent_count": 2,
  "parents": [
    {
      "id": "D007238",
      "name": "Infarction",
      "tree_numbers": [
        "C23.550.513.355",
        "C23.550.717.489"
      ]
    },
    {
      "id": "D017202",
      "name": "Myocardial Ischemia",
      "tree_numbers": [
        "C14.280.647",
        "C14.907.585"
      ]
    }
  ],
  "paths": [
    {
      "path": "Diseases > Cardiovascular Diseases > Heart Diseases > Myocardial Ischemia > Myocardial Infarction",
      "tree_number": "C14.280.647.500"
    },
    {
      "path": "Diseases > Cardiovascular Diseases > Vascular Diseases > Myocardial Ischemia > Myocardial Infarction",
      "tree_number": "C14.907.585.500"
    },
    {
      "path": "Diseases > Pathological Conditions, Signs and Symptoms > Pathologic Processes > Ischemia > Infarction > Myocardial Infarction",
      "tree_number": "C23.550.513.355.750"
    },
    {
      "path": "Diseases > Pathological Conditions, Signs and Symptoms > Pathologic Processes > Necrosis > Infarction > Myocardial Infarction",
      "tree_number": "C23.550.717.489.750"
    }
  ],
  "summary": "Myocardial Infarction (D009203) sits under Infarction; Myocardial Ischemia",
  "tree_numbers": [
    "C14.280.647.500",
    "C14.907.585.500",
    "C23.550.513.355.750",
    "C23.550.717.489.750"
  ],
  "url": "https://meshb.nlm.nih.gov/record/ui?ui=D009203"
}
```

### Get heading

Get a MeSH heading in full: its definition (scope note), tree numbers, entry terms, allowed subheadings with their abbreviations, broader and see-also headings, pharmacological actions for a drug, previous indexing, NLM's notes, registry numbers and dates. A heading MeSH doesn't have comes back with found false.

**Inputs**

- Heading (`heading`, text, required): The heading's MeSH ID, such as D009203, or its exact name. 'Search headings' finds either.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `active` (true/false): False for a heading NLM has retired.
- `allowed_subheading_count` (number): How many subheadings it allows.
- `allowed_subheadings` (list): The subheadings MeSH allows with it, by name.
- `annotation` (text): NLM's notes to indexers on how to use it.
- `broader_headings` (list): The headings directly above it in the trees.
- `cas_name` (text): For a chemical, its Chemical Abstracts systematic name.
- `consider_also` (text): Word roots of related headings worth searching too.
- `date_created` (text): When the record was created, as YYYY-MM-DD, if NLM says.
- `date_established` (text): When it was established, as YYYY-MM-DD, if NLM says.
- `date_introduced` (text): When it entered MeSH, as YYYY-MM-DD.
- `date_revised` (text): When it was last revised, as YYYY-MM-DD, if NLM says.
- `entry_terms` (list): Its synonyms and other names, which lead to it in searches.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `history_note` (text): How the heading has changed over the years.
- `id` (text): The record's MeSH ID, such as D009203.
- `last_updated` (text): When NLM last updated it, as YYYY-MM-DD.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The heading's name, such as Myocardial Infarction.
- `nlm_classification_number` (text): The NLM Classification shelf number, such as WG 310.
- `online_note` (text): NLM's advice for searching older articles.
- `pharmacological_actions` (list): For a drug or chemical, what it does, as headings.
- `previous_indexing` (list): Headings PubMed used for the subject before this one existed, with years.
- `public_mesh_note` (text): NLM's public note on its history.
- `registry_numbers` (list): For a chemical, its CAS, UNII or EC numbers, some with a name after them.
- `scope_note` (text): NLM's definition of the heading.
- `see_also` (list): Related headings NLM points to.
- `summary` (text): One line saying what came back.
- `tree_numbers` (list): Where it sits in the MeSH trees, such as C14.280.647.500; one per place.
- `type` (text): Its type in words: Topical heading, Geographic heading, Publication type, Check tag, Subheading, or a supplementary concept's type (Chemical, Disease, Organism, Population, Protocol, Anatomy).
- `url` (text): The record's page in NLM's MeSH Browser.

**Example output**

```json
{
  "active": true,
  "allowed_subheading_count": 35,
  "allowed_subheadings": [
    {
      "abbreviation": "BL",
      "id": "Q000097",
      "name": "blood"
    },
    {
      "abbreviation": "CF",
      "id": "Q000134",
      "name": "cerebrospinal fluid"
    },
    {
      "abbreviation": "CI",
      "id": "Q000139",
      "name": "chemically induced"
    },
    {
      "abbreviation": "CL",
      "id": "Q000145",
      "name": "classification"
    },
    {
      "abbreviation": "CO",
      "id": "Q000150",
      "name": "complications"
    },
    {
      "abbreviation": "CN",
      "id": "Q000151",
      "name": "congenital"
    }
  ],
  "annotation": "do not coordinate with ACUTE DISEASE for \"acute infarct\"",
  "broader_headings": [
    {
      "id": "D007238",
      "name": "Infarction"
    },
    {
      "id": "D017202",
      "name": "Myocardial Ischemia"
    }
  ],
  "cas_name": null,
  "consider_also": null,
  "date_created": null,
  "date_established": null,
  "date_introduced": "1966-01-01",
  "date_revised": null,
  "entry_terms": [
    "Cardiovascular Stroke",
    "Heart Attack",
    "Myocardial Infarct"
  ],
  "found": true,
  "history_note": "79; was MYOCARDIAL INFARCT 1963-78",
  "id": "D009203",
  "last_updated": "2019-07-01",
  "mesh_year": "current",
  "name": "Myocardial Infarction",
  "nlm_classification_number": "WG 310",
  "online_note": "use MYOCARDIAL INFARCTION to search MYOCARDIAL INFARCT 1966-78",
  "pharmacological_actions": [],
  "previous_indexing": [],
  "public_mesh_note": "79; was MYOCARDIAL INFARCT 1963-78",
  "registry_numbers": [],
  "scope_note": "NECROSIS of the MYOCARDIUM caused by an obstruction of the blood supply to the heart (CORONARY CIRCULATION).",
  "see_also": [
    {
      "id": "D006342",
      "name": "Heart Rupture, Post-Infarction"
    }
  ],
  "summary": "Myocardial Infarction (D009203), topical heading at C14.280.647.500, C14.907.585.500, C23.550.513.355.750, C23.550.717.489.750",
  "tree_numbers": [
    "C14.280.647.500",
    "C14.907.585.500",
    "C23.550.513.355.750",
    "C23.550.717.489.750"
  ],
  "type": "Topical heading",
  "url": "https://meshb.nlm.nih.gov/record/ui?ui=D009203"
}
```

### Get narrower headings

List the headings below a heading in the MeSH trees: the level just below, or every heading below it, which is what PubMed searches when it explodes a heading. Each comes with its tree numbers. Useful for expanding a search or a tag to more specific subjects.

**Inputs**

- Heading (`heading`, text, required): The heading's MeSH ID, such as D009203, or its exact name. 'Search headings' finds either.
- Depth (`depth`, text): The level just below the heading, or every heading below it. Defaults to the level just below. One of: `children` (Direct children only), `all` (All descendants). Default: `children`.
- Most results (`limit`, number): The most headings to return, 1 to 500. Defaults to 100. From 1 to 500. Default: `100`.
- Skip (`offset`, number): How many to skip, to page through a long list. Defaults to 0. From 0 to 100000.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `count` (number): How many headings are in this page of the list.
- `depth` (text): children for the level below, or all for every heading below.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `has_more` (true/false): True when there are more after these: raise Skip to see them.
- `id` (text): The record's MeSH ID, such as D009203.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The heading's name.
- `narrower` (list): The headings below it, in alphabetical order.
- `narrower_ids` (list): Their IDs alone, in the same order.
- `offset` (number): How many were skipped before these.
- `summary` (text): One line saying what came back.
- `tree_numbers` (list): The heading's own tree numbers.
- `url` (text): The record's page in NLM's MeSH Browser.

**Example output**

```json
{
  "count": 5,
  "depth": "all",
  "found": true,
  "has_more": true,
  "id": "D017202",
  "mesh_year": "current",
  "name": "Myocardial Ischemia",
  "narrower": [
    {
      "id": "D054058",
      "name": "Acute Coronary Syndrome",
      "tree_numbers": [
        "C14.280.647.124",
        "C14.907.585.124"
      ]
    },
    {
      "id": "D000787",
      "name": "Angina Pectoris",
      "tree_numbers": [
        "C14.280.647.187",
        "C14.907.585.187"
      ]
    },
    {
      "id": "D000788",
      "name": "Angina Pectoris, Variant",
      "tree_numbers": [
        "C14.280.647.187.150.150",
        "C14.907.585.187.150.500"
      ]
    },
    {
      "id": "D060050",
      "name": "Angina, Stable",
      "tree_numbers": [
        "C14.280.647.187.362",
        "C14.907.585.187.362"
      ]
    },
    {
      "id": "D000789",
      "name": "Angina, Unstable",
      "tree_numbers": [
        "C14.280.647.187.150",
        "C14.907.585.187.150"
      ]
    }
  ],
  "narrower_ids": [
    "D054058",
    "D000787",
    "D000788",
    "D060050",
    "D000789"
  ],
  "offset": 0,
  "summary": "Myocardial Ischemia (D017202) has 5 headings below it on this page, and more after it",
  "tree_numbers": [
    "C14.280.647",
    "C14.907.585"
  ],
  "url": "https://meshb.nlm.nih.gov/record/ui?ui=D017202"
}
```

### Get subheading

Get a MeSH subheading (qualifier) in full: its abbreviation, what it is used with (scope note), its place in the subheading tree, its other names, NLM's notes and dates.

**Inputs**

- Subheading (`subheading`, text, required): Pick a subheading, or type its ID (Q000009), name (adverse effects) or abbreviation (AE).
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `abbreviation` (text): Its two-letter abbreviation, such as AE.
- `active` (true/false): False for a subheading NLM has retired.
- `annotation` (text): NLM's notes to indexers on how to use it.
- `broader_subheadings` (list): The subheadings directly above it.
- `date_created` (text): When the record was created, as YYYY-MM-DD, if NLM says.
- `date_established` (text): When it was established, as YYYY-MM-DD, if NLM says.
- `date_introduced` (text): When it entered MeSH, as YYYY-MM-DD.
- `date_revised` (text): When it was last revised, as YYYY-MM-DD, if NLM says.
- `entry_terms` (list): Its other names.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `history_note` (text): How its use has changed over the years.
- `id` (text): The subheading's MeSH ID, such as Q000009.
- `last_updated` (text): When NLM last updated it, as YYYY-MM-DD.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The subheading's name, such as adverse effects.
- `online_note` (text): NLM's advice for searching with it.
- `scope_note` (text): NLM's definition: what it is used with, and for.
- `summary` (text): One line saying what came back.
- `tree_numbers` (list): Where it sits in the subheading tree, such as Y07.020.
- `url` (text): The record's page in NLM's MeSH Browser.

**Example output**

```json
{
  "abbreviation": "AE",
  "active": true,
  "annotation": "subheading only; see also /poisoning & /toxicity",
  "broader_subheadings": [
    {
      "id": "Q000494",
      "name": "pharmacology"
    },
    {
      "id": "Q000627",
      "name": "therapeutic use"
    }
  ],
  "date_created": null,
  "date_established": null,
  "date_introduced": "1966-01-01",
  "date_revised": null,
  "entry_terms": [
    "side effects"
  ],
  "found": true,
  "history_note": "66; used with Category D, E & H 1966-69; D, E, H & J 1970-74; D, E, F4, H & J 1975-81; D, E, F4, G3, H & J 1982-87; D, E, F4, H, J, & SMOKING 1988; D, E, F4, H, J, & 1982-87; D, E, F4, H, J & SMOKING 1988; D, E, F4, H, J & SMOKING+ 1989; D, E & J 1990 forward",
  "id": "Q000009",
  "last_updated": "2017-07-05",
  "mesh_year": "current",
  "name": "adverse effects",
  "online_note": "search policy: Online Manual; use: main heading/AE or AE (SH) or SUBS APPLY AE",
  "scope_note": "Used with drugs, chemicals, or biological agents in accepted dosage - or with physical agents or manufactured products in normal usage - when intended for diagnostic, therapeutic, prophylactic, or anesthetic purposes. It is used also for adverse effects or complications of diagnostic, therapeutic, prophylactic, anesthetic, surgical, or other procedures.",
  "summary": "adverse effects (Q000009, AE)",
  "tree_numbers": [
    "Y07.020",
    "Y10.020"
  ],
  "url": "https://meshb.nlm.nih.gov/record/ui?ui=Q000009"
}
```

### Get supplementary concept

Get a MeSH supplementary concept record (a chemical, drug, rare disease or organism) in full: the headings it maps to, which are how PubMed indexes it, its pharmacological actions, synonyms, registry numbers, how many PubMed articles carry it, NLM's note and dates. A record MeSH doesn't have comes back with found false.

**Inputs**

- Supplementary concept (`concept`, text, required): The record's MeSH ID, such as C000718217, or its exact name. 'Search supplementary concepts' finds either.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `active` (true/false): False for a record NLM has retired.
- `date_created` (text): When the record was created, as YYYY-MM-DD, if NLM says.
- `date_established` (text): When it was established, as YYYY-MM-DD, if NLM says.
- `date_introduced` (text): When it entered MeSH, as YYYY-MM-DD.
- `date_revised` (text): When it was last revised, as YYYY-MM-DD, if NLM says.
- `entry_terms` (list): Its synonyms and other names, such as codes and brand names.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `frequency` (number): How many PubMed articles are indexed with it.
- `id` (text): The record's MeSH ID, such as C000718217.
- `indexer_consider_also` (list): Headings NLM suggests indexers also consider.
- `last_updated` (text): When NLM last updated it, as YYYY-MM-DD.
- `mapped_heading_ids` (list): The IDs of those headings alone, each once.
- `mapped_to` (list): The headings PubMed adds to an article indexed with this record: the way to search for it with headings.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The record's name, such as nirmatrelvir.
- `note` (text): NLM's note on the record.
- `pharmacological_actions` (list): For a chemical, what it does, as headings.
- `previous_indexing` (list): How PubMed indexed it before, with years.
- `registry_numbers` (list): Its CAS, UNII or EC numbers, when NLM has them.
- `sources` (list): The article in which NLM first found it.
- `summary` (text): One line saying what came back.
- `type` (text): Chemical, Disease, Organism, Population, Protocol or Anatomy.
- `url` (text): The record's page in NLM's MeSH Browser.

**Example output**

```json
{
  "active": true,
  "date_created": null,
  "date_established": null,
  "date_introduced": "2021-07-19",
  "date_revised": null,
  "entry_terms": [
    "(1R,2S,5S)-N-((1S)-1-cyano-2-((3S)-2-oxopyrrolidin-3-yl)ethyl)-6,6-dimethyl-3-(3-methyl-N-(trifluoroacetyl)-l-valyl)-3-azabicyclo(3.1.0)hexane-2-carboxamide",
    "PF-07321332",
    "PF07321332"
  ],
  "found": true,
  "frequency": 41,
  "id": "C000718217",
  "indexer_consider_also": [],
  "last_updated": "2022-01-06",
  "mapped_heading_ids": [
    "D007769",
    "D007930",
    "D009570",
    "D011392"
  ],
  "mapped_to": [
    {
      "id": "D007769",
      "name": "Lactams",
      "preferred": true
    },
    {
      "id": "D007930",
      "name": "Leucine",
      "preferred": true
    },
    {
      "id": "D009570",
      "name": "Nitriles",
      "preferred": true
    },
    {
      "id": "D011392",
      "name": "Proline",
      "preferred": true
    }
  ],
  "mesh_year": "current",
  "name": "nirmatrelvir",
  "note": "component of COVID-19 drug Paxlovid",
  "pharmacological_actions": [
    {
      "id": "D000084762",
      "name": "Viral Protease Inhibitors"
    }
  ],
  "previous_indexing": [],
  "registry_numbers": [],
  "sources": [
    "Curr Opin Virol. 2021 Apr 27;49:36-40."
  ],
  "summary": "nirmatrelvir (C000718217), chemical, maps to Lactams; Leucine; Nitriles; Proline",
  "type": "Chemical",
  "url": "https://meshb.nlm.nih.gov/record/ui?ui=C000718217"
}
```

### List allowed subheadings

List the subheadings (qualifiers, such as adverse effects or drug therapy) MeSH allows with a heading, with their IDs and two-letter abbreviations.

**Inputs**

- Heading (`heading`, text, required): The heading's MeSH ID, such as D009203, or its exact name. 'Search headings' finds either.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `count` (number): How many subheadings it allows.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `id` (text): The record's MeSH ID, such as D009203.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The heading's name.
- `subheading_names` (list): Their names alone, in the same order.
- `subheadings` (list): The subheadings MeSH allows with the heading, by name.
- `summary` (text): One line saying what came back.

**Example output**

```json
{
  "count": 25,
  "found": true,
  "id": "D015242",
  "mesh_year": "current",
  "name": "Ofloxacin",
  "subheading_names": [
    "administration & dosage",
    "adverse effects",
    "agonists",
    "analogs & derivatives",
    "analysis",
    "antagonists & inhibitors"
  ],
  "subheadings": [
    {
      "abbreviation": "AD",
      "id": "Q000008",
      "name": "administration & dosage"
    },
    {
      "abbreviation": "AE",
      "id": "Q000009",
      "name": "adverse effects"
    },
    {
      "abbreviation": "AG",
      "id": "Q000819",
      "name": "agonists"
    },
    {
      "abbreviation": "AA",
      "id": "Q000031",
      "name": "analogs & derivatives"
    },
    {
      "abbreviation": "AN",
      "id": "Q000032",
      "name": "analysis"
    },
    {
      "abbreviation": "AI",
      "id": "Q000037",
      "name": "antagonists & inhibitors"
    }
  ],
  "summary": "Ofloxacin (D015242) takes 25 subheadings"
}
```

### List pharmacological actions

List what a drug or chemical does, as MeSH pharmacological actions: Ofloxacin is an Anti-Bacterial Agent and a Topoisomerase II Inhibitor, among others. Takes a heading or a supplementary concept.

**Inputs**

- Substance (`substance`, text, required): The drug or chemical: a heading's ID (D015242), a supplementary concept's ID (C000718217), or either's exact name.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `action_ids` (list): Their IDs alone, in the same order.
- `count` (number): How many pharmacological actions it has.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `id` (text): The record's MeSH ID, such as D009203.
- `kind` (text): heading or supplementary_concept.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): The substance's name.
- `pharmacological_actions` (list): What the substance does, as headings, in alphabetical order.
- `summary` (text): One line saying what came back.
- `type` (text): Its type in words: Topical heading, Geographic heading, Publication type, Check tag, Subheading, or a supplementary concept's type (Chemical, Disease, Organism, Population, Protocol, Anatomy).

**Example output**

```json
{
  "action_ids": [
    "D000900",
    "D000892",
    "D065609",
    "D059005"
  ],
  "count": 4,
  "found": true,
  "id": "D015242",
  "kind": "heading",
  "mesh_year": "current",
  "name": "Ofloxacin",
  "pharmacological_actions": [
    {
      "id": "D000900",
      "name": "Anti-Bacterial Agents"
    },
    {
      "id": "D000892",
      "name": "Anti-Infective Agents, Urinary"
    },
    {
      "id": "D065609",
      "name": "Cytochrome P-450 CYP1A2 Inhibitors"
    },
    {
      "id": "D059005",
      "name": "Topoisomerase II Inhibitors"
    }
  ],
  "summary": "Ofloxacin (D015242) has 4 pharmacological actions",
  "type": "Topical heading"
}
```

### List substances with an action

List the drugs and chemicals MeSH files under a pharmacological action, such as every Anti-Bacterial Agent: headings, supplementary concepts, or both. Retired records are left out.

**Inputs**

- Pharmacological action (`pharmacological_action`, text, required): The action's heading ID, such as D000900, or its exact name, such as Anti-Bacterial Agents.
- Include (`include`, text): Which substances to list. Defaults to headings and supplementary concepts. One of: `all` (Headings and supplementary concepts), `headings` (Headings only), `supplementary_concepts` (Supplementary concepts only). Default: `all`.
- Most results (`limit`, number): The most substances to return, 1 to 500. Defaults to 100. From 1 to 500. Default: `100`.
- Skip (`offset`, number): How many to skip, to page through a long list. Defaults to 0. From 0 to 100000.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `count` (number): How many substances are in this page of the list.
- `found` (true/false): True when MeSH has the record. False means it has none by that ID or name in the MeSH year read, and the other fields are empty.
- `has_more` (true/false): True when there are more after these: raise Skip to see them.
- `id` (text): The pharmacological action's MeSH ID, such as D000900.
- `include` (text): all, headings or supplementary_concepts.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): Its name, such as Anti-Bacterial Agents.
- `offset` (number): How many were skipped before these.
- `substance_ids` (list): Their IDs alone, in the same order.
- `substances` (list): The substances, in alphabetical order.
- `summary` (text): One line saying what came back.

**Example output**

```json
{
  "count": 5,
  "found": true,
  "has_more": true,
  "id": "D000900",
  "include": "headings",
  "mesh_year": "current",
  "name": "Anti-Bacterial Agents",
  "offset": 0,
  "substance_ids": [
    "D019342",
    "D000408",
    "D000560",
    "D000561",
    "D000583"
  ],
  "substances": [
    {
      "id": "D019342",
      "kind": "heading",
      "name": "Acetic Acid",
      "type": "Topical heading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D019342"
    },
    {
      "id": "D000408",
      "kind": "heading",
      "name": "Alamethicin",
      "type": "Topical heading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D000408"
    },
    {
      "id": "D000560",
      "kind": "heading",
      "name": "Amdinocillin",
      "type": "Topical heading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D000560"
    },
    {
      "id": "D000561",
      "kind": "heading",
      "name": "Amdinocillin Pivoxil",
      "type": "Topical heading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D000561"
    },
    {
      "id": "D000583",
      "kind": "heading",
      "name": "Amikacin",
      "type": "Topical heading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D000583"
    }
  ],
  "summary": "5 substances filed under Anti-Bacterial Agents (D000900) on this page, and more after it"
}
```

### Look up MeSH IDs

Name up to 100 MeSH IDs at once, of any kind: headings (D...), subheadings (Q...), supplementary concepts (C...), heading/subheading pairs, concepts and terms. Each comes back with its name and type, or marked not found rather than failing the step.

**Inputs**

- IDs (`ids`, list, required): The MeSH IDs, as a list from an earlier step or typed with commas, spaces or new lines between them.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `count` (number): How many IDs were looked up.
- `found_count` (number): How many of them MeSH has.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `not_found` (list): The IDs MeSH has no record for.
- `records` (list): Every ID, in the order given, with what it names.
- `summary` (text): One line saying what came back.

**Example output**

```json
{
  "count": 6,
  "found_count": 5,
  "mesh_year": "current",
  "not_found": [
    "D999999"
  ],
  "records": [
    {
      "active": true,
      "found": true,
      "id": "D009203",
      "kind": "heading",
      "name": "Myocardial Infarction",
      "type": "Topical heading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D009203"
    },
    {
      "active": true,
      "found": true,
      "id": "Q000009",
      "kind": "subheading",
      "name": "adverse effects",
      "type": "Subheading",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=Q000009"
    },
    {
      "active": true,
      "found": true,
      "id": "C000718217",
      "kind": "supplementary_concept",
      "name": "nirmatrelvir",
      "type": "Chemical",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C000718217"
    },
    {
      "active": true,
      "found": true,
      "id": "D015242Q000009",
      "kind": "pair",
      "name": "Ofloxacin/adverse effects",
      "type": "Allowed heading/subheading pair",
      "url": null
    },
    {
      "active": true,
      "found": true,
      "id": "T000866941",
      "kind": "term",
      "name": "Heart Attack",
      "type": "Term",
      "url": null
    },
    {
      "active": null,
      "found": false,
      "id": "D999999",
      "kind": null,
      "name": null,
      "type": null,
      "url": null
    }
  ],
  "summary": "Named 5 of 6 IDs; the current MeSH has no D999999"
}
```

### Look up tree number

Find the heading at a MeSH tree number, such as C14.280.647, with the heading one level up and every heading one level down. Give a tree's letter, such as C for Diseases, to list the headings at the top of that tree.

**Inputs**

- Tree number (`tree_number`, text, required): A tree number such as C14.280.647, or a tree's letter: A Anatomy, B Organisms, C Diseases, D Chemicals and Drugs, E Techniques and Equipment, F Psychiatry and Psychology, G Phenomena and Processes, and so on to Z Geographicals.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `category` (text): The tree's letter, such as C.
- `category_name` (text): The tree's name, such as Diseases.
- `child_count` (number): How many records sit one level below.
- `child_ids` (list): Their IDs alone, each once.
- `children` (list): The records one level below, in tree number order; for a letter, the headings at the top of that tree.
- `found` (true/false): True when MeSH has the tree number (or, for a letter, the tree). False means it has none, and the other fields are empty.
- `id` (text): The ID of the heading (or subheading) at that place; empty for a letter.
- `kind` (text): heading or subheading.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `name` (text): Its name.
- `parent_id` (text): The ID of the record one level up.
- `parent_name` (text): The name of the record one level up.
- `parent_tree_number` (text): The tree number one level up; empty at the top.
- `summary` (text): One line saying what came back.
- `tree_number` (text): The tree number or letter looked up.
- `url` (text): The record's page in NLM's MeSH Browser.

**Example output**

```json
{
  "category": "C",
  "category_name": "Diseases",
  "child_count": 6,
  "child_ids": [
    "D054058",
    "D000787",
    "D003327",
    "D000074962",
    "D009203",
    "D015428"
  ],
  "children": [
    {
      "id": "D054058",
      "name": "Acute Coronary Syndrome",
      "tree_number": "C14.280.647.124"
    },
    {
      "id": "D000787",
      "name": "Angina Pectoris",
      "tree_number": "C14.280.647.187"
    },
    {
      "id": "D003327",
      "name": "Coronary Disease",
      "tree_number": "C14.280.647.250"
    },
    {
      "id": "D000074962",
      "name": "Kounis Syndrome",
      "tree_number": "C14.280.647.375"
    },
    {
      "id": "D009203",
      "name": "Myocardial Infarction",
      "tree_number": "C14.280.647.500"
    },
    {
      "id": "D015428",
      "name": "Myocardial Reperfusion Injury",
      "tree_number": "C14.280.647.625"
    }
  ],
  "found": true,
  "id": "D017202",
  "kind": "heading",
  "mesh_year": "current",
  "name": "Myocardial Ischemia",
  "parent_id": "D006331",
  "parent_name": "Heart Diseases",
  "parent_tree_number": "C14.280",
  "summary": "C14.280.647 is Myocardial Ischemia (D017202), with 6 children",
  "tree_number": "C14.280.647",
  "url": "https://meshb.nlm.nih.gov/record/ui?ui=D017202"
}
```

### Search entry terms

Find MeSH entry terms (the synonyms, spellings, brand names and codes that lead to a heading) by text, and the heading, subheading or supplementary concept each one names: 'heart attack' leads to Myocardial Infarction, 'paracetamol' to Acetaminophen. Use it to map free text to official headings.

**Inputs**

- Text (`text`, text, required): The words to look for in entry terms, in any letter case.
- Match (`match`, text): How a term must match the text. Defaults to exact name. One of: `exact` (Exact name), `contains` (Contains the text), `startswith` (Starts with the text). Default: `exact`.
- Most results (`limit`, number): The most terms to return, 1 to 50. Defaults to 10. From 1 to 50. Default: `10`.

**Outputs**

- `count` (number): How many terms were found.
- `heading_ids` (list): The IDs of the headings the terms name, each once.
- `summary` (text): One line saying what came back.
- `terms` (list): The terms found, in the order NLM lists them.

**Example output**

```json
{
  "count": 5,
  "heading_ids": [
    "D000082"
  ],
  "summary": "5 terms matching 'paracetamol'O-isopropyl acetaminophen; O-propyl acetaminophen; Acetaminophen; acetaminophen, butalbital, caffeine drug combination",
  "terms": [
    {
      "is_preferred": true,
      "record_id": "C063450",
      "record_kind": "supplementary_concept",
      "record_name": "3-(cystein-S-yl)paracetamol",
      "record_type": "Chemical",
      "term": "3-(cystein-S-yl)paracetamol",
      "term_id": "T205149",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C063450"
    },
    {
      "is_preferred": false,
      "record_id": "C067793",
      "record_kind": "supplementary_concept",
      "record_name": "O-isopropyl acetaminophen",
      "record_type": "Chemical",
      "term": "O-isopropyl paracetamol",
      "term_id": "T215716",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C067793"
    },
    {
      "is_preferred": false,
      "record_id": "C067792",
      "record_kind": "supplementary_concept",
      "record_name": "O-propyl acetaminophen",
      "record_type": "Chemical",
      "term": "O-propyl paracetamol",
      "term_id": "T215714",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C067792"
    },
    {
      "is_preferred": false,
      "record_id": "D000082",
      "record_kind": "heading",
      "record_name": "Acetaminophen",
      "record_type": "Topical heading",
      "term": "Paracetamol",
      "term_id": "T000219",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D000082"
    },
    {
      "is_preferred": false,
      "record_id": "C056076",
      "record_kind": "supplementary_concept",
      "record_name": "acetaminophen, butalbital, caffeine drug combination",
      "record_type": "Chemical",
      "term": "acetaminophen - caffeine - paracetamol",
      "term_id": "T773555",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C056076"
    }
  ]
}
```

### Search headings

Find MeSH headings (descriptors, the subjects PubMed indexes articles under) by name: exactly, containing some text, or starting with it, in any letter case. Each comes back with its ID and MeSH Browser link. To find a heading from a synonym, use 'Search entry terms'.

**Inputs**

- Name (`name`, text, required): The text to look for in heading names.
- Match (`match`, text): How a heading's name must match the text. Defaults to exact name. One of: `exact` (Exact name), `contains` (Contains the text), `startswith` (Starts with the text). Default: `exact`.
- Most results (`limit`, number): The most headings to return, 1 to 50. Defaults to 10. From 1 to 50. Default: `10`.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `count` (number): How many headings were found.
- `headings` (list): The headings found, in the order NLM lists them.
- `ids` (list): The headings' IDs alone, to pass to another step.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `summary` (text): One line saying what came back.

**Example output**

```json
{
  "count": 5,
  "headings": [
    {
      "id": "D006321",
      "name": "Heart",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D006321"
    },
    {
      "id": "D006322",
      "name": "Heart Aneurysm",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D006322"
    },
    {
      "id": "D006323",
      "name": "Heart Arrest",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D006323"
    },
    {
      "id": "D006324",
      "name": "Heart Arrest, Induced",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D006324"
    },
    {
      "id": "D006325",
      "name": "Heart Atria",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=D006325"
    }
  ],
  "ids": [
    "D006321",
    "D006322",
    "D006323",
    "D006324",
    "D006325"
  ],
  "mesh_year": "current",
  "summary": "5 headings starting with 'heart' in the current MeSH"
}
```

### Search supplementary concepts

Find MeSH supplementary concept records by name: the chemicals, drugs, rare diseases, organisms, population groups and drug protocols MeSH records outside its headings. Closest (shortest) names come first; pick a type to narrow the search.

**Inputs**

- Name (`name`, text, required): The text to look for in record names, in any letter case.
- Match (`match`, text): How a record's name must match the text. Defaults to contains the text. One of: `exact` (Exact name), `contains` (Contains the text), `startswith` (Starts with the text). Default: `contains`.
- Type (`concept_type`, text): Only records of this type. Defaults to any type. One of: `any` (Any type), `chemical` (Chemicals and drugs), `disease` (Diseases (mostly rare diseases)), `organism` (Organisms), `population` (Population groups), `protocol` (Protocols (drug regimens)), `anatomy`. Default: `any`.
- Most results (`limit`, number): The most records to return, 1 to 100. Defaults to 20. From 1 to 100. Default: `20`.
- Skip (`offset`, number): How many to skip, to page through a long list. Defaults to 0. From 0 to 100000.
- MeSH year (`year`, text): Which year's MeSH to read. Current by default; pick an earlier year to match work indexed with it. Default: `current`.

**Outputs**

- `count` (number): How many records are in this page of the list.
- `has_more` (true/false): True when there are more after these: raise Skip to see them.
- `ids` (list): Their IDs alone, in the same order.
- `mesh_year` (text): The MeSH read: 'current', or a year such as '2025'.
- `offset` (number): How many were skipped before these.
- `summary` (text): One line saying what came back.
- `supplementary_concepts` (list): The records found, shortest (closest) names first.

**Example output**

```json
{
  "count": 5,
  "has_more": true,
  "ids": [
    "C536136",
    "C536848",
    "C562378",
    "C537071",
    "C580012"
  ],
  "mesh_year": "current",
  "offset": 0,
  "summary": "5 supplementary concepts matching 'fibrosis' on this page, and more after it",
  "supplementary_concepts": [
    {
      "id": "C536136",
      "name": "Mediastinal Fibrosis",
      "type": "Disease",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C536136"
    },
    {
      "id": "C536848",
      "name": "Familial myelofibrosis",
      "type": "Disease",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C536848"
    },
    {
      "id": "C562378",
      "name": "Hepatic Fibrosis, Congenital",
      "type": "Disease",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C562378"
    },
    {
      "id": "C537071",
      "name": "Follicular hamartoma alopecia cystic fibrosis",
      "type": "Disease",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C537071"
    },
    {
      "id": "C580012",
      "name": "congenital fibrosis of the extraocular muscles",
      "type": "Disease",
      "url": "https://meshb.nlm.nih.gov/record/ui?ui=C580012"
    }
  ]
}
```
