User Tools

Site Tools


api

This is an old revision of the document!


API base url: https://mcule.com/api/v1/

Examples are demonstrated with HTTPie.

Only the most important request/response headers are shown in the examples below.

Response status codes

  • 200 OK - Success response
  • 400 BAD REQUEST - A validation error typically
  • 401 UNAUTHORIZED - Unauthorized
  • 403 FORBIDDEN - Permission denied
  • 404 NOT FOUND - Not found
  • 500 SERVER ERROR - Something went wrong

Public API endpoints

Public API endpoints are accessible to everyone, without authentication.

Database files

Endpoint:
/database-files/
Example API request:
http https://mcule.com/api/v1/database-files/ --print HBhb
Request:
GET /api/v1/database-files/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json

{
    "count": 2, 
    "next": null, 
    "previous": null, 
    "results": [
        {
            "description": "All purchasable, in stock & virtual compounds", 
            "entry_count": 35772718, 
            "files": [
                {
                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_170918.sdf.gz", 
                    "file_type": "sdf.gz", 
                    "file_type_display": "2D SDF (sdf.gz)", 
                    "size_mb": 5762
                }, 
                {
                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_170918.smiles.gz", 
                    "file_type": "smiles.gz", 
                    "file_type_display": "SMILES (smi.gz)", 
                    "size_mb": 462
                }
            ], 
            "last_updated": "2017-09-18", 
            "name": "Mcule Purchasable (full)",
            "public": true
        }, 
        {
            "description": "All purchasable, in stock compounds", 
            "entry_count": 5648837, 
            "files": [
                {
                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_170918.sdf.gz", 
                    "file_type": "sdf.gz", 
                    "file_type_display": "2D SDF (sdf.gz)", 
                    "size_mb": 1311
                }, 
                {
                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_170918.smiles.gz", 
                    "file_type": "smiles.gz", 
                    "file_type_display": "SMILES (smi.gz)", 
                    "size_mb": 84
                }
            ], 
            "last_updated": "2017-09-18", 
            "name": "Mcule Purchasable (in stock)",
            "public": true
        }
    ]
}

If you call this API endpoint as an authenticated user (=you provide a valid token) you might get additional private entries if you have permission to access them.

Compound details

Endpoint:
/compound/<mcule_id>/
Example API request:
http https://mcule.com/api/v1/compound/MCULE-9380369173/ --print HBhb
Request:
GET /api/v1/compound/MCULE-9380369173/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "components": [], 
    "formula": "C15H11N3O2S2", 
    "inchi_key": "WVRLGAPZMSKMGL-UHFFFAOYSA-N", 
    "mcule_id": "MCULE-9380369173", 
    "mol": "\n  mcule   05121714262D\n\n 22 24  0  0  0  0  0  0  0  0999 V2000\n    3.8489    4.0497    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.8489    3.0496    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n    2.9831    2.5496    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    2.1169    3.0496    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n    2.9831    1.5495    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.7922    0.9621    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.4832    0.0109    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    2.4829    0.0109    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    1.8951   -0.7981    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    0.9006   -0.6935    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    0.3127   -1.5025    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    0.6220   -2.4537    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -0.1871   -3.0416    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n   -0.9960   -2.4537    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -0.6872   -1.5025    0.0000 S   0  0  0  0  0  0  0  0  0  0  0  0\n   -1.9472   -2.7625    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.1550   -3.7409    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -3.1061   -4.0497    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -3.8489   -3.3807    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -3.6412   -2.4024    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   -2.6901   -2.0935    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    2.1740    0.9621    0.0000 S   0  0  0  0  0  0  0  0  0  0  0  0\n  1  2  1  0  0  0  0\n  2  3  1  0  0  0  0\n  3  4  2  0  0  0  0\n  3  5  1  0  0  0  0\n  5  6  2  0  0  0  0\n  6  7  1  0  0  0  0\n  7  8  2  0  0  0  0\n  8  9  1  0  0  0  0\n  9 10  2  3  0  0  0\n 10 11  1  0  0  0  0\n 11 12  2  0  0  0  0\n 12 13  1  0  0  0  0\n 13 14  2  0  0  0  0\n 14 15  1  0  0  0  0\n 11 15  1  0  0  0  0\n 14 16  1  0  0  0  0\n 16 17  1  0  0  0  0\n 17 18  2  0  0  0  0\n 18 19  1  0  0  0  0\n 19 20  2  0  0  0  0\n 20 21  1  0  0  0  0\n 16 21  2  0  0  0  0\n  8 22  1  0  0  0  0\n  5 22  1  0  0  0  0\nM  END", 
    "properties": {
        "atoms": 33, 
        "components": 1, 
        "ct_bonds": 1, 
        "h_bond_acceptors": 5, 
        "h_bond_donors": 0, 
        "halogen_atoms": 0, 
        "heavy_atoms": 22, 
        "heteroatoms": 7, 
        "hydrogens": 11, 
        "known_ct_bonds": 0, 
        "known_stereocenters": 0, 
        "logp": 3.6186, 
        "mol_mass": 329.401, 
        "non_organic_atoms": 0, 
        "o_and_n_atoms": 5, 
        "psa": 121.45, 
        "r3_violations": 5, 
        "r5_violations": 0, 
        "refractivity": 87.6665, 
        "rings": 3, 
        "rotatable_bonds": 5, 
        "stereocenters": 0, 
        "undef_ct_bonds": 0, 
        "undef_stereocenters": 0, 
        "unknown_ct_bonds": 1, 
        "unknown_stereocenters": 0
    }, 
    "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", 
    "std_inchi": "InChI=1S/C15H11N3O2S2/c1-20-15(19)12-9-17-13(22-12)6-5-10-8-18-14(21-10)11-4-2-3-7-16-11/h2-9H,1H3", 
    "stereo_type": "none", 
    "url": "https://mcule.com/MCULE-9380369173/"
}

InChIKey lookup

Endpoint:
/lookup/inchikey/<inchi_key>
Example API request:
http https://mcule.com/api/v1/lookup/inchikey/WVRLGAPZMSKMGL-UHFFFAOYSA-N --print HBhb
Request:
GET /api/v1/lookup/inchikey/WVRLGAPZMSKMGL-UHFFFAOYSA-N HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "results": [
        {
            "mcule_id": "MCULE-9380369173", 
            "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", 
            "url": "https://mcule.com/MCULE-9380369173/"
        }
    ]
}

Single query search / lookup

Endpoint:
/search/lookup/?query=<your_query>

Where the query can be an mcule ID, SMILES, InChI or InChIKey identifier.

Example API request:
http 'https://mcule.com/api/v1/search/lookup/?query=COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O' --print HBhb
Request:
GET /api/v1/search/lookup/?query=COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "results": [
        {
            "mcule_id": "MCULE-9380369173", 
            "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", 
            "url": "https://mcule.com/MCULE-9380369173/"
        }
    ]
}

Authentication

Authentication is currently a token based authentication. If you would like to access our protected API endpoints, please drop us an email at support@mcule.com including a brief summary on why and how you would like to use the API. We'll review your request, and if accepted, we'll provide you with an access token which you can use to call the API as an authenticated user.

Once you have a valid token you have to send it in the Authorization header:

Authorization: Token <your_token>

Example:

Authorization: Token 905050288b9e786a4d60gc2fe2e5007000b7f17c

If you have a valid access token you can check it on the API acccess page on mcule.com. If you need to generate a new one, you can also do it there.

Protected API endpoints

Protected API endpoints are only accessible if a valid token is provided in the Authorization header of the request.

Compound availability

Endpoint:
/compound/<mcule_id>/availability/
Example API request:
http https://mcule.com/api/v1/compound/MCULE-9380369173/availability/ "Authorization: Token <your_token>" --print HBhb
Request:
GET /api/v1/compound/MCULE-9380369173/availability/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "availability_type": "in stock", 
    "confirmed_amount": 242, 
    "confirmed_amount_unit": "mg"
}

Compound prices

