Skill Tracer
Skills › Scientific Agent Skills › database-lookup › chebi.md

chebi.md

108 lines · skills/database-lookup/references/chebi.md at 5f2bc03

Open on GitHub
1# ChEBI (Chemical Entities of Biological Interest) API Reference
2

ChEBI (Chemical Entities of Biological Interest) API Reference

Raw lines 1 to 2
3## Base URLs
4- **OLS (Ontology Lookup Service) API**: `https://www.ebi.ac.uk/ols4/api`
5- **ChEBI REST API**: `https://www.ebi.ac.uk/chebi/backend/api/public`
6

Base URLs

  • OLS (Ontology Lookup Service) API: https://www.ebi.ac.uk/ols4/api
  • ChEBI REST API: https://www.ebi.ac.uk/chebi/backend/api/public
Raw lines 3 to 6
7## Authentication
8None required. All endpoints are public.
9

Authentication

None required. All endpoints are public.

Raw lines 7 to 9
10## Rate Limits
11No published hard limits. EBI general guidance: reasonable usage.

Rate Limits

No published hard limits. EBI general guidance: reasonable usage.

Raw lines 10 to 12
13## Important Note
14ChEBI 2.0 replaced the deprecated SOAP service with a public REST API. Use ChEBI REST for chemical records and structure searches; OLS4 remains useful for ontology traversal.
16---

Important Note

ChEBI 2.0 replaced the deprecated SOAP service with a public REST API. Use ChEBI REST for chemical records and structure searches; OLS4 remains useful for ontology traversal.


Raw lines 13 to 17
18## OLS4 API Endpoints (Recommended for REST/JSON)

OLS4 API Endpoints (Recommended for REST/JSON)

Raw lines 18 to 19
20### 1. Search ChEBI Terms
21```
22GET https://www.ebi.ac.uk/ols4/api/search?q={query}&ontology=chebi
23```
24Example:
25```
26GET https://www.ebi.ac.uk/ols4/api/search?q=aspirin&ontology=chebi
27```
28Returns JSON with matching ChEBI terms, IDs, definitions, synonyms.

1. Search ChEBI Terms

GET https://www.ebi.ac.uk/ols4/api/search?q={query}&ontology=chebi

Example:

GET https://www.ebi.ac.uk/ols4/api/search?q=aspirin&ontology=chebi

Returns JSON with matching ChEBI terms, IDs, definitions, synonyms.

Raw lines 20 to 29
30### 2. Lookup by ChEBI ID
31```
32GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_{id}
33```
34Example:
35```
36GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_15365
37```
38Returns full term details: name, definition, synonyms, xrefs, relationships.

2. Lookup by ChEBI ID

GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_{id}

Example:

GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_15365

Returns full term details: name, definition, synonyms, xrefs, relationships.

Raw lines 30 to 39
40### 3. Get Term by Short Form
41```
42GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}
43```
44(Double-encoded IRI in path.)

3. Get Term by Short Form

GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}

(Double-encoded IRI in path.)

Raw lines 40 to 45
46### 4. Term Hierarchy — Parents
47```
48GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}/parents
49```

4. Term Hierarchy — Parents

GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}/parents
Raw lines 46 to 50
51### 5. Term Hierarchy — Children
52```
53GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}/children
54```

5. Term Hierarchy — Children

GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}/children
Raw lines 51 to 55
56### 6. Ontology Metadata
57```
58GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi
59```

6. Ontology Metadata

GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi
Raw lines 56 to 60
61## OLS Search Response Format
62```json
64 "response": {
65 "numFound": 5,
66 "docs": [
67 {
68 "id": "chebi:15365",
69 "iri": "http://purl.obolibrary.org/obo/CHEBI_15365",
70 "label": "aspirin",
71 "description": ["A member of the class of benzoic acids..."],
72 "short_form": "CHEBI_15365",
73 "obo_id": "CHEBI:15365",
74 "ontology_name": "chebi",
75 "type": "class"
76 }
77 ]
78 }
80```

OLS Search Response Format

{
  "response": {
    "numFound": 5,
    "docs": [
      {
        "id": "chebi:15365",
        "iri": "http://purl.obolibrary.org/obo/CHEBI_15365",
        "label": "aspirin",
        "description": ["A member of the class of benzoic acids..."],
        "short_form": "CHEBI_15365",
        "obo_id": "CHEBI:15365",
        "ontology_name": "chebi",
        "type": "class"
      }
    ]
  }
}
Raw lines 61 to 81
82## ChEBI 2.0 REST endpoints
84| GET path (relative to the ChEBI REST base) | Parameters / purpose |
85|---|---|
86| `/compound/{chebi_id}/` | Full entity; numeric ID or `CHEBI:` prefix |
87| `/es_search/` | `term` required; `page=1`, `size=15` defaults |
88| `/ontology/parents/{chebi_id}/` | Ontology parents |
89| `/ontology/children/{chebi_id}/` | Ontology children |
90| `/structure_search/` | `smiles`, `search_type=connectivity|similarity|substructure` |
91| `/molfile/{id}/` | Structure file |
93For similarity search, use `similarity` between 0.4 and 1.0. The default
94`three_star_only=true` limits structure results to three-star entries; explicitly
95set false when two-star entries are also in scope. Search pagination uses `page`
96and `size`. The current schema leaves several response bodies unspecified;
97inspect the returned JSON before choosing field paths, and do not assume OLS's
98`response.docs` envelope applies to ChEBI REST.
100Illustrative request:
102```bash
103curl --fail-with-body --get 'https://www.ebi.ac.uk/chebi/backend/api/public/es_search/' \
104 --data-urlencode 'term=aspirin' --data-urlencode 'page=1' --data-urlencode 'size=5'
105```
107Reviewed 2026-09-30: [ChEBI OpenAPI](https://www.ebi.ac.uk/chebi/backend/api/schema/),
108[ChEBI 2.0 migration](https://www.ebi.ac.uk/about/news/updates-from-data-resources/chebi-2-0-launches/).

ChEBI 2.0 REST endpoints

GET path (relative to the ChEBI REST base)Parameters / purpose
/compound/{chebi_id}/Full entity; numeric ID or CHEBI: prefix
/es_search/term required; page=1, size=15 defaults
/ontology/parents/{chebi_id}/Ontology parents
/ontology/children/{chebi_id}/Ontology children
/structure_search/smiles, `search_type=connectivitysimilaritysubstructure`
/molfile/{id}/Structure file

For similarity search, use similarity between 0.4 and 1.0. The default three_star_only=true limits structure results to three-star entries; explicitly set false when two-star entries are also in scope. Search pagination uses page and size. The current schema leaves several response bodies unspecified; inspect the returned JSON before choosing field paths, and do not assume OLS's response.docs envelope applies to ChEBI REST.

Illustrative request:

curl --fail-with-body --get 'https://www.ebi.ac.uk/chebi/backend/api/public/es_search/' \
  --data-urlencode 'term=aspirin' --data-urlencode 'page=1' --data-urlencode 'size=5'

Reviewed 2026-09-30: ChEBI OpenAPI, ChEBI 2.0 migration.

Raw lines 82 to 108