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

kegg.md

80 lines · skills/database-lookup/references/kegg.md at 5f2bc03

Open on GitHub
1# KEGG REST API
2

KEGG REST API

Raw lines 1 to 2
3## Base URL
4```
5https://rest.kegg.jp
6```
7

Base URL

https://rest.kegg.jp
Raw lines 3 to 7
8## Auth
9No API key required. Free for academic use. Commercial use requires license.

Auth

No API key required. Free for academic use. Commercial use requires license.

Raw lines 8 to 10
11## Important: KEGG returns tab-delimited text and flat-file format, NOT JSON.

Important: KEGG returns tab-delimited text and flat-file format, NOT JSON.

Raw lines 11 to 12
13## Key Operations (URL-path-based, no query parameters)
15| URL Pattern | Description |
16|-------------|-------------|
17| `/list/{database}` | List all entries |
18| `/list/{database}/{organism}` | List entries for organism |
19| `/get/{dbentries}` | Get entry data (flat-file) |
20| `/get/{dbentries}/image` | Pathway image (PNG) |
21| `/get/{dbentries}/kgml` | Pathway as KGML XML |
22| `/find/{database}/{query}` | Search by keyword |
23| `/find/{database}/{query}/formula` | Search by molecular formula |
24| `/find/{database}/{value}/exact_mass` | Search by exact mass |
25| `/link/{target_db}/{source_db}` | Find linked entries between databases |
26| `/link/{target_db}/{dbentries}` | Links for specific IDs |
27| `/conv/{target_db}/{dbentries}` | Cross-reference ID conversion |
28| `/ddi/{dbentries}` | Drug-drug interactions |

Key Operations (URL-path-based, no query parameters)

URL PatternDescription
/list/{database}List all entries
/list/{database}/{organism}List entries for organism
/get/{dbentries}Get entry data (flat-file)
/get/{dbentries}/imagePathway image (PNG)
/get/{dbentries}/kgmlPathway as KGML XML
/find/{database}/{query}Search by keyword
/find/{database}/{query}/formulaSearch by molecular formula
/find/{database}/{value}/exact_massSearch by exact mass
/link/{target_db}/{source_db}Find linked entries between databases
/link/{target_db}/{dbentries}Links for specific IDs
/conv/{target_db}/{dbentries}Cross-reference ID conversion
/ddi/{dbentries}Drug-drug interactions
Raw lines 13 to 29
30## Database Codes
32| Code | Database | Example ID |
33|------|----------|------------|
34| `pathway` | Pathways | `hsa00010` |
35| `compound` | Compounds | `C00001` |
36| `drug` | Drugs | `D00001` |
37| `enzyme` | Enzymes | `ec:1.1.1.1` |
38| `genes`/`hsa` | Genes | `hsa:10458` |
39| `disease` | Diseases | `H00001` |
40| `reaction` | Reactions | `R00001` |
41| `ko` | KO orthologs | `K00001` |

Database Codes

CodeDatabaseExample ID
pathwayPathwayshsa00010
compoundCompoundsC00001
drugDrugsD00001
enzymeEnzymesec:1.1.1.1
genes/hsaGeneshsa:10458
diseaseDiseasesH00001
reactionReactionsR00001
koKO orthologsK00001
Raw lines 30 to 42
43## Example Calls
45```
46# List human pathways
47https://rest.kegg.jp/list/pathway/hsa
49# Get pathway entry
50https://rest.kegg.jp/get/hsa00010
52# Search compounds by name
53https://rest.kegg.jp/find/compound/aspirin
55# Search by molecular formula
56https://rest.kegg.jp/find/compound/C9H8O4/formula
58# Find pathways for a gene
59https://rest.kegg.jp/link/pathway/hsa:10458
61# Find diseases for a gene
62https://rest.kegg.jp/link/disease/hsa:672
64# Convert KEGG to PubChem IDs
65https://rest.kegg.jp/conv/pubchem/C00001
67# Get multiple entries (max 10, joined with +)
68https://rest.kegg.jp/get/C00001+C00002+C00003
70# Drug-drug interactions
71https://rest.kegg.jp/ddi/D00564+D00110
72```

Example Calls

# List human pathways
https://rest.kegg.jp/list/pathway/hsa

# Get pathway entry
https://rest.kegg.jp/get/hsa00010

# Search compounds by name
https://rest.kegg.jp/find/compound/aspirin

# Search by molecular formula
https://rest.kegg.jp/find/compound/C9H8O4/formula

# Find pathways for a gene
https://rest.kegg.jp/link/pathway/hsa:10458

# Find diseases for a gene
https://rest.kegg.jp/link/disease/hsa:672

# Convert KEGG to PubChem IDs
https://rest.kegg.jp/conv/pubchem/C00001

# Get multiple entries (max 10, joined with +)
https://rest.kegg.jp/get/C00001+C00002+C00003

# Drug-drug interactions
https://rest.kegg.jp/ddi/D00564+D00110
Raw lines 43 to 73
74## Response Format
75Tab-delimited text for list/find/link/conv. Flat-file text for get. **No JSON support.**

Response Format

Tab-delimited text for list/find/link/conv. Flat-file text for get. No JSON support.

Raw lines 74 to 76
77## Rate Limits
78KEGG requests at most 3 calls per second; pace below that and honor failures. Batch up to 10 IDs per `/get` with `+`. May return HTTP 403 if too many requests.
80KEGG `conv/pubchem/...` maps to PubChem **Substance IDs (SIDs)**, not Compound IDs (CIDs). Resolve SID to CID through PubChem before joining compound properties. Official contract: https://www.kegg.jp/kegg/rest/keggapi.html

Rate Limits

KEGG requests at most 3 calls per second; pace below that and honor failures. Batch up to 10 IDs per /get with +. May return HTTP 403 if too many requests.

KEGG conv/pubchem/... maps to PubChem Substance IDs (SIDs), not Compound IDs (CIDs). Resolve SID to CID through PubChem before joining compound properties. Official contract: https://www.kegg.jp/kegg/rest/keggapi.html

Raw lines 77 to 80