# Open Tree of Life API
> The tree of life as an API — powered by the Open Tree of Life, the project that unifies published phylogenetic trees and taxonomies into a single synthetic tree spanning about 2.3 million named species. Resolve any scientific name to its canonical taxon and Open Tree Taxonomy (OTT) id (cross-referenced to NCBI, GBIF and other sources); read a taxon's classification and full lineage of ancestors up the tree (genus, family, order, class, …); and compute the most recent common ancestor (MRCA) of any set of species — the heart of comparative biology and "how related are these organisms?" questions. From Homo sapiens and the great apes to any branch of plants, fungi, animals and microbes, it is ideal for biology, evolution, ecology, education and bioinformatics tools. An evolutionary-tree / phylogenetics reference — distinct from species-occurrence data (biodiversity / GBIF), marine taxonomy (WoRMS) and sequence databases. Open data from the Open Tree of Life project (CC0).

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

## Pricing
- **Free** (Free) — 2,600 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 53,000 calls/Mo, 8 req/s
- **Pro** ($23/Mo) — 245,000 calls/Mo, 20 req/s
- **Mega** ($60/Mo) — 870,000 calls/Mo, 50 req/s

## Endpoints

### Tree of Life

#### `GET /v1/match` — Resolve a name to a taxon (OTT id)

**Parameters:**
- `name` (query, optional, string) — A scientific name Example: `Homo sapiens`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/opentol-api/v1/match?name=Homo+sapiens"
```

**Response:**
```json
{
    "data": {
        "match": {
            "url": "https://tree.opentreeoflife.org/taxonomy/browse?id=770315",
            "name": "Homo sapiens",
            "rank": "species",
            "flags": [
                "extinct",
                "sibling_higher"
            ],
            "score": 1,
            "ott_id": 770315,
            "is_synonym": false,
            "tax_sources": [
                "ncbi:9606",
                "gbif:2436436",
                "irmng:11388931",
                "irmng:10857762"
            ],
            "unique_name": "Homo sapiens",
            "matched_name": "Homo sapiens",
            "is_approximate": false,
            "nomenclature_code": "ICZN"
        },
        "query": "Homo sapiens",
        "match_count": 1
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:12.131Z",
        "request_id": "322682d4-72fc-411f-b73b-7b7a173826d2"
    },
    "status": "ok",
    "message": "Name matched",
    "success": true
}
```

#### `GET /v1/mrca` — Most recent common ancestor of 2+ taxa

**Parameters:**
- `ids` (query, optional, string) — Comma-separated OTT ids (2-25) Example: `770315,158484`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/opentol-api/v1/mrca?ids=770315%2C158484"
```

**Response:**
```json
{
    "data": {
        "mrca": {
            "node_id": "mrcaott83926ott84217",
            "num_tips": 19,
            "synth_tree_id": "opentree16.1",
            "is_named_taxon": false,
            "nearest_named_taxon": {
                "url": "https://tree.opentreeoflife.org/taxonomy/browse?id=312031",
                "name": "Homininae",
                "rank": "subfamily",
                "ott_id": 312031
            }
        },
        "input_ott_ids": [
            770315,
            158484
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:12.390Z",
        "request_id": "19d729fd-abe0-4876-a47c-8b0ccace030e"
    },
    "status": "ok",
    "message": "MRCA retrieved",
    "success": true
}
```

#### `GET /v1/taxon` — A taxon: classification & lineage

**Parameters:**
- `id` (query, optional, string) — An OTT id (from /v1/match) Example: `770315`

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

**Response:**
```json
{
    "data": {
        "taxon": {
            "url": "https://tree.opentreeoflife.org/taxonomy/browse?id=770315",
            "name": "Homo sapiens",
            "rank": "species",
            "flags": [
                "extinct",
                "sibling_higher"
            ],
            "ott_id": 770315,
            "lineage": [
                {
                    "name": "Homo",
                    "rank": "genus",
                    "ott_id": 770309
                },
                {
                    "name": "Homininae",
                    "rank": "subfamily",
                    "ott_id": 312031
                },
                {
                    "name": "Hominidae",
                    "rank": "family",
                    "ott_id": 770311
                },
                {
                    "name": "Hominoidea",
                    "rank": "superfamily",
                    "ott_id": 386191
                },
                {
                    "name": "Catarrhini",
                    "rank": "parvorder",
                    "ott_id": 842867
                },
                {
                    "name": "Simiiformes",
                    "rank": "infraorder",
                    "ott_id": 386195
                },
                {
                    "name": "Haplorrhini",
                    "rank": "suborder",
                    "ott_id": 702152
                },
                {
                    "name": "Primates",
                   
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Endpoint catalogue & notes

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

**Response:**
```json
{
    "data": {
        "note": "The Open Tree of Life unifies published phylogenetic trees and taxonomies into one synthetic tree of all life — about 2.3 million named species, each with an Open Tree Taxonomy (OTT) id cross-referenced to NCBI, GBIF and other sources. /v1/match?name=Homo sapiens = resolve a scientific name (or a recognised synonym) to its canonical taxon, returning the OTT id, accepted/unique name, rank, match score, whether it is a synonym/approximate match, and source ids; /v1/taxon?id=770315 = a taxon's classification — name, rank, source ids, synonyms and its full lineage of ancestors (genus, family, order, …) up the tree; /v1/mrca?ids=770315,158484 = the most recent common ancestor of two or more taxa (give OTT ids from /v1/match), returning the MRCA node, the number of descendant tips and the nearest named clade. OTT ids look like 770315 (Homo sapiens); get them from /v1/match. Data from the Open Tree of Life project (CC0). An evolutionary-tree / phylogenetics reference — distinct from species-occurrence (biodiversity/GBIF), marine-taxonomy (WoRMS) and sequence databases. Ideal for biology, evolution, education and bioinformatics tools.",
        "source": "Open Tree of Life (opentreeoflife.org)",
        "endpoints": [
            "/v1/match",
            "/v1/taxon",
            "/v1/mrca",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:12.744Z",
        "request_id": "eed8ab37-3a1a-4bf5-ba34-dba8f
…(truncated, see openapi.json for full schema)
```


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