Endpoint:
/compound/<mcule_id>/prices/
Example API request:
http https://mcule.com/api/v1/compound/MCULE-9380369173/prices/ "Authorization: Token <your_token>" --print HBhb
Request:
GET /api/v1/compound/MCULE-9380369173/prices/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "best_prices": [
        {
            "amount": 1, 
            "currency": "USD", 
            "delivery_time_working_days": 9, 
            "price": 107, 
            "purity": 90, 
            "unit": "mg"
        }, 
        {
            "amount": 5, 
            "currency": "USD", 
            "delivery_time_working_days": 9, 
            "price": 116, 
            "purity": 90, 
            "unit": "mg"
        }, 
        {
            "amount": 10, 
            "currency": "USD", 
            "delivery_time_working_days": 9, 
            "price": 151, 
            "purity": 90, 
            "unit": "mg"
        }
    ]
}

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 'https://mcule.com/api/v1/compound/MCULE-9380369173/prices/?amounts=15,20' "Authorization: Token <your_token>" --print HBhb

Compound list details

With this endpoint you can get compound details information for multiple compound mcule IDs in a single API call.

Endpoint:
/compounds/
Basic API request:
echo '{"mcule_ids": ["MCULE-7655747555","MCULE-5912414227"]}' | http https://mcule.com/api/v1/compounds/ "Authorization: Token <your_token>" --print HBhb
Example API request:
echo '{"mcule_ids": ["MCULE-7655747555","MCULE-5912414227","MCULE-2570263241"], "price_amounts": [1,5,10], "components": true, "availability": true}' | http https://mcule.com/api/v1/compounds/ "Authorization: Token <your_token>" --print HBhb
Request:
POST /api/v1/compounds/ HTTP/1.1
Authorization: Token <your_token>
Content-Type: application/json

