User Tools

Site Tools


ultimate-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ultimate-api [2020/07/20 14:19] flackultimate-api [2021/05/25 14:21] flack
Line 225: Line 225:
 </code> </code>
  
-In case of similarity searches the **tan** value contains the similarity value.+In case of similarity searches the **tan** value the response contains the similarity value. 
 + 
 +In case of similarity searches you can control the minimum similarity with the **sim_threshold** param. Its default  value is 0.7. Its minimum value is also 0.7 unless you are allowed to use a lower value. For example: 
 +<code> 
 +
 +    "query":
 +        "type": "sim", 
 +        "query": "C(N1C(C(OC2CCCN(C3=CC=CC=C3)C2)=O)CN(C)C1=O)(=O)C(=C)CN1CCOCC1", 
 +        "limit": 5, 
 +        "sim_threshold": 0.8 
 +    } 
 +
 +</code>
  
  
Line 304: Line 316:
     "count": 5     "count": 5
 } }
 +</code>
 +
 +
 +====== Compounds API ======
 +
 +===== Compound details =====
 +
 +For example for the compound identified by the InChIKey **PKGBDLPHSYFAFJ-UHFFFAOYSA-N** you can get the detail response the following way:
 +
 +== Example API request: ==
 +<code>http https://ultimateapp.mcule.com/api/v1/compounds/PKGBDLPHSYFAFJ-UHFFFAOYSA-N/ --print HBhb</code>
 +
 +== Request: ==
 +<code>
 +GET /api/v1/compounds/PKGBDLPHSYFAFJ-UHFFFAOYSA-N/ HTTP/1.1                                                                                                          
 +</code>
 +
 +== Response: ==
 +<code>
 +HTTP/1.1 200 OK                                                                                                                                                      Content-Type: application/json                                                                                                                                       
 +
 +{
 +    "archived_at": null,
 +    "inchi_key": "PKGBDLPHSYFAFJ-UHFFFAOYSA-N",
 +    "mol": "\n  -INDIGO-05252114022D\n\n 31 35  0  0  0  0  0  0  0  0999 V2000\n   -4.4450   -1.7960    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -4.2778   -0.2047    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -5.5722    0.7357    0.0000 O    0  0  0  0  0  0  0  0  0  0  0\n   -7.0339    0.0849    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -7.2011   -1.5063    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -8.6628   -2.1571    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -9.9572   -1.2166    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -9.7900    0.3746    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -8.3283    1.0254    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -11.4189   -1.8674    0.0000 O    0  0  0  0  0  0  0  0  0  0  0\n  -12.7133   -0.9270    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -14.1750   -1.5777    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -14.3423   -3.1690    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -15.8039   -3.8198    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -17.0983   -2.8793    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -16.9311   -1.2881    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n  -15.4694   -0.6373    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -2.8161    0.4460    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -2.6489    2.0373    0.0000 O    0  0  0  0  0  0  0  0  0  0  0\n   -1.5217   -0.4944    0.0000 N    0  0  0  0  0  0  0  0  0  0  0\n   -1.5217   -2.0944    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    0.0000   -2.5889    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    0.9405   -1.2944    0.0000 N    0  0  0  0  0  0  0  0  0  0  0\n    0.0000    0.0000    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    0.9405    1.2944    0.0000 N    0  0  0  0  0  0  0  0  0  0  0\n    2.4621    0.8000    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    3.8478    1.6000    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    5.2334    0.8000    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    5.2334   -0.8000    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    3.8478   -1.6000    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    2.4621   -0.8000    0.0000 C    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  1  0  0  0  0\n  4  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  4  2  0  0  0  0\n  7 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 13 14  2  0  0  0  0\n 14 15  1  0  0  0  0\n 15 16  2  0  0  0  0\n 16 17  1  0  0  0  0\n 17 12  2  0  0  0  0\n  2 18  1  0  0  0  0\n 18 19  2  0  0  0  0\n 18 20  1  0  0  0  0\n 20 21  1  0  0  0  0\n 21 22  1  0  0  0  0\n 22 23  1  0  0  0  0\n 23 24  1  0  0  0  0\n 24 20  1  0  0  0  0\n 24 25  2  0  0  0  0\n 25 26  1  0  0  0  0\n 26 27  1  0  0  0  0\n 27 28  2  0  0  0  0\n 28 29  1  0  0  0  0\n 29 30  2  0  0  0  0\n 30 31  1  0  0  0  0\n 31 23  1  0  0  0  0\n 31 26  2  0  0  0  0\nM  END\n",
 +    "properties": {
 +        "OandN_atom_count": 6,
 +        "acidic_and_basic_group_count": 0,
 +        "acidic_group_count": 0,
 +        "aliphatic_rings": 1,
 +        "aromatic_rings": 4,
 +        "basic_group_count": 0,
 +        "c_atom_count": 25,
 +        "chiral_centers": 1,
 +        "cis/trans_stereo_double_bonds": 0,
 +        "formula": "C25H23N3O3",
 +        "fsp3": 0.2,
 +        "h_atom_count": 23,
 +        "h_bond_acceptors": 6,
 +        "h_bond_donors": 0,
 +        "halogen_atom_count": 0,
 +        "heavy_atom_count": 31,
 +        "hetero_atom_count": 6,
 +        "heteroatom_ratio": 0.24,
 +        "logp": 4.494400000000002,
 +        "mol_mass": 413.46718999999996,
 +        "non-organic_atom_count": 0,
 +        "non_cyclic_amide_count": 0,
 +        "nso_atom_count": 6,
 +        "psa": 56.59,
 +        "rings": 5,
 +        "ro3_violations": 4,
 +        "ro5_violations": 0,
 +        "rotatable_bonds": 7,
 +        "stereo_double_bonds": 0,
 +        "undefined_stereo_double_bonds": 0,
 +        "unknown_stereo_double_bonds": 0
 +    },
 +    "smiles": "C(N1CCN2C3=C(N=C12)C=CC=C3)(=O)C(C)OC1=CC=C(OCC2=CC=CC=C2)C=C1"
 +}
 +</code>
 +
 +===== Compounds export =====
 +
 +If you have a set of identifiers you can export the corresponding compounds into SMILES or SDF files.
 +
 +==== SDF file: ====
 +
 +<code>
 +echo '{"export_type": "sdf", "compounds": ["YTIUNGFRKPDPPS-UHFFFAOYSA-N", "SSEIGWFVYLDHEH-UHFFFAOYSA-N"]}' | http https://ultimateapp.mcule.com/api/v1/compounds/export/ --print HBhb
 +</code>
 +
 +== Request: ==
 +<code>
 +POST /api/v1/compounds/export/ HTTP/1.1
 +Content-Type: application/json
 +
 +{
 +    "compounds": [
 +        "YTIUNGFRKPDPPS-UHFFFAOYSA-N",
 +        "SSEIGWFVYLDHEH-UHFFFAOYSA-N"
 +    ],
 +    "export_type": "sdf"
 +}
 +</code>
 +
 +
 +== Response: ==
 +<code>
 +HTTP/1.1 200 OK
 +Content-Type: chemical/x-mdl-sdfile
 +Content-Disposition: attachment; filename="mcule_ultimate_export.sdf"
 +</code>
 +
 +
 +
 +==== SMILES file: ====
 +
 +<code>
 +echo '{"export_type": "smi", "compounds": ["YTIUNGFRKPDPPS-UHFFFAOYSA-N", "SSEIGWFVYLDHEH-UHFFFAOYSA-N"]}' | http https://ultimateapp.mcule.com/api/v1/compounds/export/ --print HBhb
 +</code>
 +
 +== Request: ==
 +<code>
 +POST /api/v1/compounds/export/ HTTP/1.1
 +Content-Type: application/json
 +
 +{
 +    "compounds": [
 +        "YTIUNGFRKPDPPS-UHFFFAOYSA-N",
 +        "SSEIGWFVYLDHEH-UHFFFAOYSA-N"
 +    ],
 +    "export_type": "smi"
 +}
 +</code>
 +
 +
 +== Response: ==
 +<code>
 +HTTP/1.1 200 OK
 +Content-Type: chemical/x-daylight-smiles
 +Content-Disposition: attachment; filename="mcule_ultimate_export.smi"
 </code> </code>
  
