Skill Tracer
Skills › Scientific Agent Skills › database-lookup › metabolomics-workbench.md

metabolomics-workbench.md

104 lines · skills/database-lookup/references/metabolomics-workbench.md at 5f2bc03

Open on GitHub
1# Metabolomics Workbench REST API
2

Metabolomics Workbench REST API

Raw lines 1 to 2
3## Base URL
4```
5https://www.metabolomicsworkbench.org/rest/
6```
7

Base URL

https://www.metabolomicsworkbench.org/rest/
Raw lines 3 to 7
8## Auth
9No API key required. Fully public.

Auth

No API key required. Fully public.

Raw lines 8 to 10
11## URL Structure
12```
13/rest/{context}/{input_item}/{input_value}/{output_item}
14```
16Contexts: `study`, `compound`, `refmet`, `gene`, `protein`, `moverz` (`exactmass` is an input item, not a context)

URL Structure

/rest/{context}/{input_item}/{input_value}/{output_item}

Contexts: study, compound, refmet, gene, protein, moverz (exactmass is an input item, not a context)

Raw lines 11 to 17
18## Key Endpoints

Key Endpoints

Raw lines 18 to 19
20### Study Context
21| URL Pattern | Description |
22|---|---|
23| `/rest/study/study_id/{ST_ID}/summary` | Study summary metadata |
24| `/rest/study/study_id/{ST_ID}/metabolites` | Metabolites in a study |
25| `/rest/study/study_id/{ST_ID}/analysis` | Analysis details |
26| `/rest/study/study_id/{ST_ID}/factors` | Experimental factors |
27| `/rest/study/study_id/{ST_ID}/data` | Named metabolite data matrix |
28| `/rest/study/study_title/{keyword}/summary` | Search studies by title keyword |
29| `/rest/study/analysis_id/{AN_ID}/summary` | Summary by analysis ID |
31Study IDs: `ST######` (e.g., `ST000001`). Analysis IDs: `AN######`.

Study Context

URL PatternDescription
/rest/study/study_id/{ST_ID}/summaryStudy summary metadata
/rest/study/study_id/{ST_ID}/metabolitesMetabolites in a study
/rest/study/study_id/{ST_ID}/analysisAnalysis details
/rest/study/study_id/{ST_ID}/factorsExperimental factors
/rest/study/study_id/{ST_ID}/dataNamed metabolite data matrix
/rest/study/study_title/{keyword}/summarySearch studies by title keyword
/rest/study/analysis_id/{AN_ID}/summarySummary by analysis ID

Study IDs: ST###### (e.g., ST000001). Analysis IDs: AN######.

Raw lines 20 to 32
33### Compound Context
34| URL Pattern | Description |
35|---|---|
36| `/rest/compound/formula/{FORMULA}/all` | Search compound by molecular formula |
37| `/rest/compound/pubchem_cid/{CID}/all` | Search by PubChem CID |
38| `/rest/compound/hmdb_id/{HMDB_ID}/all` | Search by HMDB ID |
39| `/rest/compound/kegg_id/{KEGG_ID}/all` | Search by KEGG ID |
40| `/rest/compound/inchi_key/{KEY}/all` | Search by InChI key |
41| `/rest/compound/regno/{REGNO}/classification` | Compound classification |
42| `/rest/compound/regno/{REGNO}/molfile` | MOL file (structure) |

Compound Context

URL PatternDescription
/rest/compound/formula/{FORMULA}/allSearch compound by molecular formula
/rest/compound/pubchem_cid/{CID}/allSearch by PubChem CID
/rest/compound/hmdb_id/{HMDB_ID}/allSearch by HMDB ID
/rest/compound/kegg_id/{KEGG_ID}/allSearch by KEGG ID
/rest/compound/inchi_key/{KEY}/allSearch by InChI key
/rest/compound/regno/{REGNO}/classificationCompound classification
/rest/compound/regno/{REGNO}/molfileMOL file (structure)
Raw lines 33 to 43
44### RefMet (Standardized Nomenclature)
45| URL Pattern | Description |
46|---|---|
47| `/rest/refmet/name/{NAME}/all` | Full RefMet record |
48| `/rest/refmet/match/{NAME}/name` | Match name to standardized RefMet name |

RefMet (Standardized Nomenclature)

URL PatternDescription
/rest/refmet/name/{NAME}/allFull RefMet record
/rest/refmet/match/{NAME}/nameMatch name to standardized RefMet name
Raw lines 44 to 49
50### Gene / Protein Context
51| URL Pattern | Description |
52|---|---|
53| `/rest/gene/gene_symbol/{SYMBOL}/all` | Gene info by symbol |
54| `/rest/gene/gene_id/{ID}/all` | Gene info by Entrez ID |
55| `/rest/protein/uniprot_id/{ID}/all` | Protein by UniProt ID |