{
    "availability": true,
    "components": true,
    "mcule_ids": [
        "MCULE-7655747555",
        "MCULE-5912414227",
        "MCULE-2570263241"
    ],
    "price_amounts": [
        1,
        5,
        10
    ]
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json

{
    "count": 3,
    "results": [
        {
            "mcule_id": "MCULE-7655747555",
            "smiles": "C1C=C(F)C=C(C2=NC=C(C#N)C=N2)C=1",
            "inchi_key": "ZXSZUCRVSWGKCX-UHFFFAOYSA-N",
            "best_prices": [],
            "mol": "\n  mcule   14092123302D\n\n 15 16  0  0  0  0  0  0  0  0999 V2000\n    8.1579    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    6.7983    0.7849    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    6.7983    2.3549    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    8.1579    3.1400    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    9.5175    2.3549    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    9.5175    0.7849    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n   10.8773    3.1400    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0\n    5.4386    3.1400    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.0789    2.3549    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    2.7192    3.1400    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    2.7192    4.7100    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.0789    5.4950    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    5.4386    4.7100    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    1.3597    5.4950    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    0.0000    6.2800    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n  1  2  2  0  0  0  0\n  2  3  1  0  0  0  0\n  3  4  2  0  0  0  0\n  4  5  1  0  0  0  0\n  5  6  2  0  0  0  0\n  6  1  1  0  0  0  0\n  5  7  1  0  0  0  0\n  3  8  1  0  0  0  0\n  8  9  1  0  0  0  0\n  9 10  2  0  0  0  0\n 10 11  1  0  0  0  0\n 11 12  2  0  0  0  0\n 12 13  1  0  0  0  0\n 13  8  2  0  0  0  0\n 11 14  1  0  0  0  0\n 14 15  3  0  0  0  0\nM  END",
            "availability": {
                "confirmed_amount": null,
                "availability_type": "in stock",
                "confirmed_amount_unit": "mg"
            },
            "std_inchi": "InChI=1S/C11H6FN3/c12-10-3-1-2-9(4-10)11-14-6-8(5-13)7-15-11/h1-4,6-7H",
            "url": "https://mcule.com/MCULE-7655747555/",
            "properties": {
                "rotatable_bonds": 1,
                "h_bond_donors": 0,
                "logp": 2.15438,
                "r3_violations": 0,
                "ct_bonds": 0,
                "undef_stereocenters": 0,
                "stereocenters": 0,
                "rings": 2,
                "heavy_atoms": 15,
                "r5_violations": 0,
                "heteroatoms": 4,
                "hydrogens": 6,
                "unknown_ct_bonds": 0,
                "non_organic_atoms": 0,
                "psa": 49.57,
                "known_stereocenters": 0,
                "atoms": 21,
                "unknown_stereocenters": 0,
                "halogen_atoms": 1,
                "known_ct_bonds": 0,
                "h_bond_acceptors": 3,
                "refractivity": 52.141,
                "mol_mass": 199.183,
                "o_and_n_atoms": 3,
                "undef_ct_bonds": 0,
                "components": 1
            },
            "stereo_type": "none",
            "components": [],
            "formula": "C11H6FN3"
        },
        {
            "mcule_id": "MCULE-5912414227",
            "smiles": "CN1C(C2N(C(C3N=CC=C(C4CC4)C=3)=O)CCCCC2)=CC=C1",
            "inchi_key": "LIJVUQWKZXRMJJ-UHFFFAOYSA-N",
            "best_prices": [
                {
                    "currency": "USD",
                    "amount": 1,
                    "purity": 90,
                    "delivery_time_working_days": 30,
                    "price": 310,
                    "unit": "mg"
                },
                {
                    "currency": "USD",
                    "amount": 5,
                    "purity": 90,
                    "delivery_time_working_days": 30,
                    "price": 330,
                    "unit": "mg"
                },
                {
                    "currency": "USD",
                    "amount": 10,
                    "purity": 90,
                    "delivery_time_working_days": 30,
                    "price": 355,
                    "unit": "mg"
                }
            ],
            "mol": "\n  mcule   14092123302D\n\n 24 27  0  0  0  0  0  0  0  0999 V2000\n    8.4758    5.5126    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    7.6618    5.6478    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    7.2928    6.3856    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    6.4771    6.2627    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    6.3419    5.4488    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    7.0742    5.0687    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    7.1972    4.2529    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    7.9855    4.0098    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    8.2869    3.2418    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    7.8744    2.5274    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    7.0585    2.4043    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    6.4539    2.9656    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    6.5154    3.7883    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    5.8010    4.2008    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    5.8010    5.0258    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n    5.0866    3.7883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    5.0866    2.9632    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.3721    2.5507    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.6576    2.9632    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.6576    3.7883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.3721    4.2008    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    4.3721    1.7257    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.7845    1.0113    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.9596    1.0113    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n  1  2  1  0  0  0  0\n  2  3  1  0  0  0  0\n  3  4  2  0  0  0  0\n  4  5  1  0  0  0  0\n  5  6  2  0  0  0  0\n  2  6  1  0  0  0  0\n  6  7  1  0  0  0  0\n  7  8  1  0  0  0  0\n  8  9  1  0  0  0  0\n  9 10  1  0  0  0  0\n 10 11  1  0  0  0  0\n 11 12  1  0  0  0  0\n 12 13  1  0  0  0  0\n  7 13  1  0  0  0  0\n 13 14  1  0  0  0  0\n 14 15  2  0  0  0  0\n 14 16  1  0  0  0  0\n 16 17  2  0  0  0  0\n 17 18  1  0  0  0  0\n 18 19  2  0  0  0  0\n 19 20  1  0  0  0  0\n 20 21  2  0  0  0  0\n 16 21  1  0  0  0  0\n 18 22  1  0  0  0  0\n 22 23  1  0  0  0  0\n 23 24  1  0  0  0  0\n 22 24  1  0  0  0  0\nM  END",
            "availability": {
                "confirmed_amount": null,
                "availability_type": "potentially purchasable",
                "confirmed_amount_unit": "mg"
            },
            "std_inchi": "InChI=1S/C20H25N3O/c1-22-12-5-7-18(22)19-6-3-2-4-13-23(19)20(24)17-14-16(10-11-21-17)15-8-9-15/h5,7,10-12,14-15,19H,2-4,6,8-9,13H2,1H3",
            "url": "https://mcule.com/MCULE-5912414227/",
            "properties": {
                "rotatable_bonds": 4,
                "h_bond_donors": 0,
                "logp": 3.9929,
                "r3_violations": 4,
                "ct_bonds": 0,
                "undef_stereocenters": 1,
                "stereocenters": 1,
                "rings": 4,
                "heavy_atoms": 24,
                "r5_violations": 0,
                "heteroatoms": 4,
                "hydrogens": 25,
                "unknown_ct_bonds": 0,
                "non_organic_atoms": 0,
                "psa": 38.13,
                "known_stereocenters": 0,
                "atoms": 49,
                "unknown_stereocenters": 0,
                "halogen_atoms": 0,
                "known_ct_bonds": 0,
                "h_bond_acceptors": 4,
                "refractivity": 99.3685,
                "mol_mass": 323.431,
                "o_and_n_atoms": 4,
                "undef_ct_bonds": 0,
                "components": 1
            },
            "stereo_type": "absolute",
            "components": [],
            "formula": "C20H25N3O"
        },
        {
            "mcule_id": "MCULE-2570263241",
            "smiles": "CN1C(C2N(C(C3=C4C(NN=C4)=NC=C3)=O)CCCCC2)=CC=C1",
            "inchi_key": "MIRPCBGHLNQNNH-UHFFFAOYSA-N",
            "best_prices": [
                {
                    "currency": "USD",
                    "amount": 1,
                    "purity": 90,
                    "delivery_time_working_days": 30,
                    "price": 310,
                    "unit": "mg"
                },
                {
                    "currency": "USD",
                    "amount": 5,
                    "purity": 90,
                    "delivery_time_working_days": 30,
                    "price": 330,
                    "unit": "mg"
                },
                {
                    "currency": "USD",
                    "amount": 10,
                    "purity": 90,
                    "delivery_time_working_days": 30,
                    "price": 355,
                    "unit": "mg"
                }
            ],
            "mol": "\n  mcule   14092123302D\n\n 24 27  0  0  0  0  0  0  0  0999 V2000\n    3.0777    5.0348    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.6016    4.3976    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    4.4252    4.4469    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.7266    3.6789    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    4.0893    3.1549    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.3941    3.5991    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    2.6261    3.2977    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    2.0213    3.8587    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    1.2056    3.7359    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    0.7931    3.0214    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    1.0945    2.2533    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    1.8828    2.0103    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    2.5645    2.4749    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    3.2789    2.0625    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.9934    2.4749    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0\n    3.2789    1.2374    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.9934    0.8250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.9934   -0.0001    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    3.2789   -0.4125    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    2.5645   -0.0001    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    1.7798   -0.2549    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    1.2949    0.4125    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0\n    1.7798    1.0798    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n    2.5645    0.8250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n  1  2  1  0  0  0  0\n  2  3  1  0  0  0  0\n  3  4  2  0  0  0  0\n  4  5  1  0  0  0  0\n  5  6  2  0  0  0  0\n  2  6  1  0  0  0  0\n  6  7  1  0  0  0  0\n  7  8  1  0  0  0  0\n  8  9  1  0  0  0  0\n  9 10  1  0  0  0  0\n 10 11  1  0  0  0  0\n 11 12  1  0  0  0  0\n 12 13  1  0  0  0  0\n  7 13  1  0  0  0  0\n 13 14  1  0  0  0  0\n 14 15  2  0  0  0  0\n 14 16  1  0  0  0  0\n 16 17  1  0  0  0  0\n 17 18  2  0  0  0  0\n 18 19  1  0  0  0  0\n 19 20  2  0  0  0  0\n 20 21  1  0  0  0  0\n 21 22  1  0  0  0  0\n 22 23  2  0  0  0  0\n 23 24  1  0  0  0  0\n 16 24  2  0  0  0  0\n 20 24  1  0  0  0  0\nM  END",
            "availability": {
                "confirmed_amount": null,
                "availability_type": "potentially purchasable",
                "confirmed_amount_unit": "mg"
            },
            "std_inchi": "InChI=1S/C18H21N5O/c1-22-10-5-7-15(22)16-6-3-2-4-11-23(16)18(24)13-8-9-19-17-14(13)12-20-21-17/h5,7-10,12,16H,2-4,6,11H2,1H3,(H,19,20,21)",
            "url": "https://mcule.com/MCULE-2570263241/",
            "properties": {
                "rotatable_bonds": 3,
                "h_bond_donors": 1,
                "logp": 2.9918,
                "r3_violations": 3,
                "ct_bonds": 0,
                "undef_stereocenters": 1,
                "stereocenters": 1,
                "rings": 4,
                "heavy_atoms": 24,
                "r5_violations": 0,
                "heteroatoms": 6,
                "hydrogens": 21,
                "unknown_ct_bonds": 0,
                "non_organic_atoms": 0,
                "psa": 66.81,
                "known_stereocenters": 0,
                "atoms": 45,
                "unknown_stereocenters": 0,
                "halogen_atoms": 0,
                "known_ct_bonds": 0,
                "h_bond_acceptors": 6,
                "refractivity": 96.5542,
                "mol_mass": 323.392,
                "o_and_n_atoms": 6,
                "undef_ct_bonds": 0,
                "components": 1
            },
            "stereo_type": "absolute",
            "components": [],
            "formula": "C18H21N5O"
        }
    ]
}

Fields:

  • mcule_ids: Required. List of mcule IDs. Only compound level mcule IDs are accepted, e.g.: MCULE-7655747555. Mcule IDs that represent other structure levels (e.g. MCULE-7655747555-0, MCULE-7655747555-0-0, P-611592727) are not accepted.
  • availability: Optional. Default: false. Whether to return availability information in the response. If you don't need this information you can set it to false (or just leave it out from the request) in order to get a quicker response. Collecting this information can take some time.
  • components: Optional. Default: true. Whether to return components information in the response in case the compound has multiple components. If you don't need this information you can set it to false in order to get a slightly quicker response.
  • price_amounts: Optional. Default: None. List of amounts (in mg) to return best prices for. Please note that collecting pricing information is an expensive operation.

Limits:

  • mcule_ids: The size of this list is limited to 500. If you specify the price_amounts field the limit is reduced to 100 since collecting pricing information is an expensive operation.
  • price_amounts: The size of this list is limited to 5.

Multiple queries exact search currently accepts the following input identifiers: mcule ID, SMILES, InChI or InChIKey identifiers. The maximum number of queries you can send to this endpoint is 1000 currently.

Endpoint:
/search/exact/
Example API request:
echo '{"queries": ["COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1", "C1([C@H](C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1", "C1C=C(COC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C)=O)=O)=O)C=CC=1OC1C(O)C(O)C(O)C(CO)O1", "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1"]}' | http https://mcule.com/api/v1/search/exact/ "Authorization: Token <your_token>" --print HBhb
Request:
POST /api/v1/search/exact/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Content-Type: application/json

{
    "queries": [
        "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",
        "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",
        "C1([C@H](C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1",
"C1C=C(COC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C)=O)=O)=O)C=CC=1OC1C(O)C(O)C(O)C(CO)O1",
        "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1"
    ]
}
Response:
HTTP/1.1 200 OK
Allow: POST, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "results": [
        {
            "input_index": 1,
            "matching_level": 40,
            "matching_level_display": "Atom graph",
            "mcule_id": "MCULE-9380369173",
            "query": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",
            "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",
            "url": "https://mcule.com/MCULE-9380369173/"
        },
        {
            "input_index": 2,
            "matching_level": 20,
            "matching_level_display": "Sp3 configuration",
            "mcule_id": "MCULE-4016901520",
            "query": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",
            "smiles": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",
            "url": "https://mcule.com/MCULE-4016901520/"
        },
        {
            "input_index": 3,
            "matching_level": 40,
            "matching_level_display": "Atom graph",
            "mcule_id": "MCULE-1039596211",
            "query": "C1([C@H](C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1",
            "smiles": "C1(C(C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1",
            "url": "https://mcule.com/MCULE-1039596211/"
        },
        {
            "input_index": 5,
            "matching_level": 40,
            "matching_level_display": "Atom graph",
            "mcule_id": "MCULE-1259420189",
            "query": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1",
            "smiles": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1",
            "url": "https://mcule.com/MCULE-1259420189/"
        }
    ]
}

