HMDB Database
Overview
The Human Metabolome Database (HMDB) is a comprehensive, freely available resource containing detailed information about small molecule metabolites found in the human body.
Scripts
HMDB serves no public REST API, and the whole site (records, .xml URLs, search, downloads)
answers scripted requests with a Cloudflare challenge (HTTP 403, cf-mitigated: challenge;
checked 2026-10-23). Start with scripts/hmdb_open.py (stdlib only, JSON to stdout), which
assembles HMDB content from keyless mirrors and labels every value with its source:
python scripts/hmdb_open.py record HMDB0000001 # identity + HMDB annotations + concentrations
python scripts/hmdb_open.py disease "diabetes mellitus type 2" --biofluid Blood # biomarkers
python scripts/hmdb_open.py structure "CN1C=NC2=C1C(=O)N(C(=O)N2)C" # SMILES -> HMDB ID(s)
record: PubChem (HMDB accessions are PubChem RegistryIDs) gives name, formula, average and
monoisotopic mass, SMILES, InChI/InChIKey; PubChem's HMDB-sourced PUG-View entries give tissue
and cellular locations, metabolite pathways and disease associations with PubMed IDs; MarkerDB
(Wishart lab, built on HMDB) gives measured normal and condition concentrations per biofluid.
HMDB0000001 -> 1-methyl-L-histidine, C7H11N3O2, 169.18; measured in Blood (normal 12.7 µM) and
Urine. HMDB's full biospecimen list (e.g. CSF, saliva, feces entries without concentrations)
is only on hmdb.ca: say so instead of filling it in from memory.
disease: MarkerDB's condition card — every chemical biomarker with biofluid, disease vs
normal concentration, p-value/AUC where given, clinical status, PMIDs and HMDB ID. "Diabetes
Mellitus Type 2" -> 28 records over 24 metabolites, 21 in Blood (e.g. D-glucose HMDB0000122
6300 vs 3900 µM; 1,5-anhydrosorbitol HMDB0002712 62 vs 150 µM). MarkerDB/HMDB report serum
and plasma together as "Blood".
structure: exact-structure match -> PubChem CID -> HMDB accession(s), plus same-formula
isomers that carry an HMDB accession (paraxanthine HMDB0001860 vs theophylline HMDB0001889 and
theobromine HMDB0002825 — a mass match alone cannot separate them).
scripts/query_hmdb.py fetches and parses the HMDB XML record itself (python scripts/query_hmdb.py HMDB0000001) and works only where hmdb.ca lets your network through.
For bulk work download the XML/SDF dumps from https://www.hmdb.ca/downloads in a browser.
When to Use This Skill
This skill should be used when performing metabolomics research, clinical chemistry, biomarker discovery, or metabolite identification tasks: identifying a human metabolite, reading its biofluid concentrations and disease/biomarker associations, or matching it against HMDB reference NMR/MS spectra.
Does NOT Trigger
| Scenario |
Use Instead |
| Generic compound identifiers, properties, or bioassays for any small molecule |
alterlab-pubchem |
| Primary metabolomics study datasets, RefMet standardized names |
alterlab-metabolomics-wb |
| Pathway maps and KEGG compound/reaction IDs |
alterlab-kegg |
| Computing MS/MS spectral similarity on your own spectra files |
alterlab-matchms |
| Drug pharmacology, targets, and interactions |
alterlab-drugbank |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-pubchem) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Database Contents
HMDB version 5.0 (released 2022; latest major version as of mid-2026) contains:
- 220,945 metabolite entries covering both water-soluble and lipid-soluble compounds (the v5.0 paper reported 217,920; the live site count grows with curation)
- ~8,600 protein sequences for enzymes and transporters involved in metabolism
- 130+ data fields per metabolite including:
- Chemical properties (structure, formula, molecular weight, InChI, SMILES)
- Clinical data (biomarker associations, diseases, normal/abnormal concentrations)
- Biological information (pathways, reactions, locations)
- Spectroscopic data (NMR, MS, MS-MS spectra)
- External database links (KEGG, PubChem, MetaCyc, ChEBI, PDB, UniProt, GenBank)
Core Capabilities
1. Web-Based Metabolite Searches
Access HMDB through the web interface at https://www.hmdb.ca/ for:
Text Searches:
- Search by metabolite name, synonym, or identifier (HMDB ID)
- Example HMDB IDs: HMDB0000001, HMDB0001234
- Search by disease associations or pathway involvement
- Query by biological specimen type (urine, serum, CSF, saliva, feces, sweat)
Structure-Based Searches:
- Use ChemQuery for structure and substructure searches
- Search by molecular weight or molecular weight range
- Use SMILES or InChI strings to find compounds
Spectral Searches:
- LC-MS spectral matching
- GC-MS spectral matching
- NMR spectral searches for metabolite identification
Advanced Searches:
- Combine multiple criteria (name, properties, concentration ranges)
- Filter by biological locations or specimen types
- Search by protein/enzyme associations
2. Accessing Metabolite Information
When retrieving metabolite data, HMDB provides:
Chemical Information:
- Systematic name, traditional names, and synonyms
- Chemical formula and molecular weight
- Structure representations (2D/3D, SMILES, InChI, MOL file)
- Chemical taxonomy and classification
Biological Context:
- Metabolic pathways and reactions
- Associated enzymes and transporters
- Subcellular locations
- Biological roles and functions
Clinical Relevance:
- Normal concentration ranges in biological fluids
- Biomarker associations with diseases
- Clinical significance
- Toxicity information when applicable
Analytical Data:
- Experimental and predicted NMR spectra
- MS and MS-MS spectra
- Retention times and chromatographic data
- Reference peaks for identification
3. Downloadable Datasets
HMDB offers bulk data downloads at https://www.hmdb.ca/downloads in multiple formats:
Available Formats:
- XML: Complete metabolite, protein, and spectra data
- SDF: Metabolite structure files for cheminformatics
- FASTA: Protein and gene sequences
- TXT: Raw spectra peak lists
- CSV/TSV: Tabular data exports
Dataset Categories:
- All metabolites or filtered by specimen type
- Protein/enzyme sequences
- Experimental and predicted spectra (NMR, GC-MS, MS-MS)
- Pathway information
Best Practices:
- Download XML format for comprehensive data including all fields
- Use SDF format for structure-based analysis and cheminformatics workflows
- Parse CSV/TSV formats for integration with data analysis pipelines
- Check version dates to ensure up-to-date data (current major version: v5.0)
Usage Requirements:
- Free for academic and non-commercial research
- Commercial use requires explicit permission (contact samackay@ualberta.ca)
- Cite HMDB publication when using data
4. Programmatic Access
HMDB publishes no documented public REST API. Practical programmatic routes, in order of preference:
- Bulk downloads (preferred for any volume): Parse the XML/SDF/CSV dumps from https://www.hmdb.ca/downloads locally. This is the only route that scales and won't get rate-limited.
- Per-record XML endpoint: Each entry is served as XML at
https://www.hmdb.ca/metabolites/<ID>.xml (used by scripts/query_hmdb.py). Undocumented, and in Sept 2026 it answered scripted clients with a Cloudflare challenge (HTTP 403) — usable only when your network is allowed through; never for batch jobs. When it is blocked, say so rather than filling fields from memory.
- Keyless HMDB content (works when hmdb.ca blocks you):
scripts/hmdb_open.py (see Scripts) combines the two routes below with MarkerDB's concentration records.
- Cross-references through open APIs: PubChem indexes HMDB accessions as registry IDs —
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/xref/RegistryID/HMDB0000001/cids/JSON returns CID 92105 (1-methylhistidine), after which structure and properties come from PubChem (alterlab-pubchem). UniChem maps HMDB (source 18) to ChEBI/ChEMBL/KEGG: POST https://www.ebi.ac.uk/unichem/api/v1/compounds with {"type": "sourceID", "compound": "HMDB0000001", "sourceID": 18}. PubChem also mirrors HMDB's tissue/cellular locations, pathways and disease associations (PUG-View sections whose source is "Human Metabolome Database (HMDB)"), and MarkerDB (https://markerdb.ca, keyless HTML; its JSON API needs a key) holds normal and disease concentrations by biofluid. Reference NMR/MS spectra still require HMDB itself (or its downloads).
- R/Bioconductor
hmdbQuery: deprecated and removed from current Bioconductor (last shipped in 3.21); don't build new workflows on it.
- Custom API: For sanctioned bulk/commercial API access, contact the HMDB team (see Usage Requirements above for the listed address).
5. Common Research Workflows
Metabolite Identification in Untargeted Metabolomics:
- Obtain experimental MS or NMR spectra from samples
- Use HMDB spectral search tools to match against reference spectra
- Verify candidates by checking molecular weight, retention time, and MS-MS fragmentation
- Review biological plausibility (expected in specimen type, known pathways)
Biomarker Discovery:
- Search HMDB for metabolites associated with disease of interest
- Review concentration ranges in normal vs. disease states
- Identify metabolites with strong differential abundance
- Examine pathway context and biological mechanisms
- Cross-reference with literature via PubMed links
Pathway Analysis:
- Identify metabolites of interest from experimental data
- Look up HMDB entries for each metabolite
- Extract pathway associations and enzymatic reactions
- Use linked SMPDB (Small Molecule Pathway Database) for pathway diagrams
- Identify pathway enrichment for biological interpretation
Database Integration:
- Download HMDB data in XML or CSV format
- Parse and extract relevant fields for local database
- Link with external IDs (KEGG, PubChem, ChEBI) for cross-database queries
- Build local tools or pipelines incorporating HMDB reference data
Related HMDB Resources
The HMDB ecosystem includes related databases:
- DrugBank: ~2,832 drug compounds with pharmaceutical information
- T3DB (Toxin and Toxin Target Database): ~3,670 toxic compounds
- SMPDB (Small Molecule Pathway Database): Pathway diagrams and maps
- FooDB: ~70,000 food component compounds
These databases share similar structure and identifiers, enabling integrated queries across human metabolome, drug, toxin, and food databases.
Best Practices
Data Quality:
- Verify metabolite identifications with multiple evidence types (spectra, structure, properties)
- Check experimental vs. predicted data quality indicators
- Review citations and evidence for biomarker associations
Version Tracking:
- Note HMDB version used in research (current: v5.0)
- Databases are updated periodically with new entries and corrections
- Re-query for updates when publishing to ensure current information
Citation:
- Always cite HMDB in publications using the database
- Reference specific HMDB IDs when discussing metabolites
- Acknowledge data sources for downloaded datasets
Performance:
- For large-scale analysis, download complete datasets rather than repeated web queries
- Use appropriate file formats (XML for comprehensive data, CSV for tabular analysis)
- Consider local caching of frequently accessed metabolite information
Reference Documentation
See references/hmdb_data_fields.md for detailed information about available data fields and their meanings.
1---2name: alterlab-hmdb3description: Access the Human Metabolome Database (HMDB, 220K+ metabolites), searching by name, HMDB ID, or structure to retrieve chemical properties, biomarker data, NMR/MS reference spectra, and associated pathways. Use when identifying a human metabolite, looking up its biomarker or disease associations, matching NMR/MS spectra, or running metabolomics annotation. Part of the AlterLab Academic Skills suite.4license: MIT5allowed-tools: Read WebFetch Bash(curl:*) Bash(python:*)6compatibility: No public REST API and hmdb.ca blocks scripted clients (Cloudflare challenge); keyless HMDB content via scripts/hmdb_open.py (PubChem RegistryID xrefs and HMDB-sourced PUG-View annotations, MarkerDB concentrations by biofluid); bulk XML/SDF downloads in a browser7metadata:8 source: https://skillmd.com/skills/alterlab-ieu/alterlab-hmdb9 skill-author: AlterLab10 version: "1.1.0"11 last_updated: "2026-10-23"12---1314# HMDB Database1516## Overview1718The Human Metabolome Database (HMDB) is a comprehensive, freely available resource containing detailed information about small molecule metabolites found in the human body.1920## Scripts2122HMDB serves no public REST API, and the whole site (records, `.xml` URLs, search, downloads)23answers scripted requests with a Cloudflare challenge (HTTP 403, `cf-mitigated: challenge`;24checked 2026-10-23). **Start with `scripts/hmdb_open.py`** (stdlib only, JSON to stdout), which25assembles HMDB content from keyless mirrors and labels every value with its source:2627```bash28python scripts/hmdb_open.py record HMDB0000001 # identity + HMDB annotations + concentrations29python scripts/hmdb_open.py disease "diabetes mellitus type 2" --biofluid Blood # biomarkers30python scripts/hmdb_open.py structure "CN1C=NC2=C1C(=O)N(C(=O)N2)C" # SMILES -> HMDB ID(s)31```3233- `record`: PubChem (HMDB accessions are PubChem RegistryIDs) gives name, formula, average and34 monoisotopic mass, SMILES, InChI/InChIKey; PubChem's HMDB-sourced PUG-View entries give tissue35 and cellular locations, metabolite pathways and disease associations with PubMed IDs; MarkerDB36 (Wishart lab, built on HMDB) gives measured normal and condition concentrations per biofluid.37 HMDB0000001 -> 1-methyl-L-histidine, C7H11N3O2, 169.18; measured in Blood (normal 12.7 µM) and38 Urine. HMDB's full biospecimen list (e.g. CSF, saliva, feces entries without concentrations)39 is only on hmdb.ca: say so instead of filling it in from memory.40- `disease`: MarkerDB's condition card — every chemical biomarker with biofluid, disease vs41 normal concentration, p-value/AUC where given, clinical status, PMIDs and HMDB ID. "Diabetes42 Mellitus Type 2" -> 28 records over 24 metabolites, 21 in Blood (e.g. D-glucose HMDB000012243 6300 vs 3900 µM; 1,5-anhydrosorbitol HMDB0002712 62 vs 150 µM). MarkerDB/HMDB report serum44 and plasma together as "Blood".45- `structure`: exact-structure match -> PubChem CID -> HMDB accession(s), plus same-formula46 isomers that carry an HMDB accession (paraxanthine HMDB0001860 vs theophylline HMDB0001889 and47 theobromine HMDB0002825 — a mass match alone cannot separate them).4849`scripts/query_hmdb.py` fetches and parses the HMDB XML record itself (`python50scripts/query_hmdb.py HMDB0000001`) and works only where hmdb.ca lets your network through.51For bulk work download the XML/SDF dumps from https://www.hmdb.ca/downloads in a browser.5253## When to Use This Skill5455This skill should be used when performing metabolomics research, clinical chemistry, biomarker discovery, or metabolite identification tasks: identifying a human metabolite, reading its biofluid concentrations and disease/biomarker associations, or matching it against HMDB reference NMR/MS spectra.5657### Does NOT Trigger5859| Scenario | Use Instead |60|----------|-------------|61| Generic compound identifiers, properties, or bioassays for any small molecule | `alterlab-pubchem` |62| Primary metabolomics study datasets, RefMet standardized names | `alterlab-metabolomics-wb` |63| Pathway maps and KEGG compound/reaction IDs | `alterlab-kegg` |64| Computing MS/MS spectral similarity on your own spectra files | `alterlab-matchms` |65| Drug pharmacology, targets, and interactions | `alterlab-drugbank` |6667**Hand-off rule.** When the request matches a row above, open your answer by naming that skill by its exact id (for example `alterlab-pubchem`) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.6869## Database Contents7071HMDB version 5.0 (released 2022; latest major version as of mid-2026) contains:7273- **220,945 metabolite entries** covering both water-soluble and lipid-soluble compounds (the v5.0 paper reported 217,920; the live site count grows with curation)74- **~8,600 protein sequences** for enzymes and transporters involved in metabolism75- **130+ data fields per metabolite** including:76 - Chemical properties (structure, formula, molecular weight, InChI, SMILES)77 - Clinical data (biomarker associations, diseases, normal/abnormal concentrations)78 - Biological information (pathways, reactions, locations)79 - Spectroscopic data (NMR, MS, MS-MS spectra)80 - External database links (KEGG, PubChem, MetaCyc, ChEBI, PDB, UniProt, GenBank)8182## Core Capabilities8384### 1. Web-Based Metabolite Searches8586Access HMDB through the web interface at https://www.hmdb.ca/ for:8788**Text Searches:**89- Search by metabolite name, synonym, or identifier (HMDB ID)90- Example HMDB IDs: HMDB0000001, HMDB000123491- Search by disease associations or pathway involvement92- Query by biological specimen type (urine, serum, CSF, saliva, feces, sweat)9394**Structure-Based Searches:**95- Use ChemQuery for structure and substructure searches96- Search by molecular weight or molecular weight range97- Use SMILES or InChI strings to find compounds9899**Spectral Searches:**100- LC-MS spectral matching101- GC-MS spectral matching102- NMR spectral searches for metabolite identification103104**Advanced Searches:**105- Combine multiple criteria (name, properties, concentration ranges)106- Filter by biological locations or specimen types107- Search by protein/enzyme associations108109### 2. Accessing Metabolite Information110111When retrieving metabolite data, HMDB provides:112113**Chemical Information:**114- Systematic name, traditional names, and synonyms115- Chemical formula and molecular weight116- Structure representations (2D/3D, SMILES, InChI, MOL file)117- Chemical taxonomy and classification118119**Biological Context:**120- Metabolic pathways and reactions121- Associated enzymes and transporters122- Subcellular locations123- Biological roles and functions124125**Clinical Relevance:**126- Normal concentration ranges in biological fluids127- Biomarker associations with diseases128- Clinical significance129- Toxicity information when applicable130131**Analytical Data:**132- Experimental and predicted NMR spectra133- MS and MS-MS spectra134- Retention times and chromatographic data135- Reference peaks for identification136137### 3. Downloadable Datasets138139HMDB offers bulk data downloads at https://www.hmdb.ca/downloads in multiple formats:140141**Available Formats:**142- **XML**: Complete metabolite, protein, and spectra data143- **SDF**: Metabolite structure files for cheminformatics144- **FASTA**: Protein and gene sequences145- **TXT**: Raw spectra peak lists146- **CSV/TSV**: Tabular data exports147148**Dataset Categories:**149- All metabolites or filtered by specimen type150- Protein/enzyme sequences151- Experimental and predicted spectra (NMR, GC-MS, MS-MS)152- Pathway information153154**Best Practices:**155- Download XML format for comprehensive data including all fields156- Use SDF format for structure-based analysis and cheminformatics workflows157- Parse CSV/TSV formats for integration with data analysis pipelines158- Check version dates to ensure up-to-date data (current major version: v5.0)159160**Usage Requirements:**161- Free for academic and non-commercial research162- Commercial use requires explicit permission (contact samackay@ualberta.ca)163- Cite HMDB publication when using data164165### 4. Programmatic Access166167HMDB publishes **no documented public REST API**. Practical programmatic routes, in order of preference:168169- **Bulk downloads (preferred for any volume):** Parse the XML/SDF/CSV dumps from https://www.hmdb.ca/downloads locally. This is the only route that scales and won't get rate-limited.170- **Per-record XML endpoint:** Each entry is served as XML at `https://www.hmdb.ca/metabolites/<ID>.xml` (used by `scripts/query_hmdb.py`). Undocumented, and in Sept 2026 it answered scripted clients with a Cloudflare challenge (HTTP 403) — usable only when your network is allowed through; never for batch jobs. When it is blocked, say so rather than filling fields from memory.171- **Keyless HMDB content (works when hmdb.ca blocks you):** `scripts/hmdb_open.py` (see Scripts) combines the two routes below with MarkerDB's concentration records.172- **Cross-references through open APIs:** PubChem indexes HMDB accessions as registry IDs — `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/xref/RegistryID/HMDB0000001/cids/JSON` returns CID 92105 (1-methylhistidine), after which structure and properties come from PubChem (`alterlab-pubchem`). UniChem maps HMDB (source 18) to ChEBI/ChEMBL/KEGG: `POST https://www.ebi.ac.uk/unichem/api/v1/compounds` with `{"type": "sourceID", "compound": "HMDB0000001", "sourceID": 18}`. PubChem also mirrors HMDB's tissue/cellular locations, pathways and disease associations (PUG-View sections whose source is "Human Metabolome Database (HMDB)"), and MarkerDB (https://markerdb.ca, keyless HTML; its JSON API needs a key) holds normal and disease concentrations by biofluid. Reference NMR/MS spectra still require HMDB itself (or its downloads).173- **R/Bioconductor `hmdbQuery`:** deprecated and removed from current Bioconductor (last shipped in 3.21); don't build new workflows on it.174- **Custom API:** For sanctioned bulk/commercial API access, contact the HMDB team (see Usage Requirements above for the listed address).175176### 5. Common Research Workflows177178**Metabolite Identification in Untargeted Metabolomics:**1791. Obtain experimental MS or NMR spectra from samples1802. Use HMDB spectral search tools to match against reference spectra1813. Verify candidates by checking molecular weight, retention time, and MS-MS fragmentation1824. Review biological plausibility (expected in specimen type, known pathways)183184**Biomarker Discovery:**1851. Search HMDB for metabolites associated with disease of interest1862. Review concentration ranges in normal vs. disease states1873. Identify metabolites with strong differential abundance1884. Examine pathway context and biological mechanisms1895. Cross-reference with literature via PubMed links190191**Pathway Analysis:**1921. Identify metabolites of interest from experimental data1932. Look up HMDB entries for each metabolite1943. Extract pathway associations and enzymatic reactions1954. Use linked SMPDB (Small Molecule Pathway Database) for pathway diagrams1965. Identify pathway enrichment for biological interpretation197198**Database Integration:**1991. Download HMDB data in XML or CSV format2002. Parse and extract relevant fields for local database2013. Link with external IDs (KEGG, PubChem, ChEBI) for cross-database queries2024. Build local tools or pipelines incorporating HMDB reference data203204## Related HMDB Resources205206The HMDB ecosystem includes related databases:207208- **DrugBank**: ~2,832 drug compounds with pharmaceutical information209- **T3DB (Toxin and Toxin Target Database)**: ~3,670 toxic compounds210- **SMPDB (Small Molecule Pathway Database)**: Pathway diagrams and maps211- **FooDB**: ~70,000 food component compounds212213These databases share similar structure and identifiers, enabling integrated queries across human metabolome, drug, toxin, and food databases.214215## Best Practices216217**Data Quality:**218- Verify metabolite identifications with multiple evidence types (spectra, structure, properties)219- Check experimental vs. predicted data quality indicators220- Review citations and evidence for biomarker associations221222**Version Tracking:**223- Note HMDB version used in research (current: v5.0)224- Databases are updated periodically with new entries and corrections225- Re-query for updates when publishing to ensure current information226227**Citation:**228- Always cite HMDB in publications using the database229- Reference specific HMDB IDs when discussing metabolites230- Acknowledge data sources for downloaded datasets231232**Performance:**233- For large-scale analysis, download complete datasets rather than repeated web queries234- Use appropriate file formats (XML for comprehensive data, CSV for tabular analysis)235- Consider local caching of frequently accessed metabolite information236237## Reference Documentation238239See `references/hmdb_data_fields.md` for detailed information about available data fields and their meanings.240