# Ontology API
> Biomedical ontologies as an API, powered by the EBI Ontology Lookup Service (OLS). Search across 280+ curated ontologies — diseases (MONDO), human phenotypes (HP), the Gene Ontology (GO), anatomy (UBERON), cell types (CL), chemistry (ChEBI), experimental factors (EFO), the NCI Thesaurus and many more — to find terms by name; browse the full ontology catalogue with versions and term counts; read any term for its definition, exact synonyms, OBO id, IRI and obsolete status; and walk the class hierarchy through a term's direct parents and children. Ideal for clinical-data harmonisation and coding, biomedical search and autocomplete, knowledge-graph enrichment, annotation and curation pipelines, and research and EHR applications that need standard vocabularies. OBO ids look like MONDO:0005148 or GO:0008150.

## 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/ontology-api/..."
```

## Pricing
- **Free** (Free) — 700 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 22,000 calls/Mo, 8 req/s
- **Pro** ($21/Mo) — 95,000 calls/Mo, 20 req/s
- **Mega** ($58/Mo) — 360,000 calls/Mo, 50 req/s

## Endpoints

### Terms

#### `GET /v1/search` — Search terms across ontologies

**Parameters:**
- `query` (query, required, string) — Search text, e.g. diabetes Example: `diabetes`
- `ontology` (query, optional, string) — Restrict to an ontology, e.g. mondo Example: `mondo`
- `exact` (query, optional, string) — true = exact match only
- `limit` (query, optional, string) — Max results (1-100)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ontology-api/v1/search?query=diabetes&ontology=mondo"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "query": "diabetes",
        "total": 257,
        "results": [
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0005015",
                "type": "class",
                "label": "diabetes mellitus",
                "obo_id": "MONDO:0005015",
                "ontology": "mondo",
                "definition": "A metabolic disorder characterized by abnormally high blood sugar levels due to diminished production of insulin or insulin resistance/desensitization."
            },
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0004782",
                "type": "class",
                "label": "diabetes insipidus",
                "obo_id": "MONDO:0004782",
                "ontology": "mondo",
                "definition": "A disorder characterized by excretion of large amounts of urine, accompanied by excessive thirst. Causes include deficiency of antidiuretic hormone or failure of the kidneys to respond to antidiuretic hormone. It may also be drug-related."
            },
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0005406",
                "type": "class",
                "label": "gestational diabetes",
                "obo_id": "MONDO:0005406",
                "ontology": "mondo",
                "definition": "Carbohydrate intolerance first diagnosed during pregnancy."
            },
            {
                "iri": "http://purl.obolibrary.org
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/term` — A single term

