# MeSH API
> Medical Subject Headings (MeSH) as an API, powered by the U.S. National Library of Medicine's official MeSH RDF service. MeSH is the NLM's authoritative controlled vocabulary used to index the biomedical literature in PubMed — a curated thesaurus of diseases, anatomy, chemicals and drugs, organisms, psychiatry and psychology, analytical and diagnostic techniques, health care and more. Each concept is a "descriptor" with a stable unique id (e.g. D003920), a preferred name, a set of entry terms (synonyms and lay variants), and a list of allowable qualifiers (subheadings such as drug therapy, diagnosis or epidemiology). /v1/search?q=diabetes searches descriptors by their preferred name (match=contains, exact or startswith) and returns each descriptor's id and label. /v1/term?q=heart attack resolves a lay term or synonym to the MeSH descriptor(s) it belongs to, so colloquial language maps onto the controlled vocabulary (heart attack to Myocardial Infarction). /v1/descriptor?id=D003920 returns a descriptor's full record — its preferred name, all entry terms (synonyms), the allowable qualifiers and see-also cross-references, with a link to the MeSH browser. Ideal for biomedical natural-language processing and text mining, tagging and indexing literature, building clinical and research search tools, autocomplete over medical terminology, and mapping free text onto a standard ontology. Data from NLM MeSH (public domain). For drug-specific clinical nomenclature and interactions, see the RxNorm API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/mesh-api/..."
```

## Pricing
- **Free** (Free) — 2,400 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 52,000 calls/Mo, 5 req/s
- **Pro** ($21/Mo) — 230,000 calls/Mo, 12 req/s
- **Mega** ($56/Mo) — 820,000 calls/Mo, 35 req/s

## Endpoints

### Vocabulary

#### `GET /v1/descriptor` — A descriptor full record

**Parameters:**
- `id` (query, required, string) — MeSH descriptor id, e.g. D003920 Example: `D003920`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mesh-api/v1/descriptor?id=D003920"
```

**Response:**
```json
{
    "data": {
        "descriptor": {
            "id": "D003920",
            "url": "https://meshb.nlm.nih.gov/record/ui?ui=D003920",
            "name": "Diabetes Mellitus",
            "terms": [
                "Diabetes Mellitus"
            ],
            "see_also": [
                {
                    "id": "D003919",
                    "label": "Diabetes Insipidus"
                },
                {
                    "id": "D003927",
                    "label": "Diet, Diabetic"
                },
                {
                    "id": "D018589",
                    "label": "Gastroparesis"
                },
                {
                    "id": "D018149",
                    "label": "Glucose Intolerance"
                },
                {
                    "id": "D017127",
                    "label": "Glycation End Products, Advanced"
                },
                {
                    "id": "D011236",
                    "label": "Prediabetic State"
                },
                {
                    "id": "D012592",
                    "label": "Scleredema Adultorum"
                }
            ],
            "qualifiers": [
                {
                    "id": "Q000097",
                    "label": "blood"
                },
                {
                    "id": "Q000134",
                    "label": "cerebrospinal fluid"
                },
                {
                    "id": "Q000139",
             
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search MeSH descriptors by name

**Parameters:**
- `q` (query, required, string) — Search text, e.g. diabetes Example: `diabetes`
- `match` (query, optional, string) — exact, contains or startswith Example: `contains`
- `limit` (query, optional, string) — Max results (1-100)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mesh-api/v1/search?q=diabetes&match=contains"
```

**Response:**
```json
{
    "data": {
        "count": 12,
        "match": "contains",
        "query": "diabetes",
        "descriptors": [
            {
                "id": "D048909",
                "label": "Diabetes Complications"
            },
            {
                "id": "D003919",
                "label": "Diabetes Insipidus"
            },
            {
                "id": "D018500",
                "label": "Diabetes Insipidus, Nephrogenic"
            },
            {
                "id": "D020790",
                "label": "Diabetes Insipidus, Neurogenic"
            },
            {
                "id": "D003920",
                "label": "Diabetes Mellitus"
            },
            {
                "id": "D003921",
                "label": "Diabetes Mellitus, Experimental"
            },
            {
                "id": "D003923",
                "label": "Diabetes Mellitus, Lipoatrophic"
            },
            {
                "id": "D003922",
                "label": "Diabetes Mellitus, Type 1"
            },
            {
                "id": "D003924",
                "label": "Diabetes Mellitus, Type 2"
            },
            {
                "id": "D016640",
                "label": "Diabetes, Gestational"
            },
            {
                "id": "D000071698",
                "label": "Latent Autoimmune Diabetes in Adults"
            },
            {
                "id": "D054586",
                "label": "National Institute of Diabe
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/term` — Resolve a synonym to descriptor(s)

**Parameters:**
- `q` (query, required, string) — Term/synonym, e.g. heart attack Example: `heart attack`
- `match` (query, optional, string) — exact, contains or startswith

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mesh-api/v1/term?q=heart+attack"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "match": "contains",
        "query": "heart attack",
        "terms": [
            {
                "term": "Heart Attack",
                "resource": "T000866941"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:44.643Z",
        "request_id": "5caca00f-a43d-4c1b-a782-fb6dfc1e788c"
    },
    "status": "ok",
    "message": "Terms retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/mesh-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "MeSH (Medical Subject Headings) is the U.S. National Library of Medicine's authoritative controlled vocabulary used to index biomedical literature in PubMed — covering diseases, anatomy, chemicals & drugs, organisms, psychology, techniques and more. /v1/search?q=diabetes = search MeSH descriptors by preferred name (match=contains|exact|startswith), returning each descriptor's stable id (e.g. D003920) and label; /v1/term?q=heart attack = resolve a lay term or synonym to the MeSH descriptor(s) it maps to (so 'heart attack' → Myocardial Infarction); /v1/descriptor?id=D003920 = a descriptor's full record — its preferred name, all entry terms (synonyms), the allowable qualifiers/subheadings (e.g. drug therapy, diagnosis, epidemiology) and see-also references, plus a link to the MeSH browser. Ideal for biomedical NLP and text mining, literature tagging and search, clinical and research tooling, and ontology mapping. Data from NLM MeSH (public domain). For drug-specific nomenclature see the RxNorm API.",
        "source": "MeSH — Medical Subject Headings, U.S. National Library of Medicine (id.nlm.nih.gov/mesh)",
        "endpoints": [
            "/v1/search",
            "/v1/term",
            "/v1/descriptor",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:44.727Z",
        "request_id": "271a84c1-19e3-4685-8498-49f3a281dd66"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "succ
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/mesh-api
OpenAPI spec: https://www.oanor.com/api/mesh-api/openapi.json
