Search by CID
POST
/cid
Headers
Name
Value
Content-Type
application/json
Body
Name
Type
Description
CID
string
PubChem compound identifier
GraphQL schema
query ByCID ($cid: Int!) {
molecules (CID: $cid) { # Here described fields to include in the response
CID
IUPAC
SMILES
InChI
InChIKey
synonyms
}
}
Response
OK response from API:
{
"molecules": [
{
"CID": 39912,
"IUPAC": "(2S)-2-[4-(2-methylpropyl)phenyl]propanoic acid",
"SMILES": "C[C@@H](C1=CC=C(C=C1)CC(C)C)C(=O)O",
"InChI": "InChI=1S/C13H18O2/c1-9(2)8-11-4-6-12(7-5-11)10(3)13(14)15/h4-7,9-10H,8H2,1-3H3,(H,14,15)/t10-/m0/s1",
"InChIKey": "HEFNNWSXXWATRW-JTQLQIEISA-N",
"synonyms": [
"(S)-(+)-Ibuprofen",
...
]
},
...
]
}
Requests example
import requests
payload = {
"query": """query ByCID ($cid: Int!) {
molecules (CID: $cid) {
CID
IUPAC
SMILES
InChI
InChIKey
synonyms
}
}""",
"variables": {"cid": 39912}
}
resp = requests.post(
url=API_URL,
json=payload,
)
print(resp.json())
Last updated