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 [2015/10/28 22:09] – rkiss | api [2019/11/29 16:08] – [Database files] 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": 1.2, | + | } |
- | "download_url": "https://mcule.s3.amazonaws.com/ | + | ], |
- | "entry_count": | + | " |
- | "name": "mcule_known_stock_amount_compounds" | + | " |
- | }, | + | " |
- | { | + | |
- | "created": "2015-08-20", | + | { |
- | "description": "Gzipped 2D SDF of purchasable compounds with known prices", | + | |
- | "download_size_gb": | + | "entry_count": |
- | "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": " | + | " |
- | "entry_count": | + | " |
- | "name": "mcule_inchies" | + | " |
- | } | + | " |
- | ] | + | } |
+ | ], | ||
+ | | ||
+ | "name": "Mcule Purchasable (in stock)", | ||
+ | "public": | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | If you call this API endpoint as an authenticated user (=you provide a [[api# | ||
+ | |||
+ | |||
+ | ===== 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: | ||
+ | |||
+ | { | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | "atoms": | ||
+ | "components": | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | "halogen_atoms": | ||
+ | | ||
+ | "heteroatoms": | ||
+ | | ||
+ | "known_ct_bonds": | ||
+ | "known_stereocenters": | ||
+ | "logp": | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | "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 88: | Line 233: | ||
Authentication is currently a token based authentication. | Authentication is currently a token based authentication. | ||
- | If you would like to access our protected API endpoints, please drop us an email at info@mcule.com and we can provide you with a token. | + | If you would like to access our protected API endpoints, please drop us an email at support@mcule.com and we can provide you with a token. |
Once you have a valid token you have to send it in the Authorization header: | Once you have a valid token you have to send it in the Authorization header: | ||
Line 95: | Line 240: | ||
</ | </ | ||
+ | Example: | ||
+ | < | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | If you have a valid access token you can check it on the [[https:// | ||
====== Protected API endpoints ====== | ====== Protected API endpoints ====== | ||
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 108: | Line 353: | ||
== Example API request: == | == Example API request: == | ||
< | < | ||
- | echo {" | + | echo '{" |
</ | </ | ||
Line 140: | Line 385: | ||
" | " | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
+ | " | ||
+ | }, | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
+ | " | ||
+ | }, | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
+ | " | ||
+ | }, | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
} | } | ||
] | ] | ||
Line 198: | Line 451: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
- | " | + | }, |
- | " | + | " |
- | }, | + | " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
- | " | + | }, |
- | " | + | " |
- | }, | + | " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
- | " | + | }, |
- | " | + | " |
- | }, | + | " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | }, | + | " |
- | " | + | }, |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
} | } | ||
] | ] | ||
} | } | ||
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Compound suppliers public API ===== | ||
+ | |||
+ | You can get some very basic (public) information about our compound suppliers with this API. | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Connection: keep-alive | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | | ||
+ | ... | ||
+ | | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The detail API endpoint is also available on this endpoint: | ||
+ | < | ||
+ | |||
+ | It will return a similar response as the above one but for an individual compound supplier. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Compound catalogs public API ===== | ||
+ | |||
+ | You can get some very basic (public) information about our compound catalogs with this API. | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Connection: keep-alive | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Connection: keep-alive | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | |||
+ | ... | ||
+ | | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | The detail API endpoint is also available on this endpoint: | ||
+ | < | ||
+ | |||
+ | It will return a similar response as the above one but for an individual compound catalog. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Quote Request API ===== | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | Mandatory fields: | ||
+ | * **mcule_ids**: | ||
+ | * **customer_first_name**: | ||
+ | * **customer_last_name**: | ||
+ | * **delivery_country**: | ||
+ | |||
+ | |||
+ | Optional fields: | ||
+ | * **amount**: Preferred amount per molecule (mg). (default: 1) | ||
+ | * **min_amount**: | ||
+ | * **target_volume**: | ||
+ | * **target_cc**: | ||
+ | * **extra_amount**: | ||
+ | * **customer_email**: | ||
+ | * **delivery_time**: | ||
+ | * **purity**: Required minimum purity (%). (default: null) | ||
+ | * **higher_amounts**: | ||
+ | * **item_filters**: | ||
+ | |||
+ | The **amount** or target concentration-volume pair (**target_volume** and **target_cc**) need to be specified. | ||
+ | |||
+ | **item_filters** example: | ||
+ | It has to be a data structure where keys are mcule IDs you specified in the **mcule_ids** field. If you specify a key that is not an item in the **mcule_ids** list you should get a validation error (400 Bad Request). | ||
+ | Currently only supplier filtering is supported. You can specify a supplier ID list in the **suppliers** field to restrict product selection of a given item to a list of suppliers. If the list contains only one supplier ID, you restrict the product selection to that particular supplier. To get the ID of a supplier you can use the [[api# | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Advanced optional fields: | ||
+ | * **keep_original_salt_form**: | ||
+ | * **keep_original_tautomer_form**: | ||
+ | * **keep_original_stereo_form**: | ||
+ | * **deliver_multiple_salt_forms**: | ||
+ | |||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | POST / | ||
+ | Accept: application/ | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 201 CREATED | ||
+ | Allow: GET, POST, HEAD, OPTIONS | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Quote Request Status API ===== | ||
+ | |||
+ | Since processing a quote request and generating suitable quotes can take some time it is an asynchronous process. You can query the status of a quote request by calling the detail API endpoint of the quote request. It is returned in the **api_url** field when you create the quote request. You can also use the **id** field to construct the url of the API call. You can check the **state** field of the response whether the async quote request processing is finished. | ||
+ | |||
+ | States: | ||
+ | * **10 / Pending**: The quote query is queued but the processing has not started yet. | ||
+ | * **20 / Running**: The processing of the quote query is in progress. | ||
+ | * **30 / Done**: The processing of the quote query is finished. For one quote request query we might generate multiple quotes (this is what we call a group) or it is also possible that we could not generate any quotes for a particular quote request. If there are quotes they will appear under the **group** field where the **quotes** field contains a list of the generated quotes and some basic info about them. You can get detailed data of a particular quote by calling the endpoint specified in the **api_url** field. | ||
+ | * **40 / Error**: An error happened during the processing of the quote query. | ||
+ | |||
+ | Following the above example where the ID of the quote request is //15029// we query the status of the quote request: | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | |||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Connection: keep-alive | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Check for the **group** field. If it is not null, we could generate some quotes for your quote query. As you can see from the above result, we could generate 3 different quotes for the quote query. A "Best price" quote, a " | ||
+ | |||
+ | ===== Quote API ===== | ||
+ | |||
+ | In order to get the detailed data of an individual quote, you can call the detail API endpoint of a quote, for example for the quote with ID //15677//: | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Fields: === | ||
+ | |||
+ | Where currency is not specified, it is always USD. | ||
+ | |||
+ | * **analytical_services_price**: | ||
+ | * **avg_product_price**: | ||
+ | * **catalog_data**: | ||
+ | * **products_count**: | ||
+ | * **products_price**: | ||
+ | * **effective_price_display**: | ||
+ | * **avg_effective_price**: | ||
+ | * **delivery_time**: | ||
+ | * **quote**: The ID of the quote this catalog level quote data belongs to. | ||
+ | * **coverage_percent**: | ||
+ | * **created**: | ||
+ | * **delivery_days**: | ||
+ | * **delivery_price**: | ||
+ | * **duplicate_count**: | ||
+ | * **extra_handling_price**: | ||
+ | * **group**: | ||
+ | * **id**: The ID of the Instant Quote. | ||
+ | * **is_expired**: | ||
+ | * **is_saved**: | ||
+ | * **items**: list of product level data | ||
+ | * **amount**: Quoted amount (mg) | ||
+ | * **effective_price_display**: | ||
+ | * **price**: effective price | ||
+ | * **product_mcule_id**: | ||
+ | * **product**: | ||
+ | * **product_compound_mcule_id**: | ||
+ | * **product_delivery_time**: | ||
+ | * **product_price**: | ||
+ | * **product_purity**: | ||
+ | * **structure_origin_mcule_id**: | ||
+ | * **quote**: The ID of the quote this product level quote data belongs to. | ||
+ | * **name**: The name of the quote. Quotes created via the API don't have names. | ||
+ | * **order_data**: | ||
+ | * **payment_due_days**: | ||
+ | * **price**: Total price of quote (USD) | ||
+ | * **price_items**: | ||
+ | * **product_discount_price**: | ||
+ | * **products_price**: | ||
+ | * **query**: The quote query fields | ||
+ | * **reference_id_full**: | ||
+ | * **reformatting_price**: | ||
+ | * **shipping_price**: | ||
+ | * **site_url**: | ||
+ | * **special_formatting_price**: | ||
+ | * **state**: State code of the quote. | ||
+ | * **state_display**: | ||
+ | * **supplier_data**: | ||
+ | * **delivery_price**: | ||
+ | * **delivery_time**: | ||
+ | * **effective_price**: | ||
+ | * **avg_effective_price**: | ||
+ | * **products_count**: | ||
+ | * **products_price**: | ||
+ | * **quote**: The ID of the quote this supplier quote data belongs to. | ||
+ | * **reformatting_price**: | ||
+ | * **supplier**: | ||
+ | * **suppliers_count**: | ||
+ | * **total_cost**: | ||
+ | * **total_cost_without_discount**: | ||
+ | * **total_discount_price**: | ||
+ | * **type**: Type code of the quote. | ||
+ | * **type_display**: | ||
+ | * **updated**: | ||
+ | * **valid_until**: | ||
+ | | ||
+ | ==== Quote - Missing structures ==== | ||
+ | |||
+ | You can get the missing structures along with the reason of their exclusion. | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | And it will return a similar response to this: | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Download quote as PDF ==== | ||
+ | |||
+ | You can download a quote as a PDF file. Please note that the PDF file generation can take some time, the more item it contains the more time it will take to generate the file. | ||
+ | |||
+ | The HTTP response contains a // | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | ==== Download quote as Excel (.xlsx) file ==== | ||
+ | |||
+ | You can download a quote as an Excel file. Please note that the file generation can take some time, the more item it contains the more time it will take to generate the file. | ||
+ | |||
+ | The HTTP response contains a // | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Code examples (Python) ====== | ||
+ | |||
+ | We created a public Git repository that contains Python code examples on how to use the Mcule API. These examples supplement the above API documentation and might give you a better understanding on how you can utilize those API endpoints currently. | ||
+ | |||
+ | The repository is available here: | ||
+ | [[https:// | ||
+ | |||
+ | We'll probably extend this repository with new examples later. | ||
+ |
api.txt · Last modified: 2024/05/10 08:12 by bkovats