ancestors: Get all ancestors of a term

API: ac.uk:embl-ebi-ontology-lookup-service-ols-api
Endpoint: /ontologies/{ontologyId}/terms/{iri}/ancestors
Response format: text/html
Charset: utf-8
Auth: none
Method: GET
Last Status: 400
Latency: 2065ms

Description

Returns a paginated list of all ancestor terms (transitive superclasses) of a specific term.

Parameters (2)

iri (string, path, required)

URL-encoded IRI of the term

ontologyId (string, path, required)

The ontology ID

Examples (3)

Get ancestors of a GO biological process term curl
curl 'https://www.ebi.ac.uk/ols4/api/ontologies/go/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FGO_0008150/ancestors' \
  -H 'Accept: application/json' \
  -d '"<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>"'
import requests

resp = requests.get(
    "https://www.ebi.ac.uk/ols4/api/ontologies/go/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FGO_0008150/ancestors",
    headers={
        'Accept': 'application/json',
    },
    json="<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>",
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("embl-ebi-ontology-lookup-service-ols")
result = api.fetch("ontologies/{ontologyId}/terms/{iri}/ancestors")

for item in result:
    print(item)
const body = "<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>";

const resp = await fetch("https://www.ebi.ac.uk/ols4/api/ontologies/go/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FGO_0008150/ancestors", {
  headers: {
    "Accept": "application/json",
  },
  body: JSON.stringify(body),
});
const data = await resp.json();
Get ancestors of a Human Phenotype Ontology term curl
curl 'https://www.ebi.ac.uk/ols4/api/ontologies/hp/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FHP_0000118/ancestors' \
  -H 'Accept: application/json' \
  -d '"<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>"'
import requests

resp = requests.get(
    "https://www.ebi.ac.uk/ols4/api/ontologies/hp/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FHP_0000118/ancestors",
    headers={
        'Accept': 'application/json',
    },
    json="<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>",
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("embl-ebi-ontology-lookup-service-ols")
result = api.fetch("ontologies/{ontologyId}/terms/{iri}/ancestors")

for item in result:
    print(item)
const body = "<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>";

const resp = await fetch("https://www.ebi.ac.uk/ols4/api/ontologies/hp/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FHP_0000118/ancestors", {
  headers: {
    "Accept": "application/json",
  },
  body: JSON.stringify(body),
});
const data = await resp.json();
Get ancestors of a MONDO disease term curl
curl 'https://www.ebi.ac.uk/ols4/api/ontologies/mondo/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMONDO_0000001/ancestors' \
  -H 'Accept: application/json' \
  -d '"<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>"'
import requests

resp = requests.get(
    "https://www.ebi.ac.uk/ols4/api/ontologies/mondo/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMONDO_0000001/ancestors",
    headers={
        'Accept': 'application/json',
    },
    json="<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>",
)
data = resp.json()
import zingu_apis

api = zingu_apis.api("embl-ebi-ontology-lookup-service-ols")
result = api.fetch("ontologies/{ontologyId}/terms/{iri}/ancestors")

for item in result:
    print(item)
const body = "<!doctype html><html lang=\"en\"><head><title>HTTP Status 400 – Bad Request</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>";

const resp = await fetch("https://www.ebi.ac.uk/ols4/api/ontologies/mondo/terms/http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FMONDO_0000001/ancestors", {
  headers: {
    "Accept": "application/json",
  },
  body: JSON.stringify(body),
});
const data = await resp.json();

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-04-16 17:08:58.737720 400 2065ms
2026-04-16 03:29:32.856853 400 275ms
2026-04-16 02:17:11.820745 400 222ms
2026-04-16 01:23:53.718990 400 278ms
2026-04-15 02:39:40.196390 400 244ms
2026-04-15 02:35:31.600218 400 212ms
2026-04-15 02:06:29.200264 400 240ms
2026-04-14 03:57:40.653463 400 271ms
2026-04-14 03:47:29.847190 400 276ms
2026-04-14 01:10:31.167301 400 232ms
2026-04-12 14:37:37.322568 400 193ms
2026-04-12 14:24:22.842268 400 188ms
2026-04-12 12:42:25.671955 400 185ms
2026-04-10 03:20:12.597024 400 160ms
2026-04-10 02:51:24.793183 400 122ms
2026-04-10 01:05:57.278284 400 123ms
2026-04-09 03:31:24.982781 400 212ms
2026-04-09 02:21:09.719057 400 388ms
2026-04-09 02:17:35.909670 400 199ms
2026-04-08 07:08:21.770301 400 199ms
2026-04-08 00:30:14.921903 400 198ms
2026-04-08 00:23:20.935506 400 206ms
2026-04-07 00:56:19.271095 400 214ms
2026-04-07 00:51:47.893200 400 203ms
2026-04-07 00:16:58.774333 400 210ms
2026-04-06 06:56:07.727901 400 233ms
2026-04-06 06:53:11.519890 400 263ms
2026-04-06 00:36:19.121189 400 300ms
2026-04-05 14:55:37.188701 400 312ms
2026-04-05 14:15:08.043784 400 344ms
2026-03-23 09:49:54.350409 400 145ms
2026-03-23 09:27:39.444974 400 143ms
2026-03-23 09:23:39.955196 400 157ms