api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
api [2017/12/05 13:20] – [Multiple queries exact search with availability] flack | api [2017/12/05 23:45] – flack | ||
---|---|---|---|
Line 40: | Line 40: | ||
Content-Type: | Content-Type: | ||
- | [ | + | { |
- | | + | |
- | "created": "2015-05-18", | + | "next": |
- | " | + | |
- | "download_size_gb": | + | " |
- | " | + | |
- | "entry_count": | + | |
- | "name": "mcule_purchasable_compounds" | + | "entry_count": |
- | }, | + | " |
- | { | + | { |
- | "created": "2015-05-18", | + | |
- | " | + | "file_type": |
- | "download_size_gb": | + | "file_type_display": "2D SDF (sdf.gz)", |
- | " | + | " |
- | "entry_count": | + | |
- | "name": "mcule_in_stock_compounds" | + | { |
- | }, | + | "download_url": |
- | { | + | " |
- | "created": "2015-05-18", | + | " |
- | "description": "Gzipped 2D SDF of in stock compounds with known exact stock amount", | + | " |
- | "download_size_gb": | + | } |
- | "download_url": " | + | ], |
- | "entry_count": | + | " |
- | "name": "mcule_known_stock_amount_compounds" | + | " |
- | | + | |
- | | + | { |
- | "created": "2015-08-20", | + | |
- | "description": "Gzipped 2D SDF of purchasable compounds with known prices", | + | "entry_count": |
- | "download_size_gb": | + | " |
- | "download_url": "https://mcule.s3.amazonaws.com/ | + | { |
- | "entry_count": | + | |
- | "name": "mcule_instant_quotable_compounds" | + | "file_type": |
- | }, | + | "file_type_display": "2D SDF (sdf.gz)", |
- | | + | " |
- | "created": "2014-07-21", | + | |
- | "description": "Gzipped csv (delimiter: tab) of all compounds with mcule ID, standard InChI and InChIKey", | + | { |
- | "download_size_gb": | + | "download_url": "https:// |
- | "download_url": " | + | "file_type": "smiles.gz", |
- | "entry_count": | + | "file_type_display": |
- | "name": "mcule_inchies" | + | "size_mb": |
- | } | + | } |
- | ] | + | ], |
+ | | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Compound details ===== | ||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | | ||
+ | "formula": "C15H11N3O2S2", | ||
+ | | ||
+ | | ||
+ | "mol": "\n mcule | ||
+ | " | ||
+ | "atoms": | ||
+ | | ||
+ | "ct_bonds": | ||
+ | "h_bond_acceptors": | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | "rotatable_bonds": | ||
+ | "stereocenters": | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | | ||
+ | "std_inchi": "InChI=1S/ | ||
+ | "stereo_type": "none", | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== InChIKey lookup ===== | ||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | | ||
+ | | ||
+ | "smiles": | ||
+ | "url": " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Single query search / lookup ===== | ||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | Where the query can be an mcule ID, SMILES, InChI or InChIKey identifier. | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | | ||
+ | | ||
+ | "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", | ||
+ | " | ||
+ | | ||
+ | ] | ||
+ | } | ||
</ | </ | ||
Line 99: | Line 240: | ||
Protected API endpoints are only accessible if a valid token is provided in the Authorization header of the request. | Protected API endpoints are only accessible if a valid token is provided in the Authorization header of the request. | ||
+ | |||
+ | ===== Compound availability ===== | ||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Compound prices ===== | ||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | It returns the best prices for 1mg, 5mg and 10mg amounts by default. | ||
+ | You can specify amounts of your choice in the //amounts// GET parameter: | ||
+ | |||
+ | < | ||
+ | http ' | ||
+ | </ | ||
+ | |||
===== Multiple queries exact search ===== | ===== Multiple queries exact search ===== | ||
Line 143: | Line 378: | ||
" | " | ||
" | " | ||
- | " | + | " |
}, | }, | ||
{ | { | ||
Line 149: | Line 384: | ||
" | " | ||
" | " | ||
- | " | + | " |
}, | }, | ||
{ | { | ||
Line 155: | Line 390: | ||
" | " | ||
" | " | ||
- | " | + | " |
}, | }, | ||
{ | { | ||
Line 161: | Line 396: | ||
" | " | ||
" | " | ||
- | " | + | " |
} | } | ||
] | ] | ||
Line 213: | Line 448: | ||
" | " | ||
" | " | ||
- | " | + | " |
}, | }, | ||
{ | { | ||
Line 224: | Line 459: | ||
" | " | ||
" | " | ||
- | " | + | " |
}, | }, | ||
{ | { | ||
Line 235: | Line 470: | ||
" | " | ||
" | " | ||
- | " | + | " |
}, | }, | ||
{ | { | ||
Line 246: | Line 481: | ||
" | " | ||
" | " | ||
- | " | + | " |
} | } | ||
] | ] | ||
} | } | ||
</ | </ |
api.txt · Last modified: 2024/05/10 08:12 by bkovats