scientific-skills/database-lookup/references/pubchem.md
https://pubchem.ncbi.nlm.nih.gov/rest/pug
/{domain}/{namespace}/{identifiers}/{operation}/{output}
compound, substance, assaycid, name, smiles, inchi, inchikey, fastformularecord, property, synonyms, description, cids, xrefsJSON, XML, CSV, TXT, SDF, PNGGET /compound/name/{name}/JSON
Example: /compound/name/aspirin/JSON
GET /compound/cid/{cid}/JSON
Example: /compound/cid/2244/JSON
Multiple CIDs: /compound/cid/2244,5988,3672/JSON
GET /compound/smiles/{smiles}/JSON
For SMILES with special characters, use POST:
POST /compound/smiles/JSON
Content-Type: application/x-www-form-urlencoded
smiles=CC(=O)OC1=CC=CC=C1C(=O)O
GET /compound/inchikey/{inchikey}/JSON
POST /compound/inchi/JSON
Content-Type: application/x-www-form-urlencoded
inchi=InChI=1S/C9H8O4/...
GET /compound/fastformula/{formula}/JSON
Example: /compound/fastformula/C9H8O4/JSON
GET /compound/{namespace}/{id}/property/{property_list}/JSON
Properties are comma-separated. Available properties:
MolecularFormula, MolecularWeight, CanonicalSMILES, IsomericSMILES, InChI, InChIKey, IUPACName, XLogP, ExactMass, MonoisotopicMass, TPSA, Complexity, Charge, HBondDonorCount, HBondAcceptorCount, RotatableBondCount, HeavyAtomCount, CID
Example:
/compound/cid/2244/property/MolecularFormula,MolecularWeight,CanonicalSMILES,IUPACName/JSON
Response:
{
"PropertyTable": {
"Properties": [
{
"CID": 2244,
"MolecularFormula": "C9H8O4",
"MolecularWeight": 180.16,
"IUPACName": "2-acetyloxybenzoic acid",
"CanonicalSMILES": "CC(=O)OC1=CC=CC=C1C(O)=O"
}
]
}
}
GET /compound/{namespace}/{id}/synonyms/JSON
GET /compound/cid/{cid}/description/JSON
GET /compound/name/{name}/cids/JSON
GET /compound/cid/{cid}/xrefs/PatentID/JSON
GET /compound/cid/{cid}/xrefs/RegistryID/JSON
POST /compound/fastsimilarity_2d/smiles/cids/JSON
smiles=CC(=O)OC1=CC=CC=C1C(=O)O&Threshold=90
GET /compound/cid/{cid}/PNG
GET /compound/cid/{cid}/PNG?image_size=300x300
PUGREST.ServerBusy fault code{
"Fault": {
"Code": "PUGREST.NotFound",
"Message": "No CID found",
"Details": ["..."]
}
}