Please note that in case the queries are InChIKeys, matching_level and matching_level_display will always be null in the response.

Multiple queries exact search with availability

Endpoint:
/search/exact/availability/
Example API request:
echo {"queries": ["COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1", "C1([C@H](C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1", "C1C=C(COC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C)=O)=O)=O)C=CC=1OC1C(O)C(O)C(O)C(CO)O1", "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1"]} | http https://mcule.com/api/v1/search/exact/availability/ "Authorization: Token <your_token>" --print HBhb
Request:
POST /api/v1/search/exact/availability/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Content-Type: application/json

{
    "queries": [
        "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",
        "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",
        "C1([C@H](C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1",
"C1C=C(COC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C(O)(CC2C=CC(O)=CC=2)C(C)OC(C)=O)=O)=O)C=CC=1OC1C(O)C(O)C(O)C(CO)O1",
        "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1"
    ]
}
Response:
HTTP/1.1 200 OK
Allow: POST, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "results": [
        {
            "availability": {
                "availability_type": "in stock",
                "confirmed_amount": 100,
                "confirmed_amount_unit": "mg"
            },
            "input_index": 1,
            "matching_level": 40,
            "matching_level_display": "Atom graph",
            "mcule_id": "MCULE-9380369173",
            "query": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",
            "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",
            "url": "https://mcule.com/MCULE-9380369173/"
        },
        {
            "availability": {
                "availability_type": "potentially purchasable",
                "confirmed_amount": null,
                "confirmed_amount_unit": "mg"
            },
            "input_index": 2,
            "matching_level": 20,
            "matching_level_display": "Sp3 configuration",
            "mcule_id": "MCULE-4016901520",
            "query": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",
            "smiles": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",
            "url": "https://mcule.com/MCULE-4016901520/"
        },
        {
            "availability": {
                "availability_type": "in stock",
                "confirmed_amount": 50,
                "confirmed_amount_unit": "mg"
            },
            "input_index": 3,
            "matching_level": 40,
            "matching_level_display": "Atom graph",
            "mcule_id": "MCULE-1039596211",
            "query": "C1([C@H](C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1",
            "smiles": "C1(C(C(C)C)NC(CCCCC2CCSS2)=O)NC2=C(C=CC=C2)N=1",
            "url": "https://mcule.com/MCULE-1039596211/"
        },
        {
            "availability": {
                "availability_type": "potentially purchasable",
                "confirmed_amount": null,
                "confirmed_amount_unit": "mg"
            },
            "input_index": 5,
            "matching_level": 40,
            "matching_level_display": "Atom graph",
            "mcule_id": "MCULE-1259420189",
            "query": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1",
            "smiles": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1",
            "url": "https://mcule.com/MCULE-1259420189/"
        }
    ]
}

Please note that in case the queries are InChIKeys, matching_level and matching_level_display will always be null in the response.

Similarity search currently accepts the following input identifiers: mcule ID, SMILES.

Endpoint:
/search/sim/
Example API request:
echo '{"query": "MCULE-3601132784", "limit": 3, "threshold": 0.8}' | http https://mcule.com/api/v1/search/sim/ "Authorization: Token <your_token>" --print HBhb

or

echo '{"query": "CC1=C(C(CC2NC(=O)C3=C(SC(C4=CC=CC=C4)=C3)N=2)=O)C=CO1", "limit": 3, "threshold": 0.8}' | http https://mcule.com/api/v1/search/sim/ "Authorization: Token <your_token>" --print HBhb
Request:
POST /api/v1/search/sim/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Content-Type: application/json

{
    "limit": 3,
    "query": "MCULE-3601132784",
    "threshold": 0.8
}
Response:
HTTP/1.1 200 OK
Allow: POST, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "results": [
        {
            "mcule_id": "MCULE-3601132784",
            "sim": 1.0,
            "smiles": "CC1=C(C(CC2NC(=O)C3=C(SC(C4=CC=CC=C4)=C3)N=2)=O)C=CO1",
            "url": "https://mcule.com/MCULE-3601132784/"
        },
        {
            "mcule_id": "MCULE-1000774360",
            "sim": 0.8540706605222734,
            "smiles": "O=C(C1OC=CC=1)CC1NC(=O)C2=C(SC(C3=CC=CC=C3)=C2)N=1",
            "url": "https://mcule.com/MCULE-1000774360/"
        },
        {
            "mcule_id": "MCULE-9463088657",
            "sim": 0.8529886914378029,
            "smiles": "CC1SC2=C(C(NC(=N2)CC(C2=C(C)OC=C2)=O)=O)C=1",
            "url": "https://mcule.com/MCULE-9463088657/"
        }
    ]
}

The threshold field accepts values between 0.7 and 1.0, the default is 0.9.

The limit field accepts values between 1 and 1000, the default is 100.

Substructure search currently accepts the following input identifiers: mcule ID, SMILES.

Endpoint:
/search/sss/
Example API request:
echo '{"query": "CC1=CC2=C(S1)N=CNC2=O", "limit": 5}' | http https://mcule.com/api/v1/search/sss/ "Authorization: Token <your_token>" --print HBhb
Request:
POST /api/v1/search/sss/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Content-Type: application/json

{
    "limit": 5,
    "query": "CC1=CC2=C(S1)N=CNC2=O"
}
Response:
HTTP/1.1 200 OK
Allow: POST, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "results": [
        {
            "mcule_id": "MCULE-8112694353",
            "smiles": "C12C(C)=C(SC=1N=CN(CC(NCCCC(=O)NC1CCCCC1)=O)C2=O)C",
            "url": "https://mcule.com/MCULE-8112694353/"
        },
        {
            "mcule_id": "MCULE-8986577308",
            "smiles": "C12SC3=C(CCCC3)C=1C(NC(SCC#C)=N2)=O",
            "url": "https://mcule.com/MCULE-8986577308/"
        },
        {
            "mcule_id": "MCULE-4695228882",
            "smiles": "C12SC3=C(CCCC3)C=1C(NC(SCCCC)=N2)=O",
            "url": "https://mcule.com/MCULE-4695228882/"
        },
        {
            "mcule_id": "MCULE-1137030903",
            "smiles": "N1(CC2C=NN(C)C=2)C(=O)C2C=C(SC=2N=C1S)CC",
            "url": "https://mcule.com/MCULE-1137030903/"
        },
        {
            "mcule_id": "MCULE-1308684767",
            "smiles": "C12SC3=C(CCCC3)C=1C(NC(SCC=C)=N2)=O",
            "url": "https://mcule.com/MCULE-1308684767/"
        }
    ]
}

The limit field accepts values between 1 and 1000, the default is 100.

Compound suppliers public API

You can get some very basic (public) information about our compound suppliers with this API.

Endpoint:
/compound-suppliers-public/
Example API request:
http https://mcule.com/api/v1/compound-suppliers-public/ "Authorization: Token <your_token>" --print HBhb
Example request:
GET /api/v1/compound-suppliers-public/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Example response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json

{
    "count": 115, 
    "next": "https://mcule.com/api/v1/compound-suppliers-public/?page=2", 
    "previous": null, 
    "results": [
        {
            "api_url": "https://mcule.com/api/v1/compound-suppliers-public/58/", 
            "catalogs": [
                {
                    "api_url": "https://mcule.com/api/v1/compound-catalogs-public/60/", 
                    "id": 60, 
                    "name": "Compound Cloud collection", 
                    "supplier": 58, 
                    "supplier_name": "BioAscent Discovery", 
                    "type": 30, 
                    "type_display": "Screening"
                }
            ], 
            "id": 58, 
            "name": "BioAscent Discovery", 
            "shipping_from_country": "", 
            "shipping_from_country_display": "", 
            "website": ""
        }, 
        
        ...
        
  ]
}

The detail API endpoint is also available on this endpoint:

/compound-suppliers-public/<supplier_id>/

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:
/compound-catalogs-public/
Example API request:
http https://mcule.com/api/v1/compound-catalogs-public/ "Authorization: Token <your_token>" --print HBhb
Example request:
GET /api/v1/compound-catalogs-public/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Connection: keep-alive
Example response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json