Line 321: Line 455:
 == Example API request: == == Example API request: ==
 <code> <code>
-echo '{"compounds": ["VKCCTPSYCYARFI-UHFFFAOYSA-N", "DVPXLZBGJCHMEO-UHFFFAOYSA-N", "XKJIOIJSLLCDOZ-UHFFFAOYSA-N", "XVWBPPRZAKJXSY-UHFFFAOYSA-N", "ZNOWNQHKOHUYLP-UHFFFAOYSA-N", "IEJBADVRNXRNLB-UHFFFAOYSA-N", "LZRUMHHZJMDZLR-UHFFFAOYSA-N", "PTKVKZOBUQFOJX-UHFFFAOYSA-N", "LFHNTOJEMXUDKP-UHFFFAOYSA-N", "SICGQCSMIMRHLF-UHFFFAOYSA-N", "YGLRUSPDEQEHKM-UHFFFAOYSA-N"], "amount": 1, "currency":"USD", individual": true}' | http https://ultimateapp.mcule.com/api/v1/pricing/ --print HBhb+echo '{"compounds": ["VKCCTPSYCYARFI-UHFFFAOYSA-N", "DVPXLZBGJCHMEO-UHFFFAOYSA-N", "XKJIOIJSLLCDOZ-UHFFFAOYSA-N", "XVWBPPRZAKJXSY-UHFFFAOYSA-N", "ZNOWNQHKOHUYLP-UHFFFAOYSA-N", "IEJBADVRNXRNLB-UHFFFAOYSA-N", "LZRUMHHZJMDZLR-UHFFFAOYSA-N", "PTKVKZOBUQFOJX-UHFFFAOYSA-N", "LFHNTOJEMXUDKP-UHFFFAOYSA-N", "SICGQCSMIMRHLF-UHFFFAOYSA-N", "YGLRUSPDEQEHKM-UHFFFAOYSA-N"], "amount": 1, "currency":"USD", "individual": true}' | http https://ultimateapp.mcule.com/api/v1/pricing/ --print HBhb
 </code> </code>
  
