REST API

Molecules

Upload, normalize, and retrieve molecules. Base URL: https://api.molhub.io/v1

Create a molecule#

POST/v1/molecules

Upload a SMILES, InChI, SDF, or PDBQT. The server normalizes and (optionally) embeds 3D coordinates.

bash
curl https://api.molhub.io/v1/molecules \
  -H "Authorization: Bearer $MOLHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "smiles",
    "content": "CC(=O)Oc1ccccc1C(=O)O",
    "generate_3d": true
  }'
response
{
  "id": "mol_01HC2X...",
  "smiles_canonical": "CC(=O)Oc1ccccc1C(=O)O",
  "inchi_key": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N",
  "mw": 180.16,
  "logp": 1.19,
  "qed": 0.55,
  "validated": true
}

Retrieve#

GET/v1/molecules/{id}
bash
curl https://api.molhub.io/v1/molecules/mol_01HC2X \
  -H "Authorization: Bearer $MOLHUB_API_KEY"

Batch upload#

POST/v1/molecules/batch

Up to 100,000 molecules per request. The response contains a job ID; poll it for completion.

python
mh.molecules.batch_upload(file="library.sdf").wait()