# OLS Ontology API
> The EMBL-EBI Ontology Lookup Service (OLS) as an API — a single access point to more than 280 biomedical and scientific ontologies and controlled vocabularies in one place: the Gene Ontology (GO), the Human Disease Ontology (DOID), the Human Phenotype Ontology (HP), ChEBI (chemical entities), Uberon (anatomy), the Experimental Factor Ontology (EFO), Mondo, NCIt and many more. /v1/search?q=diabetes searches terms across all ontologies (or restrict to one with ontology=doid), returning each match's label, OBO id (such as DOID:9351 or GO:0008150), ontology, IRI and a short definition. /v1/term?ontology=doid&id=DOID:9351 returns a single term's detail — its label, definition, IRI, synonyms and whether it is obsolete. /v1/ontologies browses the available ontologies with their id, title, description and number of terms. OBO ids look like DOID:9351, GO:0008150, HP:0000118 or CHEBI:15377. Ideal for biomedical natural-language processing, data annotation and harmonisation, autocomplete over scientific terminology, and semantic and knowledge-graph tooling. Data from EMBL-EBI OLS (open). This is a general ontology / controlled-vocabulary lookup spanning many domains — broader than a single medical thesaurus such as MeSH.

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

## Pricing
- **Free** (Free) — 2,700 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 52,000 calls/Mo, 5 req/s
- **Pro** ($22/Mo) — 222,000 calls/Mo, 12 req/s
- **Mega** ($59/Mo) — 800,000 calls/Mo, 35 req/s

## Endpoints

### Ontology

#### `GET /v1/ontologies` — Browse available ontologies

**Parameters:**
- `limit` (query, optional, string) — Max results (1-300)

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

**Response:**
```json
{
    "data": {
        "count": 50,
        "total": 280,
        "ontologies": [
            {
                "id": "addicto",
                "terms": 1363,
                "title": "Addiction Ontology",
                "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)",
                "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",
                "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",
                "description": "Allotrope Merged Ontology Suite"
            },
            {
                "id": "afpo",
                "terms": 473,
                "title": "African Population Ontology",
                "description": "AfPO i
…(truncated, see openapi.json for full schema)
```

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

**Parameters:**
- `q` (query, required, string) — Search text, e.g. diabetes Example: `diabetes`
- `ontology` (query, optional, string) — Restrict to one ontology, e.g. doid
- `limit` (query, optional, string) — Max results (1-100)

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

**Response:**
```json
{
    "data": {
        "count": 20,
        "query": "diabetes",
        "terms": [
            {
                "iri": "http://purl.obolibrary.org/obo/DOID_9351",
                "label": "diabetes mellitus",
                "obo_id": "DOID:9351",
                "ontology": "doid",
                "description": "A glucose metabolism disease that is characterized by chronic hyperglycaemia with disturbances of carbohydrate, fat and protein metabolism resulting from defects in insulin secretion, insulin action, or both."
            },
            {
                "iri": "http://purl.obolibrary.org/obo/NCIT_C2985",
                "label": "Diabetes Mellitus",
                "obo_id": "NCIT:C2985",
                "ontology": "ncit",
                "description": "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/NCIT_C212592",
                "label": "Diabetes Service Type",
                "obo_id": "NCIT:C212592",
                "ontology": "ncit",
                "description": "The service type that is associated with the Health Level 7 Fast Healthcare Interoperability Resources Diabetes code."
            },
            {
                "iri": "http://purl.obolibrary.org/obo/MONDO_0005015",
                "label": "diabetes mellitus",
                "obo_id": "MONDO:0005015",

…(truncated, see openapi.json for full schema)
```

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

**Parameters:**
- `ontology` (query, required, string) — Ontology id, e.g. doid Example: `doid`
- `id` (query, required, string) — OBO id, e.g. DOID:9351 Example: `DOID:9351`

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

**Response:**
```json
{
    "data": {
        "term": {
            "iri": "http://purl.obolibrary.org/obo/DOID_9351",
            "url": "https://www.ebi.ac.uk/ols4/ontologies/doid/classes/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FDOID_9351",
            "label": "diabetes mellitus",
            "obo_id": "DOID:9351",
            "ontology": "doid",
            "synonyms": [
                "diabetes"
            ],
            "description": "A glucose metabolism disease that is characterized by chronic hyperglycaemia with disturbances of carbohydrate, fat and protein metabolism resulting from defects in insulin secretion, insulin action, or both.",
            "is_obsolete": false
        }
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:33.417Z",
        "request_id": "27d24b6d-1d56-45f5-9cd2-9ddaee78a08d"
    },
    "status": "ok",
    "message": "Term retrieved",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "OLS (EMBL-EBI Ontology Lookup Service) is a single access point to 280+ biomedical and scientific ontologies — the Gene Ontology (GO), Human Disease Ontology (DOID), Human Phenotype Ontology (HP), ChEBI (chemicals), Uberon (anatomy), EFO, Mondo, NCIT and many more. /v1/search?q=diabetes = search terms across all ontologies (or restrict with ontology=doid), returning each match's label, OBO id (e.g. DOID:9351), ontology, IRI and a short definition; /v1/term?ontology=doid&id=DOID:9351 = a single term's detail — label, definition, IRI, synonyms and obsolete flag; /v1/ontologies = browse the available ontologies with their id, title, description and term count. OBO ids look like DOID:9351, GO:0008150, HP:0000118, CHEBI:15377. Data from EMBL-EBI OLS (open). A general ontology/controlled-vocabulary lookup across many domains — broader than a single medical thesaurus (e.g. MeSH). Ideal for biomedical NLP, data annotation and harmonisation, and semantic tooling.",
        "source": "EMBL-EBI Ontology Lookup Service (OLS4) — ebi.ac.uk/ols4",
        "endpoints": [
            "/v1/search",
            "/v1/term",
            "/v1/ontologies",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:33.501Z",
        "request_id": "c2904bba-e4ec-4190-ad7f-4ea1b5e52675"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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