Gene / Protein Context

URL PatternDescription
/rest/gene/gene_symbol/{SYMBOL}/allGene info by symbol
/rest/gene/gene_id/{ID}/allGene info by Entrez ID
/rest/protein/uniprot_id/{ID}/allProtein by UniProt ID
Raw lines 50 to 56
57### Mass search
59The moverz input encodes library, m/z, adduct and tolerance in Daltons:
60```text
61/rest/moverz/MB/635.52/M+H/0.5
62```
63`MB` selects the Metabolomics Workbench library. Encode a plus sign as `%2B`
64when a client treats it as a space. Specify the ion/adduct; a positive/negative
65mode label alone is not sufficient. Exact mass for a lipid abbreviation is:
66```text
67/rest/moverz/exactmass/PC(34:1)/M+H
68```

Mass search

The moverz input encodes library, m/z, adduct and tolerance in Daltons:

/rest/moverz/MB/635.52/M+H/0.5

MB selects the Metabolomics Workbench library. Encode a plus sign as %2B when a client treats it as a space. Specify the ion/adduct; a positive/negative mode label alone is not sufficient. Exact mass for a lipid abbreviation is:

/rest/moverz/exactmass/PC(34:1)/M+H
Raw lines 57 to 69
70## Example Calls
72```
73# Study summary
74https://www.metabolomicsworkbench.org/rest/study/study_id/ST000001/summary
76# Metabolites in a study
77https://www.metabolomicsworkbench.org/rest/study/study_id/ST000001/metabolites
79# Search studies by title
80https://www.metabolomicsworkbench.org/rest/study/study_title/diabetes/summary
82# Compounds with a formula (not unique chemical identity)
83https://www.metabolomicsworkbench.org/rest/compound/formula/C6H12O6/all
85# Compound by PubChem CID
86https://www.metabolomicsworkbench.org/rest/compound/pubchem_cid/5793/all
88# RefMet standardized name match
89https://www.metabolomicsworkbench.org/rest/refmet/match/alpha-D-Glucose/name
91# m/z search in positive mode
92https://www.metabolomicsworkbench.org/rest/moverz/MB/635.52/M%2BH/0.5
94# Exact mass search
95https://www.metabolomicsworkbench.org/rest/moverz/exactmass/PC(34:1)/M%2BH
96```

Example Calls

# Study summary
https://www.metabolomicsworkbench.org/rest/study/study_id/ST000001/summary

# Metabolites in a study
https://www.metabolomicsworkbench.org/rest/study/study_id/ST000001/metabolites

# Search studies by title
https://www.metabolomicsworkbench.org/rest/study/study_title/diabetes/summary

# Compounds with a formula (not unique chemical identity)
https://www.metabolomicsworkbench.org/rest/compound/formula/C6H12O6/all

# Compound by PubChem CID
https://www.metabolomicsworkbench.org/rest/compound/pubchem_cid/5793/all

# RefMet standardized name match
https://www.metabolomicsworkbench.org/rest/refmet/match/alpha-D-Glucose/name

# m/z search in positive mode
https://www.metabolomicsworkbench.org/rest/moverz/MB/635.52/M%2BH/0.5

# Exact mass search
https://www.metabolomicsworkbench.org/rest/moverz/exactmass/PC(34:1)/M%2BH
Raw lines 70 to 97
98## Response Format
99Most record queries default to JSON. `mwtab` returns MWTab text and `molfile` returns MOL text. `/moverz/exactmass/` returns a short HTML/text result: the live PC(34:1), M+H example returned 760.585077 and C42H83NO8P. No general pagination contract is exposed; keep queries narrow and inspect the actual content type and body. An HTTP 200 can contain an unsupported-input error. Resolve names through RefMet; `compound/name` is not a supported input item.

Response Format

Most record queries default to JSON. mwtab returns MWTab text and molfile returns MOL text. /moverz/exactmass/ returns a short HTML/text result: the live PC(34:1), M+H example returned 760.585077 and C42H83NO8P. No general pagination contract is exposed; keep queries narrow and inspect the actual content type and body. An HTTP 200 can contain an unsupported-input error. Resolve names through RefMet; compound/name is not a supported input item.

Raw lines 98 to 100
101## Rate Limits
102No published limits. Be reasonable. Add 0.5-1s delay for batch calls.
104Official query builder and contract: https://www.metabolomicsworkbench.org/tools/mw_rest.php

Rate Limits

No published limits. Be reasonable. Add 0.5-1s delay for batch calls.

Official query builder and contract: https://www.metabolomicsworkbench.org/tools/mw_rest.php

Raw lines 101 to 104