{
    "count": 205, 
    "next": "https://mcule.com/api/v1/compound-catalogs-public/?page=2", 
    "previous": null, 
    "results": [
        {
            "api_url": "https://mcule.com/api/v1/compound-catalogs-public/60/", 
            "id": 60, 
            "name": "Compound Cloud collection", 
            "supplier": 58, 
            "supplier_name": "BioAscent Discovery", 
            "type": 30, 
            "type_display": "Screening"
        }, 

        ...
        
    ]
}

The detail API endpoint is also available on this endpoint:

/compound-catalogs-public/<catalog_id>/

It will return a similar response as the above one but for an individual compound catalog.

Quote Request API

Endpoint:
/iquote-queries/
Example API request:
echo '{"customer_first_name": "John", "customer_last_name": "Doe", "delivery_country": "US", "mcule_ids": ["MCULE-2221628462", "MCULE-6824753328", "MCULE-1886826647", "MCULE-4609548851", "MCULE-7223347867"], "min_amount": null, "amount": 1}' | http https://mcule.com/api/v1/iquote-queries/ "Authorization: Token <your_token>" --print HBhb

Mandatory fields:

  • mcule_ids: List of mcule IDs of structures you want get a quote for.
  • customer_first_name: The customer's first name. It does not need to be specified if the user's first name is specified on the Edit profile page on mcule.com.
  • customer_last_name: The customer's last name. It does not need to be specified if the user's last name is specified on the Edit profile page on mcule.com.
  • delivery_country: ISO 3166-1 alpha-2 code of the delivery country.

Optional fields:

  • amount: Preferred amount per molecule (mg). (default: 1)
  • min_amount: Acceptable minimum amount (mg). (default: null)
  • target_volume: The target volume (in ml), in case of solution based amount.
  • target_cc: Target concentration (mM), in case of solution based amount.
  • extra_amount: In case of solution based amount calculation the preferred extra amount (in mg) can be specified here.
  • min_extra_amount: In case of solution based amount calculation the acceptable minimum extra amount (in mg) can be specified here.
  • customer_email: The customer's email address. By default it will be filled with the email address associated with the user making the API request.
  • delivery_time: Delivery time limit (working days). Door-to-door delivery time. Only offer molecules that are available within the specified number of working days. You can specify null if delivery time is not critical. (default: 21)
  • purity: Required minimum purity (%). (default: null)
  • higher_amounts: Set to true if you would like to get a quote for the compounds in the largest possible quantity in case they do not cost more than the specified amount. (default: false)
  • item_filters: Per query item filters. Currently it supports only supplier filtering. See example below.
  • scheme: If you have access to predefined / pre-negotiated quote request schemes, you can specify here which one you want to use. You have to send the ID of the scheme which will be provided to you after negotiation. A quote query scheme is essentially a template that contains predefined quote query parameters, or even include private parameters that affect quote generation in various ways (e.g.: discounts, predefined custom prices). These parameters can be customized for your use case. The scheme might already contain mandatory fields like delivery_country. In this case you don't have to specify them again, they will be applied from the scheme. Any explicitly specified public parameter during the request will override the one that comes from the specified scheme.

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 Compound suppliers Public API endpoint or the data is provided to you in another form (e.g.: exported database file that contains the information). If you specify a non-existing supplier ID, you should get a validation error.

{
  "MCULE-2221628462": {"suppliers": [3]},
  "MCULE-6824753328": {"suppliers": [3, 48]}
}

Advanced optional fields:

  • keep_original_salt_form: If false (by default), allow Mcule to deliver an alternative salt form if the original is not available. (default: false)
  • keep_original_tautomer_form: If false (by default), allow Mcule to deliver compounds drawn in alternative tautomer forms. Alternative tautomer forms are perceived by the system based on IUPAC InChI identifiers. (default: false)
  • keep_original_stereo_form: If false (by default), allow Mcule to deliver compounds drawn in alternative stereochemical forms. (default: false)
  • deliver_multiple_salt_forms: Deliver multiple salt forms or tautomers of the same compound. If false and the input contains duplicates, only a single salt form / tautomer will be kept (only effective when alternative salt or tautomer forms are allowed). (default: false)
Example request:
POST /api/v1/iquote-queries/ HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Content-Type: application/json

{
    "amount": 1, 
    "customer_first_name": "John", 
    "customer_last_name": "Doe", 
    "delivery_country": "US", 
    "mcule_ids": [
        "MCULE-2221628462", 
        "MCULE-6824753328", 
        "MCULE-1886826647", 
        "MCULE-4609548851", 
        "MCULE-7223347867"
    ], 
    "min_amount": null
}
Example response:
HTTP/1.1 201 CREATED
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json

{
    "amount": 1, 
    "api_url": "https://mcule.com/api/v1/iquote-queries/15029/", 
    "created": "2019-08-05T19:21:55.339011", 
    "customer_email": "", 
    "customer_first_name": "John", 
    "customer_last_name": "Doe", 
    "deliver_multiple_salt_forms": false, 
    "delivery_address": "", 
    "delivery_city": "", 
    "delivery_contact_person_email": "", 
    "delivery_contact_person_name": "", 
    "delivery_contact_person_phone": "", 
    "delivery_country": "US",
    "delivery_format_display": "Dry powder/film in supplier vial", 
    "delivery_post_code": "", 
    "delivery_time": 21, 
    "end_date": null, 
    "group": null, 
    "id": 15029, 
    "keep_original_salt_form": false, 
    "keep_original_stereo_form": false, 
    "keep_original_tautomer_form": false, 
    "min_amount": null, 
    "notes": "", 
    "promo_code": "", 
    "purity": null, 
    "site_url": "https://mcule.com/quote/query/15029/", 
    "start_date": null, 
    "state": 10, 
    "state_display": "Pending", 
    "target_cc": null, 
    "target_volume": null, 
    "user": 11
}

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://mcule.com/api/v1/iquote-queries/15029/ "Authorization: Token <your_token>" --print HBhb
Example request:
GET /api/v1/iquote-queries/15029/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Example response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json

