# KEGG API
> The KEGG molecular database as an API, powered by the official KEGG REST service. KEGG (the Kyoto Encyclopedia of Genes and Genomes) links genomes, chemistry and disease. Fetch any KEGG entry parsed to JSON — a metabolic compound, KEGG Orthology group (KO), enzyme (EC number), reaction, module, drug, disease, glycan, gene or pathway map; search any KEGG database by name; list a database's entries; cross-link entries between databases (a gene to its pathways, a pathway to its compounds, an enzyme to its reactions); and convert KEGG identifiers to and from outside namespaces (NCBI Gene/Protein, UniProt, ChEBI, PubChem). Ideal for systems-biology and metabolomics pipelines, enzyme and orthology mapping, drug and disease research, gene-to-pathway annotation and bioinformatics id conversion. KEGG ids are letter-prefixed (C compound, K orthology, D drug, H disease, M module, R reaction, G glycan) or organism-coded (hsa human, eco E. coli).

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

## Pricing
- **Free** (Free) — 500 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 18,800 calls/Mo, 6 req/s
- **Pro** ($22/Mo) — 87,500 calls/Mo, 15 req/s
- **Mega** ($59/Mo) — 338,000 calls/Mo, 40 req/s

## Endpoints

### Entries

#### `GET /v1/find` — Search a KEGG database