**Parameters:**
- `ontology` (query, required, string) — Ontology id, e.g. mondo Example: `mondo`
- `id` (query, required, string) — OBO id, e.g. MONDO:0005148 Example: `MONDO:0005148`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ontology-api/v1/term?ontology=mondo&id=MONDO%3A0005148"
```

**Response:**
```json
{
    "data": {
        "term": {
            "iri": "http://purl.obolibrary.org/obo/MONDO_0005148",
            "label": "type 2 diabetes mellitus",
            "obo_id": "MONDO:0005148",
            "ontology": "mondo",
            "synonyms": [
                "diabetes mellitis type 2",
                "diabetes mellitis type II",
                "diabetes mellitus, noninsulin-dependent, 2",
                "diabetes mellitus, noninsulin-dependent, association with",
                "diabetes mellitus, noninsulin-dependent, late onset",
                "diabetes mellitus, type II",
                "insulin resistance, severe, digenic",
                "NIDDM",
                "T2D",
                "T2DM - type 2 diabetes mellitus",
                "T2DM",
                "adult onset diabetes",
                "adult-onset diabetes",
                "diabetes mellitus, noninsulin-dependent",
                "diabetes mellitus, type 2",
                "diabetes, type 2",
                "non-insulin dependent diabetes mellitus",
                "non-insulin dependent diabetes",
                "noninsulin dependent diabetes",
                "noninsulin-dependent diabetes mellitus",
                "type 2 diabetes mellitus non-insulin dependent",
                "type 2 diabetes mellitus",
                "type 2 diabetes",
                "type II diabetes mellitus",
                "type II diabetes"
            ],
            "definition": "A type of diabetes mellitu
…(truncated, see openapi.json for full schema)
```

### Ontologies

#### `GET /v1/ontologies` — The ontology catalogue

**Parameters:**
- `page` (query, optional, string) — Page (0-based)
- `size` (query, optional, string) — Page size (1-100)

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

**Response:**
```json
{
    "data": {
        "page": 0,
        "size": 25,
        "count": 25,
        "total": 280,
        "ontologies": [
            {
                "id": "addicto",
                "terms": 1363,
                "title": "Addiction Ontology",
                "status": "LOADED",
                "version": null,
                "description": "The Addiction Ontology (AddictO) is an ontology being developed all aspects of addiction research."
            },
            {
                "id": "ado",
                "terms": 1963,
                "title": "Alzheimer's Disease Ontology (ADO)",
                "status": "LOADED",
                "version": "2.0.1",
                "description": "Alzheimer's Disease Ontology is a knowledge-based ontology that encompasses varieties of concepts related to Alzheimer'S Disease, foundamentally structured by upper level Basic Formal Ontology(BFO). This Ontology is enriched by the interrelational entities that demonstrate the nextwork of the unders"
            },
            {
                "id": "aeo",
                "terms": 430,
                "title": "Anatomical Entity Ontology",
                "status": "LOADED",
                "version": null,
                "description": "AEO is an ontology of anatomical structures that expands CARO, the Common Anatomy Reference Ontology"
            },
            {
                "id": "afo",
                "terms": 3516,
                "title": "Allotrope Merged Ontology Suite",
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/ontology` — One ontology's metadata

**Parameters:**
- `id` (query, required, string) — Ontology id, e.g. mondo Example: `mondo`

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

**Response:**
```json
{
    "data": {
        "ontology": {
            "id": "mondo",
            "terms": 58940,
            "title": "Mondo Disease Ontology",
            "status": "LOADED",
            "updated": "2026-05-22T00:09:23.011074083",
            "version": "2026-05-05",
            "homepage": "https://monarch-initiative.github.io/mondo",
            "properties": 493,
            "description": "A semi-automatically constructed ontology that merges in multiple disease resources to yield a coherent merged ontology.",
            "individuals": 18,
            "mailing_list": "https://groups.google.com/group/mondo-users"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:00.676Z",
        "request_id": "66530b43-7bfa-4870-a01a-9e23346d72b2"
    },
    "status": "ok",
    "message": "Ontology retrieved",
    "success": true
}
```

### Hierarchy

#### `GET /v1/children` — A term's direct children

**Parameters:**
- `ontology` (query, required, string) — Ontology id Example: `mondo`
- `id` (query, required, string) — OBO id Example: `MONDO:0005148`
- `limit` (query, optional, string) — Max (1-500)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ontology-api/v1/children?ontology=mondo&id=MONDO%3A0005148"
```

**Response:**
```json
{
    "data": {
        "term": "MONDO:0005148",
        "count": 6,
        "children": [
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0014488",
                "label": "diabetes mellitus, noninsulin-dependent, 5",
                "obo_id": "MONDO:0014488",
                "ontology": "mondo",
                "synonyms": [
                    "diabetes mellitus, noninsulin-dependent, type 5",
                    "NIDDM5",
                    "TBC1D4 type 2 diabetes mellitus",
                    "diabetes mellitus, noninsulin-dependent, 5",
                    "type 2 diabetes mellitus caused by mutation in TBC1D4"
                ],
                "definition": "Any type 2 diabetes mellitus in which the cause of the disease is a mutation in the TBC1D4 gene.",
                "is_obsolete": false,
                "has_children": false,
                "term_replaced_by": null
            },
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0011955",
                "label": "diabetes mellitus, noninsulin-dependent, 4",
                "obo_id": "MONDO:0011955",
                "ontology": "mondo",
                "synonyms": [
                    "diabetes mellitus, noninsulin-dependent, type 4",
                    "diabetes mellitus, noninsulin-dependent, 4"
                ],
                "definition": [],
                "is_obsolete": false,
                "has_children": false,
                "term_replaced_
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/parents` — A term's direct parents

**Parameters:**
- `ontology` (query, required, string) — Ontology id Example: `mondo`
- `id` (query, required, string) — OBO id Example: `MONDO:0005148`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ontology-api/v1/parents?ontology=mondo&id=MONDO%3A0005148"
```

**Response:**
```json
{
    "data": {
        "term": "MONDO:0005148",
        "count": 1,
        "parents": [
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0005015",
                "label": "diabetes mellitus",
                "obo_id": "MONDO:0005015",
                "ontology": "mondo",
                "synonyms": [
                    "DM",
                    "diabetes mellitus (disease)",
                    "diabetes mellitus",
                    "diabetes"
                ],
                "definition": "A metabolic disorder characterized by abnormally high blood sugar levels due to diminished production of insulin or insulin resistance/desensitization.",
                "is_obsolete": false,
                "has_children": true,
                "term_replaced_by": null
            }
        ],
        "ontology": "mondo"
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:01.070Z",
        "request_id": "7c623250-500c-44b3-87ee-8d20c0f149dd"
    },
    "status": "ok",
    "message": "Parents retrieved",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "Biomedical ontologies. /v1/search?query=diabetes (filter ontology=mondo, exact=true) = search terms across 280+ ontologies, returning each term's OBO id, label, ontology & definition; /v1/ontologies = the ontology catalogue (paginate page & size); /v1/ontology?id=mondo = one ontology's metadata (title, version, term count, homepage); /v1/term?ontology=mondo&id=MONDO:0005148 = a term's label, definition, synonyms, IRI & obsolete flag; /v1/parents?ontology=mondo&id=MONDO:0005148 = its direct parent terms; /v1/children?ontology=mondo&id=MONDO:0005148 = its direct child terms. Common ontologies: mondo (diseases), hp (phenotypes), go (gene ontology), uberon (anatomy), cl (cell types), chebi (chemistry), efo, ncit. OBO ids look like MONDO:0005148 or GO:0008150. Data via EBI OLS.",
        "source": "EBI Ontology Lookup Service — OLS4 (ebi.ac.uk/ols4)",
        "endpoints": [
            "/v1/search",
            "/v1/ontologies",
            "/v1/ontology",
            "/v1/term",
            "/v1/parents",
            "/v1/children",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T08:14:01.144Z",
        "request_id": "b1d7fd83-a59e-4c78-9f0c-d0c5f4df467f"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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