{
    "amount": 1, 
    "api_url": "https://mcule.com/api/v1/iquote-queries/15029/", 
    "created": "2019-08-05T19:21:55.339011", 
    "customer_email": "", 
    "customer_first_name": "John", 
    "customer_last_name": "Doe", 
    "deliver_multiple_salt_forms": false, 
    "delivery_address": "", 
    "delivery_city": "", 
    "delivery_contact_person_email": "", 
    "delivery_contact_person_name": "", 
    "delivery_contact_person_phone": "", 
    "delivery_country": "US", 
    "delivery_format_display": "Dry powder/film in supplier vial", 
    "delivery_post_code": "", 
    "delivery_time": 21, 
    "end_date": "2019-08-05T19:22:13.109267", 
    "group": {
        "created": "2019-08-05T19:22:13.063732", 
        "id": 11647, 
        "query": 15029, 
        "quotes": [
            {
                "analytical_services_price": "0.00", 
                "api_url": "https://mcule.com/api/v1/iquotes/15679/", 
                "avg_product_price": 80.75, 
                "coverage_percent": 80, 
                "created": "2019-08-05T19:22:13.099143", 
                "delivery_days": 11, 
                "delivery_price": "194.16", 
                "description": "", 
                "discount": 0, 
                "duplicate_count": 0, 
                "extra_handling_price": "0.00", 
                "group": 11647, 
                "id": 15679, 
                "is_expired": false, 
                "is_saved": false, 
                "name": "", 
                "order_data": null, 
                "payment_due_days": 30, 
                "po_number": null, 
                "price": "551.04", 
                "product_discount_price": "0.00", 
                "products_price": "323.00", 
                "reference_id_full": "I-15679", 
                "reformatting_price": "0.00", 
                "shipping_price": "33.88", 
                "site_url": "https://mcule.com/quote/I-15679/", 
                "special_formatting_price": null, 
                "state": 10, 
                "state_display": "Displayed", 
                "stock_with_amount_ratio": 0, 
                "suppliers_count": 2, 
                "total_cost": 551.04, 
                "total_cost_without_discount": 551.04, 
                "total_discount_price": "0.00", 
                "type": 30, 
                "type_display": "Optimum", 
                "updated": "2019-08-05T19:22:13.099155", 
                "valid_until": "2019-09-04T19:22:13.099"
            }, 
            {
                "analytical_services_price": "0.00", 
                "api_url": "https://mcule.com/api/v1/iquotes/15678/", 
                "avg_product_price": 160.298, 
                "coverage_percent": 100, 
                "created": "2019-08-05T19:22:13.087753", 
                "delivery_days": 11, 
                "delivery_price": "339.47", 
                "description": "", 
                "discount": 0, 
                "duplicate_count": 0, 
                "extra_handling_price": "0.00", 
                "group": 11647, 
                "id": 15678, 
                "is_expired": false, 
                "is_saved": false, 
                "name": "", 
                "order_data": null, 
                "payment_due_days": 30, 
                "po_number": null, 
                "price": "1183.84", 
                "product_discount_price": "0.00", 
                "products_price": "801.49", 
                "reference_id_full": "I-15678", 
                "reformatting_price": "0.00", 
                "shipping_price": "42.88", 
                "site_url": "https://mcule.com/quote/I-15678/", 
                "special_formatting_price": null, 
                "state": 10, 
                "state_display": "Displayed", 
                "stock_with_amount_ratio": 0, 
                "suppliers_count": 3, 
                "total_cost": 1183.84, 
                "total_cost_without_discount": 1183.84, 
                "total_discount_price": "0.00", 
                "type": 20, 
                "type_display": "Fastest delivery", 
                "updated": "2019-08-05T19:22:13.087765", 
                "valid_until": "2019-09-04T19:22:13.087"
            }, 
            {
                "analytical_services_price": "0.00", 
                "api_url": "https://mcule.com/api/v1/iquotes/15677/", 
                "avg_product_price": 123.29, 
                "coverage_percent": 100, 
                "created": "2019-08-05T19:22:13.069027", 
                "delivery_days": 21, 
                "delivery_price": "311.16", 
                "description": "", 
                "discount": 0, 
                "duplicate_count": 0, 
                "extra_handling_price": "0.00", 
                "group": 11647, 
                "id": 15677, 
                "is_expired": false, 
                "is_saved": false, 
                "name": "", 
                "order_data": null, 
                "payment_due_days": 30, 
                "po_number": null, 
                "price": "967.41", 
                "product_discount_price": "0.00", 
                "products_price": "616.45", 
                "reference_id_full": "I-15677", 
                "reformatting_price": "0.00", 
                "shipping_price": "39.80", 
                "site_url": "https://mcule.com/quote/I-15677/", 
                "special_formatting_price": null, 
                "state": 10, 
                "state_display": "Displayed", 
                "stock_with_amount_ratio": 0, 
                "suppliers_count": 3, 
                "total_cost": 967.41, 
                "total_cost_without_discount": 967.41, 
                "total_discount_price": "0.00", 
                "tracking": null, 
                "type": 10, 
                "type_display": "Best price", 
                "updated": "2019-08-05T19:22:13.069039", 
                "valid_until": "2019-09-04T19:22:13.069"
            }
        ], 
        "site_url": "https://mcule.com/quote/group/11647/", 
        "updated": "2019-08-05T19:22:13.063747"
    }, 
    "id": 15029, 
    "keep_original_salt_form": false, 
    "keep_original_stereo_form": false, 
    "keep_original_tautomer_form": false, 
    "min_amount": null, 
    "notes": "", 
    "promo_code": "", 
    "purity": null, 
    "site_url": "https://mcule.com/quote/query/15029/", 
    "start_date": "2019-08-05T19:21:55.430800", 
    "state": 30, 
    "state_display": "Done", 
    "target_cc": null, 
    "target_volume": null, 
    "user": 11
}

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 “Fastest delivery” quote and an “Optimum” quote.

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://mcule.com/api/v1/iquotes/15677/ "Authorization: Token <your_token>" --print HBhb
Example request:
GET /api/v1/iquotes/15677/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Example response:
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Type: application/json