Line 799: Line 933:
  
 Check for the **quotes** field. If it is there and contains some items in the list, we could generate some quotes for your quote query. As you can see from the above result, we could generate 1 quote for the quote query. A "Best price" quote. Check for the **quotes** field. If it is there and contains some items in the list, we could generate some quotes for your quote query. As you can see from the above result, we could generate 1 quote for the quote query. A "Best price" 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 //9//:
 +
 +<code>
 +http https://ultimateapp.mcule.com/api/v1/iquotes/9/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Example request: ===
 +<code>
 +GET /api/v1/iquotes/9/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +</code>
 +
 +== Example response: ===
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "additional_document_notes": "",
 +    "api_url": "https://ultimateapp.mcule.com/api/v1/iquotes/9/",
 +    "avg_product_price": "667.74",
 +    "avg_product_price_currency": "USD",
 +    "coverage_percent": 100,
 +    "created_at": "2020-07-20T14:01:30.506962Z",
 +    "id": 9,
 +    "items": [
 +        {
 +            "amount": 1,
 +            "compound": {
 +                "archived_at": null,
 +                "inchi_key": "RAQLVHPPDXCQDS-UHFFFAOYSA-N",
 +                "smiles": "C(NC1=C(C#N)C=C(C#N)C=N1)(=O)C1N=C(N2CCN(C3=CC=CC=C3)CC2)SC=1"
 +            },
 +            "product_price": 637.27,
 +            "product_price_currency": "USD",
 +            "purity_percent": 90
 +        },
 +        {
 +            "amount": 1,
 +            "compound": {
 +                "archived_at": null,
 +                "inchi_key": "QWPFQODIGUYSLE-UHFFFAOYSA-N",
 +                "smiles": "C(N(C(CSCC1OC=CC=1)=O)C1=C(C(F)(F)F)C=CC=C1)(=O)CCC1=NOC=C1"
 +            },
 +            "product_price": 698.21,
 +            "product_price_currency": "USD",
 +            "purity_percent": 90
 +        }
 +    ],
 +    "payment_due_days": 30,
 +    "price_items": [
 +        {
 +            "attr": "products_price",
 +            "name": "Products price",
 +            "price": 1335.48,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "product_discount",
 +            "name": "Product discount (0%)",
 +            "price": 0.0,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "shipping_price",
 +            "name": "Shipping & package consolidation",
 +            "price": 51.09,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "reformatting_price",
 +            "name": "Reformatting",
 +            "price": 0.0,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "total_discount_price",
 +            "name": "Total discount (0%)",
 +            "price": 0.0,
 +            "price_currency": "USD"
 +        }
 +    ],
 +    "product_discount_price": null,
 +    "product_discount_price_currency": "USD",
 +    "products_price": 1335.48,
 +    "products_price_currency": "USD",
 +    "query": {
 +        "amount": 1,
 +        "api_url": "https://ultimateapp.mcule.com/api/v1/iquote-queries/9/",
 +        "created_at": "2020-07-20T14:01:30.412763Z",
 +        "currency": "USD",
 +        "customer_email": "foo@bar.com",
 +        "customer_name": "John Doe",
 +        "delivery_country": {
 +            "code": "US",
 +            "name": "United States of America"
 +        },
 +        "delivery_format": 0,
 +        "delivery_format_display": "Dry powder/film in supplier vial",
 +        "ended_at": "2020-07-20T14:01:30.514096Z",
 +        "extra_amount": null,
 +        "id": 9,
 +        "notes": "",
 +        "purity": null,
 +        "scheme": 1,
 +        "started_at": "2020-07-20T14:01:30.464496Z",
 +        "state": 30,
 +        "state_display": "Done",
 +        "target_cc": null,
 +        "target_volume": null,
 +        "user": 2
 +    },
 +    "reference_id_full": "UI-9",
 +    "reformatting_price": null,
 +    "reformatting_price_currency": "USD",
 +    "selection_criteria": 10,
 +    "selection_criteria_display": "Best price",
 +    "shipping_price": 51.09,
 +    "shipping_price_currency": "USD",
 +    "state": 10,
 +    "state_display": "Displayed",
 +    "total_discount_price": null,
 +    "total_discount_price_currency": "USD",
 +    "total_price": 1386.57,
 +    "total_price_currency": "USD",
 +    "valid_until": "2020-08-19T14:01:30.506962Z"
 +}
 +</code>
 +
 +== Fields: ===
 +  * **additional_document_notes**: Additional document notes
 +  * **avg_product_price**: Average product price
 +  * **avg_product_price_currency**: Currency of average product price
 +  * **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_at**: The creation datetime of the quote.
 +  * **id**: The ID of the Instant Quote.
 +  * **items**: list of product level data
 +    * **amount**: Quoted amount (mg)
 +    * **compound**: the quoted compound
 +    * **product_price**: product price
 +    * **product_price_currency**: currency of product price
 +    * **purity_percent**: Guaranteed purity (%)
 +  * **payment_due_days**: Payment terms. Number of days net or prepayment by credit card
 +  * **price_items**: The list of price items. They are only used for display purposes basically.
 +  * **product_discount_price**: Discount of products price
 +  * **product_discount_price_currency**: Currency of discount of products price
 +  * **products_price**: Price of products
 +  * **products_price_currency**: Currency of price of products
 +  * **query**: The quote query fields
 +  * **reference_id_full**: The full reference ID of the instant quote.
 +  * **reformatting_price**: Reformatting price (USD)
 +  * **reformatting_price_currency**: Currency of reformatting price
 +  * **selection_criteria**: Selection criteria code of the quote.
 +  * **selection_criteria_display**: Human readable selection criteria of the quote.
 +  * **shipping_price**: Shipping & handling cost
 +  * **shipping_price_currency**: Currency of Shipping & handling cost
 +  * **state**: State code of the quote.
 +  * **state_display**: Human readable state of the quote.
 +  * **total_discount_price**: Total discount price
 +  * **total_discount_price_currency**: Currency of total discount price
 +  * **total_price**: Total price of quote
 +  * **total_price_currency**: Currency of the total price
 +  * **valid_until**: The datetime until the quote is valid.
 +  
 +==== 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.
 +
 +<code>
 +http https://ultimateapp.mcule.com/api/v1/iquotes/9/download-pdf/ "Authorization: Token <your_token>" --download
 +</code>
 +
 +==== 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.
 +
 +<code>
 +http https://ultimateapp.mcule.com/api/v1/iquotes/9/download-excel/ "Authorization: Token <your_token>" --download
 +</code>
 +
  
  
  
ultimate-api.txt · Last modified: 2021/05/25 14:27 by flack