**Parameters:**
- `database` (query, required, string) — compound|ko|enzyme|reaction|module|drug|disease|… Example: `compound`
- `query` (query, required, string) — Search text, e.g. glucose Example: `glucose`
- `limit` (query, optional, string) — Max results (1-200)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kegg-api/v1/find?database=compound&query=glucose"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "query": "glucose",
        "total": 113,
        "results": [
            {
                "id": "C00029",
                "description": "UDP-glucose; UDPglucose; UDP-D-glucose; Uridine diphosphate glucose; UDP-alpha-D-glucose"
            },
            {
                "id": "C00031",
                "description": "D-Glucose; Grape sugar; Dextrose; Glucose; D-Glucopyranose"
            },
            {
                "id": "C00092",
                "description": "D-Glucose 6-phosphate; Glucose 6-phosphate; Robison ester"
            },
            {
                "id": "C00103",
                "description": "D-Glucose 1-phosphate; alpha-D-Glucose 1-phosphate; Cori ester; D-Glucose alpha-1-phosphate"
            },
            {
                "id": "C00140",
                "description": "N-Acetyl-D-glucosamine; N-Acetylchitosamine; 2-Acetamido-2-deoxy-D-glucose; GlcNAc"
            },
            {
                "id": "C00221",
                "description": "beta-D-Glucose; beta-D-Glucopyranose"
            },
            {
                "id": "C00267",
                "description": "alpha-D-Glucose"
            },
            {
                "id": "C00329",
                "description": "D-Glucosamine; Chitosamine; 2-Amino-2-deoxy-D-glucose"
            },
            {
                "id": "C00394",
                "description": "GDP-glucose; GDP-D-glucose; GDP-alpha-D-glucose"
            },
          
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/get` — Fetch any KEGG entry

**Parameters:**
- `id` (query, required, string) — KEGG id, e.g. C00031, K00844, ec:2.7.1.1 Example: `C00031`

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

**Response:**
```json
{
    "data": {
        "entry": {
            "id": "C00031",
            "type": "Compound",
            "names": [
                "D-Glucose",
                "Grape sugar",
                "Dextrose",
                "Glucose",
                "D-Glucopyranose"
            ],
            "other": {
                "enzyme": [
                    "1.1.1.118       1.1.1.119       1.1.1.121       1.1.1.359",
                    "1.1.1.360       1.1.1.432       1.1.3.10        1.1.5.2",
                    "1.1.5.9         1.1.99.28       1.1.99.35       2.3.1.72",
                    "2.3.1.90        2.3.1.91        2.3.1.92        2.3.1.103",
                    "2.3.1.143       2.3.1.152       2.3.1.-         2.4.1.8",
                    "2.4.1.9         2.4.1.10        2.4.1.20        2.4.1.22",
                    "2.4.1.25        2.4.1.31        2.4.1.64        2.4.1.99",
                    "2.4.1.230       2.4.1.245       2.4.1.279       2.4.1.281",
                    "2.4.1.400       2.7.1.1         2.7.1.2         2.7.1.41",
                    "2.7.1.42        2.7.1.61        2.7.1.62        2.7.1.63",
                    "2.7.1.142       2.7.1.147       2.7.1.199       3.1.1.33",
                    "3.1.3.9         3.1.3.10        3.1.3.58        3.1.4.48",
                    "3.1.6.3         3.2.1.3         3.2.1.10        3.2.1.20",
                    "3.2.1.21        3.2.1.22        3.2.1.23        3.2.1.26",
                    "3.2.1.28        3.2.1.39 
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/list` — List a database's entries

**Parameters:**
- `database` (query, required, string) — e.g. module, ko, enzyme Example: `module`
- `limit` (query, optional, string) — Max (1-1000)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kegg-api/v1/list?database=module"
```

**Response:**
```json
{
    "data": {
        "count": 100,
        "total": 573,
        "entries": [
            {
                "id": "M00001",
                "name": "Glycolysis (Embden-Meyerhof pathway), glucose => pyruvate"
            },
            {
                "id": "M00002",
                "name": "Glycolysis, core module involving three-carbon compounds"
            },
            {
                "id": "M00003",
                "name": "Gluconeogenesis, oxaloacetate => fructose-6P"
            },
            {
                "id": "M00004",
                "name": "Pentose phosphate pathway (Pentose phosphate cycle)"
            },
            {
                "id": "M00005",
                "name": "PRPP biosynthesis, ribose-5P => PRPP"
            },
            {
                "id": "M00006",
                "name": "Pentose phosphate pathway, oxidative phase, glucose-6P => ribulose-5P"
            },
            {
                "id": "M00007",
                "name": "Pentose phosphate pathway, non-oxidative phase, fructose-6P => ribose-5P"
            },
            {
                "id": "M00008",
                "name": "Entner-Doudoroff pathway, glucose-6P => glyceraldehyde-3P + pyruvate"
            },
            {
                "id": "M00009",
                "name": "Citrate cycle (TCA cycle, Krebs cycle)"
            },
            {
                "id": "M00010",
                "name": "Citrate cycle, first carbon oxidation, oxaloacetate => 2-oxogluta
…(truncated, see openapi.json for full schema)
```

### Mapping

#### `GET /v1/conv` — Convert ids to outside namespaces

**Parameters:**
- `target` (query, required, string) — e.g. ncbi-geneid, uniprot Example: `ncbi-geneid`
- `source` (query, required, string) — e.g. hsa:10458 Example: `hsa:10458`
- `limit` (query, optional, string) — Max (1-1000)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kegg-api/v1/conv?target=ncbi-geneid&source=hsa%3A10458"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "total": 1,
        "source": "hsa:10458",
        "target": "ncbi-geneid",
        "conversions": [
            {
                "to": "ncbi-geneid:10458",
                "from": "hsa:10458"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:53.056Z",
        "request_id": "2730eaa8-92e6-434c-958d-0200826cc58d"
    },
    "status": "ok",
    "message": "Conversions retrieved",
    "success": true
}
```

#### `GET /v1/link` — Cross-reference between databases

**Parameters:**
- `target` (query, required, string) — Target db/entry, e.g. pathway Example: `pathway`
- `source` (query, required, string) — Source db/entry, e.g. hsa:10458 Example: `hsa:10458`
- `limit` (query, optional, string) — Max (1-1000)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kegg-api/v1/link?target=pathway&source=hsa%3A10458"
```

**Response:**
```json
{
    "data": {
        "count": 5,
        "links": [
            {
                "source": "hsa:10458",
                "target": "path:hsa04517"
            },
            {
                "source": "hsa:10458",
                "target": "path:hsa04520"
            },
            {
                "source": "hsa:10458",
                "target": "path:hsa04810"
            },
            {
                "source": "hsa:10458",
                "target": "path:hsa05130"
            },
            {
                "source": "hsa:10458",
                "target": "path:hsa05135"
            }
        ],
        "total": 5,
        "source": "hsa:10458",
        "target": "pathway"
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:53.490Z",
        "request_id": "b14287ea-1721-4db3-962e-f4de29b1880b"
    },
    "status": "ok",
    "message": "Links retrieved",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "The KEGG molecular database. /v1/get?id=C00031 = fetch any KEGG entry parsed to JSON — a compound (C…), KEGG Orthology (K…), enzyme (ec:…), reaction (R…), module (M…), drug (D…), disease (H…), glycan (G…), gene (hsa:…) or pathway (hsa00010); /v1/find?database=compound&query=glucose = search a KEGG database by name (databases: compound, ko, enzyme, reaction, module, drug, disease, glycan, pathway, …); /v1/list?database=module = list a database's entries; /v1/link?target=pathway&source=hsa:10458 = cross-reference entries between databases (e.g. a gene's pathways, a pathway's compounds); /v1/conv?target=ncbi-geneid&source=hsa:10458 = convert KEGG ids to outside namespaces (ncbi-geneid, ncbi-proteinid, uniprot, chebi, pubchem). KEGG ids are letter-prefixed (C/K/D/H/M/R/G) or organism-coded (hsa, eco). Data from KEGG; for academic use see KEGG's terms. For curated pathways see the Reactome API; for drug terminology the RxNorm API.",
        "source": "KEGG REST API (rest.kegg.jp)",
        "endpoints": [
            "/v1/get",
            "/v1/find",
            "/v1/list",
            "/v1/link",
            "/v1/conv",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:53.561Z",
        "request_id": "b363bcca-cb09-46c4-a563-ccd7d253840a"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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