{
    "additional_document_notes": "",
    "amount_range": [1, 1],
    "amount_range_display": "1",
    "analytical_services_price": "0.00", 
    "api_url": "https://mcule.com/api/v1/iquotes/15677/", 
    "avg_product_price": 123.29, 
    "catalog_data": [
        {
            "avg_effective_price": -126.72333333333333,
            "catalog": 6, 
            "delivery_price": "86.95", 
            "delivery_time": 11, 
            "effective_price": "380.17",
            "effective_price_display": -380.17,
            "id": 90198, 
            "products_count": 3, 
            "products_price": "287.82", 
            "quote": 15677, 
            "reformatting_price": "0.00"
        }, 
        {
            "avg_effective_price": -144.45,
            "catalog": 156, 
            "delivery_price": "107.21", 
            "delivery_time": 10, 
            "effective_price": "144.45", 
            "effective_price_display": -144.45,
            "id": 90197, 
            "products_count": 1, 
            "products_price": "35.18", 
            "quote": 15677, 
            "reformatting_price": "0.00"
        }, 
        {
            "avg_effective_price": -416.37,
            "catalog": 202, 
            "delivery_price": "117.00", 
            "delivery_time": 21, 
            "effective_price": "416.37", 
            "effective_price": -416.37, 
            "id": 90196, 
            "products_count": 1, 
            "products_price": "293.45", 
            "quote": 15677, 
            "reformatting_price": "0.00"
        }
    ], 
    "coverage_percent": 100, 
    "created": "2019-08-05T19:22:13.069027", 
    "delivery_days": 21, 
    "delivery_price": "311.16", 
    "description": "", 
    "discount": 0, 
    "duplicate_count": 0, 
    "extra_handling_price": "0.00", 
    "group": 11647, 
    "id": 15677, 
    "is_expired": false, 
    "is_saved": false, 
    "items": [
        {
            "amount": 1, 
            "effective_price_display": -144.45,
            "id": 1740173, 
            "price": "144.45", 
            "product": 505393003,
            "product_available_amount": null,
            "product_available_amount_display": "In stock",
            "product_catalog_id": 156,
            "product_catalog_name": "Building Blocks", 
            "product_compound_mcule_id": "MCULE-1886826647", 
            "product_mcule_id": "P-505393003", 
            "product_price": "35.18", 
            "product_purity": 98, 
            "product_smiles": "CCC(NCC[C@H]1C2=C(C=CC3=C2CCO3)CC1)=O",
            "product_supplier_id": 37,
            "product_supplier_name": "AK Scientific",
            "quote": 15677, 
            "structure_origin": 346255984, 
            "structure_origin_mcule_id": "MCULE-1886826647"
        }, 
        {
            "amount": 1, 
            "effective_price_display": -97.32,
            "id": 1740172, 
            "price": "97.32", 
            "product": 346316287, 
            "product_available_amount": null,
            "product_available_amount_display": "In stock",
            "product_catalog_id": 6,
            "product_catalog_name": "Advanced Collection",
            "product_compound_mcule_id": "MCULE-3906582667", 
            "product_mcule_id": "P-346316287", 
            "product_price": "95.94", 
            "product_purity": 90, 
            "product_smiles": "CC1N(C(C2NCCC2)=O)CC(C2=C(C)C=CC=C2)C1.Cl",
            "product_supplier_id": 3,
            "product_supplier_name": "Enamine",
            "quote": 15677, 
            "structure_origin": 346316288, 
            "structure_origin_mcule_id": "MCULE-6824753328"
        }, 
        {
            "amount": 1, 
            "effective_price_display": -97.32,
            "id": 1740171, 
            "price": "97.32", 
            "product": 346567071, 
            "product_available_amount": null,
            "product_available_amount_display": "In stock",
            "product_catalog_id": 6,
            "product_catalog_name": "Advanced Collection",
            "product_compound_mcule_id": "MCULE-2221628462", 
            "product_mcule_id": "P-346567071", 
            "product_price": "95.94", 
            "product_purity": 90, 
            "product_smiles": "FC1=C(N2CC3=C(C=CC=C3)OCC2)N=CC=C1",
            "product_supplier_id": 3,
            "product_supplier_name": "Enamine",
            "quote": 15677, 
            "structure_origin": 346567072, 
            "structure_origin_mcule_id": "MCULE-2221628462"
        }, 
        {
            "amount": 1, 
            "effective_price_display": -97.32,
            "id": 1740170, 
            "price": "97.32", 
            "product": 346206264, 
            "product_available_amount": null,
            "product_available_amount_display": "In stock",
            "product_catalog_id": 6,
            "product_catalog_name": "Advanced Collection",
            "product_compound_mcule_id": "MCULE-7223347867", 
            "product_mcule_id": "P-346206264", 
            "product_price": "95.94", 
            "product_purity": 90,
            "product_smiles": "OC(C1(C2=C(C(F)(F)F)C=CC=C2)CC1)=O",
            "product_supplier_id": 3,
            "product_supplier_name": "Enamine", 
            "quote": 15677, 
            "structure_origin": 346206265, 
            "structure_origin_mcule_id": "MCULE-7223347867"
        }, 
        {
            "amount": 1, 
            "effective_price_display": -416.37,
            "id": 1740169, 
            "price": "416.37", 
            "product": 580505383, 
            "product_available_amount": null,
            "product_available_amount_display": "Potentially purchasable (60-80%)",
            "product_catalog_id": 202,
            "product_catalog_name": "Compounds on demand",
            "product_compound_mcule_id": "MCULE-4609548851", 
            "product_mcule_id": "P-580505383", 
            "product_price": "293.45", 
            "product_purity": null, 
            "product_smiles": "OC(C1(C2=C(C(F)(F)F)C=CC=C2)CC1)=O",
            "product_supplier_id": 33,
            "product_supplier_name": "Manchester Organics",
            "quote": 15677, 
            "structure_origin": 346209969, 
            "structure_origin_mcule_id": "MCULE-4609548851"
        }
    ], 
    "name": "", 
    "order_data": null, 
    "payment_due_days": 30, 
    "po_number": null, 
    "price": "967.41", 
    "price_items": [
        {
            "attr": "product_discount", 
            "name": "Product discount (0%)", 
            "price": 0.0
        }, 
        {
            "attr": "delivery_price_final", 
            "name": "Shipping (from 3 suppliers to Mcule)", 
            "price": 311.16
        }, 
        {
            "attr": "shipping_price_final", 
            "name": "Shipping & package consolidation", 
            "price": 39.8
        }, 
        {
            "attr": "reformatting_price_final", 
            "name": "Reformatting", 
            "price": 0
        }, 
        {
            "attr": "analytical_services_price_final", 
            "name": "Analytical services", 
            "price": 0
        }, 
        {
            "attr": "extra_handling_price_final", 
            "name": "Extra handling", 
            "price": 0
        }, 
        {
            "attr": "total_discount_price", 
            "name": "Total discount (0%)", 
            "price": 0.0
        }
    ], 
    "product_discount_price": "0.00", 
    "products_price": "616.45", 
    "query": {
        "amount": 1, 
        "api_url": "https://mcule.com/api/v1/iquote-queries/15029/", 
        "created": "2019-08-05T19:21:55.339011", 
        "customer_email": "", 
        "customer_first_name": "John", 
        "customer_last_name": "Doe", 
        "deliver_multiple_salt_forms": false, 
        "delivery_address": "", 
        "delivery_city": "", 
        "delivery_contact_person_email": "", 
        "delivery_contact_person_name": "", 
        "delivery_contact_person_phone": "", 
        "delivery_country": "US", 
        "delivery_format_display": "Dry powder/film in supplier vial",
        "delivery_post_code": "", 
        "delivery_time": 21, 
        "end_date": "2019-08-05T19:22:13.109267", 
        "group": 11647, 
        "id": 15029, 
        "keep_original_salt_form": false, 
        "keep_original_stereo_form": false, 
        "keep_original_tautomer_form": false, 
        "min_amount": null, 
        "notes": "", 
        "promo_code": "", 
        "purity": null, 
        "site_url": "https://mcule.com/quote/query/15029/", 
        "start_date": "2019-08-05T19:21:55.430800", 
        "state": 30, 
        "state_display": "Done", 
        "target_cc": null, 
        "target_volume": null, 
        "user": 11
    }, 
    "reference_id_full": "I-15677", 
    "reformatting_price": "0.00", 
    "shipping_price": "39.80", 
    "site_url": "https://mcule.com/quote/I-15677/", 
    "special_formatting_price": null, 
    "state": 10, 
    "state_display": "Displayed", 
    "stock_with_amount_ratio": 0, 
    "supplier_data": [
        {
            "delivery_price": "86.95", 
            "delivery_time": 10, 
            "effective_price": "380.17", 
            "effective_price_display": -380.17, 
            "id": 69668, 
            "products_count": 3, 
            "products_price": "287.82", 
            "quote": 15677, 
            "reformatting_price": "0.00", 
            "supplier": 3, 
            "supplier_po_deadline_days": 19, 
            "supplier_po_handling_fee": "0.00", 
            "supplier_po_products_price": "221.40"
        }, 
        {
            "delivery_price": "107.21", 
            "delivery_time": 9, 
            "effective_price": "144.45", 
            "effective_price_display": -144.45, 
            "id": 69669, 
            "products_count": 1, 
            "products_price": "35.18", 
            "quote": 15677, 
            "reformatting_price": "0.00", 
            "supplier": 37, 
            "supplier_po_deadline_days": 19, 
            "supplier_po_handling_fee": "0.00", 
            "supplier_po_products_price": "25.00"
        }, 
        {
            "delivery_price": "117.00", 
            "delivery_time": 20, 
            "effective_price": "416.37", 
            "effective_price_display": -416.37, 
            "id": 69667, 
            "products_count": 1, 
            "products_price": "293.45", 
            "quote": 15677, 
            "reformatting_price": "0.00", 
            "supplier": 33, 
            "supplier_po_deadline_days": 19, 
            "supplier_po_handling_fee": "0.00", 
            "supplier_po_products_price": "225.73"
        }
    ], 
    "suppliers_count": 3, 
    "total_cost": 967.41, 
    "total_cost_without_discount": 967.41, 
    "total_discount_price": "0.00", 
    "tracking": null, 
    "type": 10, 
    "type_display": "Best price", 
    "updated": "2019-08-05T19:22:13.069039", 
    "valid_until": "2019-09-04T19:22:13.069"
}
Fields:

