Search by SMILES
POST
/smiles
Headers
Name
Value
Content-Type
application/json
Body
Name
Type
Description
SMILES
string
SMILES
limit
integer
Optional parameter that specifies how many results should be returned. Valid values range from 1 to 100. Defaults to 10.
GraphQL schema
query BySMILES ($smiles: String!, $limit: Int = 1) {
molecules (SMILES: $smiles, limit: $limit) { # 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 BySMILES ($smiles: String!, $limit: Int = 10) {
molecules (SMILES: $smiles, limit: $limit) {
CID
IUPAC
SMILES
InChI
InChIKey
synonyms
}
}""",
"variables": {"smiles": "C[C@@H](C1=CC=C(C=C1)CC(C)C)C(=O)O"}
}
resp = requests.post(
url=API_URL,
json=payload,
)
print(resp.json())
Last updated