Where currency is not specified, it is always USD.

  • additional_document_notes: additional document notes if there are any
  • amount_range: Amount / product (mg), min - max product amounts as a list
  • amount_range_display: Amount / product (mg) as string
  • analytical_services_price: price of analytical services (USD)
  • avg_product_price: Average product price (USD)
  • catalog_data: list of catalog level data
    • products_count: Number of products from this catalog
    • products_price: Total product price of this catalog (USD)
    • effective_price_display: Total price change if excluded this catalog. (USD) It shows how the total price will change upon removal of the catalog. In addition to the product price, this may include delivery cost, packaging fees, small / minimum order fees, etc.
    • avg_effective_price: Average price change upon exclusion of one product (USD).
    • delivery_time: Delivery time (work. days)
    • quote: The ID of the quote this catalog level quote data belongs to.
  • coverage_percent: How many of the query molecules appear in the quote. E.g. if your query contains 10 molecules and you get a quote for 9, it is 90%.
  • created: The creation datetime of the quote.
  • delivery_days: Estimated delivery time. Number of working days after purchase order accepted.
  • delivery_price: Shipping cost from suppliers to Mcule (USD)
  • duplicate_count: Number of duplicates in the query.
  • extra_handling_price: Extra handling cost (USD)
  • group:
  • id: The ID of the Instant Quote.
  • is_expired: Whether the quote is expired.
  • is_saved: Whether the quote is saved. Quotes created via the API are not saved.
  • items: list of product level data
    • amount: Quoted amount (mg)
    • effective_price_display: Total price change if excluded this product. (USD) It shows how the total price will change upon removal of the product. In addition to the product price, this may include delivery cost, packaging fees, small / minimum order fees, etc
    • price: effective price
    • product_available_amount: concrete available amount (mg) data if available,
    • product_available_amount_display: availability display, e.g.: In stock, Potentially purchasable (60-80%),
    • product_mcule_id: The mcule ID of the quoted product.
    • product: The ID of the quoted product (should be neglected).
    • product_compound_mcule_id: The compound level structures' mcule ID of the quoted product.
    • product_delivery_time: Delivery time (working days)
    • product_price: Product price (USD)
    • product_purity: Minimum purity (%)
    • product_smiles: SMILES of the product
    • structure_origin_mcule_id: The mcule ID of the query molecule.
    • 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: If the quote has been ordered, data related to the purchase order is provided here.
    • billing_address: Billing address
    • billing_city: Billing city
    • billing_company_name: Billing Institution / Company name
    • billing_country: Billing country
    • billing_post_code: Billing ZIP / Post code
    • billing_state: Billing State / Province
    • billing_email: Billing contact email
    • billing_first_name: Billing contact first name
    • billing_last_name: Billing contact last name
    • billing_phone: Billing contact phone number
    • billing_same: Whether the billing data is the same is shipping data
    • billing_vat: Billing VAT number
    • shipping_address: Shipping address
    • shipping_city: shipping city
    • shipping_company_name: Shipping Institution / Company name
    • shipping_country: Shipping country
    • shipping_post_code: Shipping ZIP / Post code
    • shipping_state: Shipping State / Province
    • shipping_email: Shipping contact email
    • shipping_first_name: Shipping contact first name
    • shipping_last_name: Shipping contact last name
    • shipping_phone: Shipping contact phone number
    • notes: notes
    • po_number: Customer Purchase Order number
    • po_file_filename: In case a Purchase Order file was submitted, the name of the filename.
    • po_option: Purchase Order option (10: Upload PO, 20: Order without PO, 30: Send PO later)
    • po_option_display: Purchase Order option as string
    • created: Datetime when the purchase order was submitted
    • updated: Datetime when the purchase order data was updated
    • id: ID of the purchase order data
  • payment_due_days: Payment terms. Number of days net or prepayment by credit card
  • price: Total price of quote (USD)
  • price_items: The list of price items. They are only used for display purposes basically.
  • product_discount_price: Discount of products price (USD).
  • products_price: Price of products (USD)
  • query: The quote query fields
  • reference_id_full: The full reference ID of the instant quote.
  • reformatting_price: Reformatting price (USD)
  • shipping_price: Shipping & handling cost (USD)
  • site_url: The quote's URL to view on mcule.com site.
  • special_formatting_price: Special reformatting price (USD)
  • state: State code of the quote.
  • state_display: Human readable state of the quote.
  • supplier_data: list of supplier level data
    • delivery_price: Shipping cost (USD)
    • delivery_time: Delivery time (working days)
    • effective_price: Total price change if excluded this supplier. (USD) It shows how the total price will change upon removal of the supplier. In addition to the product price, this may include delivery cost, packaging fees, small / minimum order fees, etc.
    • avg_effective_price: Average price change upon exclusion of one product from this supplier (USD).
    • products_count: Number of products from this supplier.
    • products_price: Total product price of this supplier (USD)
    • quote: The ID of the quote this supplier quote data belongs to.
    • reformatting_price: Reformatting price (USD)
    • supplier: The ID of the supplier this supplier quote data belongs to.
  • suppliers_count: Number of suppliers
  • total_cost: Total cost (USD)
  • total_cost_without_discount: Total cost without discount (USD)
  • total_discount_price: Total discount price (USD)
  • type: Type code of the quote.
  • type_display: Human readable type of the quote.
  • updated: The update datetime the quote.
  • valid_until: The datetime until the quote is valid.

Quote - Missing structures

You can get the missing structures along with the reason of their exclusion.

http https://mcule.com/api/v1/iquotes/<quote_id>/missing/ "Authorization: Token <your_token>"

And it will return a similar response to this:

{
    "results": [
        {
            "data": {
                "MCULE-6224850672": "No instant quotable products"
            }, 
            "id": 4, 
            "quote": 125, 
            "structure": 167312, 
            "structure_mcule_id": "MCULE-6224850672"
        }, 
        {
            "data": {
                "MCULE-7173925849": "No instant quotable products"
            }, 
            "id": 5, 
            "quote": 125, 
            "structure": 135326, 
            "structure_mcule_id": "MCULE-7173925849"
        }, 
        {
            "data": {
                "P-282184": "Purity filtering", 
                "P-307415": "Purity filtering"
            }, 
            "id": 6, 
            "quote": 125, 
            "structure": 201510, 
            "structure_mcule_id": "MCULE-9519333144"
        }
    ]
}

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 Content-Disposition attachment; filename=“<filename>” header indicating that it should be downloaded.

http https://mcule.com/api/v1/iquotes/15677/download-pdf/ "Authorization: Token <your_token>" --download

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 Content-Disposition attachment; filename=“<filename>” header indicating that it should be downloaded.

http https://mcule.com/api/v1/iquotes/15677/download-excel/ "Authorization: Token <your_token>" --download

Quote order

Submit purchase order for a quote via API.

http --form POST https://mcule.com/api/v1/iquotes/15677/order/ po_option=10 po_file@~/po.pdf "Authorization: Token <your_token>" --print HBhb
Example request:
POST /api/v1/iquotes/15677/order/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Token <your_token>
Content-Type: multipart/form-data; boundary=b582e4472c434fd6b30b265ffef125e8

+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+

Please note that in case you submit a file in the API request, you have to use Content-Type: multipart/form-data as you can see at the above request.

If you don't submit a file in the API request, you can use Content-Type: application/json :

echo '{"po_option": 20, "shipping_country": "US", "shipping_first_name": "John", "shipping_last_name": "Doe"}' | http https://mcule.com/api/v1/iquotes/15677/order/ "Authorization: Token <your_token>" --print HBhb
Example request:
POST /api/v1/iquotes/15677/order/ HTTP/1.1
Accept: application/json, */*
Authorization: Token <your_token>
Content-Type: application/json
{
    "po_option": 20,
    "shipping_country": "US",
    "shipping_first_name": "John",
    "shipping_last_name": "Doe"
}

Mandatory fields:

  • po_option: Purchase Order option (10: Upload PO, 20: Order without PO, 30: Send PO later)

Optional fields:

  • billing_address: Billing address
  • billing_city: Billing city
  • billing_company_name: Billing Institution / Company name
  • billing_country: Billing country
  • billing_post_code: Billing ZIP / Post code
  • billing_state: Billing State / Province
  • billing_email: Billing contact email
  • billing_first_name: Billing contact first name
  • billing_last_name: Billing contact last name
  • billing_phone: Billing contact phone number
  • billing_same: Whether the billing data is the same as shipping data
  • billing_vat: Billing VAT number
  • shipping_address: Shipping address
  • shipping_city: Shipping city
  • shipping_company_name: Shipping Institution / Company name
  • shipping_country: Shipping country
  • shipping_post_code: Shipping ZIP / Post code
  • shipping_state: Shipping State / Province
  • shipping_email: Shipping contact email
  • shipping_first_name: Shipping contact first name
  • shipping_last_name: Shipping contact last name
  • shipping_phone: Shipping contact phone number
  • notes: notes
  • po_number: Customer Purchase Order number
  • po_file: Purchase Order document file.

The address and contact fields are optional if this information is included in the Purchase Order document or will be provided later to our support team. Although providing the shipping and billing address / contact information here can speed up the ordering process, if you decide to leave them empty, our support team will contact you to reconcile this information.

Subsequent calls to this same endpoint make it possible to update the purchase order information. You can also report incorrect data at order@mcule.com. Please make sure you reference the quote's Full reference ID (reference_id_full field in the corresponding API response) in your email.

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://bitbucket.org/mcule/mcule_api_usage_examples/

We'll probably extend this repository with new examples later.

api.1651242034.txt.gz · Last modified: 2022/04/29 16:20 by flack