Chemspace API: Difference between revisions

From DISI
Jump to navigation Jump to search
(Created page with "This is a quick guide on how to use Chemspace API to get pricing information. Link to Chem-space's API https://api.chem-space.com/docs/ == Email info@chem-space.com to obtain...")
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 11: Line 11:
   "expires_in":3600,
   "expires_in":3600,
   "api_key":"<API Key>" }
   "api_key":"<API Key>" }
 
<b>API key and access_token are not the same. API Key can only be used to obtain access token. Access token expires in 1 hour.</b>
== Search ==
== Search ==
Here is a list of catalogs searchable on Chem-Space and their identifiers. You can look up more than one catalogs by specified them under categories argument separated by comma
Here is a list of catalogs searchable on Chem-Space and their identifiers. You can look up more than one catalogs by specified them under categories argument separated by comma
  CSSS (In-stock Screening Compounds)
  CSSS (In-stock Screening Compounds)
  CSMS (Make-On-Demand Screening Compounds)
  CSMS (Make-On-Demand Screening Compounds)
CSCS (Custom Request)
  CSSB (In-Stock Building Blocks)
  CSSB (In-Stock Building Blocks)
  CSMB (Make-On-Demand Building Blocks)
  CSMB (Make-On-Demand Building Blocks)
=== By Exact Smiles ===
=== By Exact Smiles ===
Example:
Example (look up exact CC(N)=O from Custom Request and Make-On-Demand BB catalogs) :
  curl -X POST \
  curl -X POST \
   "https://api.chem-space.com/v3/search/exact?count=3&page=1&categories=CSCS,CSMB" \
   "https://api.chem-space.com/v3/search/exact?count=3&page=1&categories=CSCS,CSMB" \
Line 26: Line 27:
   -H  "Content-Type: multipart/form-data" \
   -H  "Content-Type: multipart/form-data" \
   -F  "SMILES=CC(N)=O"
   -F  "SMILES=CC(N)=O"
OUTPUT:
{
  "count": 3,
  "filtered": 1014,
  "all": 1014,
  "items": [
    {
      "csId": "CSCS00011325247",
      "link": "https://chem-space.com/CSCS00011325247",
      "smiles": "CNC(=O)C=C",
      "molFormula": "C4H7NO",
      "cas": "1187-59-3",
      "mfcd": "MFCD00053693",
      "properties": {
        "mw": 85.106,
        "hac": 6,
        "logp": -0.050319255333333,
        "rotb": 1,
        "hba": 1,
        "hbd": 1,
        "ringCount": 0,
        "fsp3": 0.25,
        "tpsa": 29.1
      },
      "offerCount": 4,
      "offers": [
        {
          "vendorName": "Alichem",
          "vendorCode": "A490019437",
          "shipsWithin": 42,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": 276,
              "priceEur": 232
            },
            {
              "pack": 5,
              "uom": "g",
              "priceUsd": 805,
              "priceEur": 676
            }
          ]
        },
        {
          "vendorName": "Angel Pharmatech Ltd.",
          "vendorCode": "AG112245",
          "shipsWithin": null,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": null,
              "priceEur": null
            }
          ]
        },
        {
          "vendorName": "Arctom Chemicals LLC",
          "vendorCode": "AC003290",
          "shipsWithin": null,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": null,
              "priceEur": null
            }
          ]
        },
        {
          "vendorName": "Advanced Organic Synthesis, LLC",
          "vendorCode": "AOS00HEPL",
          "shipsWithin": 20,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": null,
              "priceEur": null
            }
          ]
        }
      ]
    },
    {
      "csId": "CSSB00011997587",
      "link": "https://chem-space.com/CSSB00011997587",
      "smiles": "CC1CC(=O)N1",
      "molFormula": "C4H7NO",
      "cas": "5303-64-0",
      "mfcd": "MFCD06217521",
      "properties": {
        "mw": 85.106,
        "hac": 6,
        "logp": -0.45169547866667,
        "rotb": 0,
        "hba": 1,
        "hbd": 1,
        "ringCount": 1,
        "fsp3": 0.75,
        "tpsa": 29.1
      },
      "offerCount": 2,
      "offers": [
        {
          "vendorName": "UORSY",
          "vendorCode": "BBV-38288479",
          "shipsWithin": 2,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": 785,
              "priceEur": 748
            },
            {
              "pack": 2.5,
              "uom": "g",
              "priceUsd": 1539,
              "priceEur": 1465
            },
            {
              "pack": 5,
              "uom": "g",
              "priceUsd": 2277,
              "priceEur": 2168
            },
            {
              "pack": 10,
              "uom": "g",
              "priceUsd": 3376,
              "priceEur": 3215
            }
          ]
        },
        {
          "vendorName": "Enamine Ltd",
          "vendorCode": "EN300-1251051",
          "shipsWithin": 2,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": 785,
              "priceEur": 748
            },
            {
              "pack": 2.5,
              "uom": "g",
              "priceUsd": 1539,
              "priceEur": 1465
            },
            {
              "pack": 5,
              "uom": "g",
              "priceUsd": 2277,
              "priceEur": 2168
            },
            {
              "pack": 10,
              "uom": "g",
              "priceUsd": 3376,
              "priceEur": 3215
            }
          ]
        }
      ]
    },
    {
      "csId": "CSCS00020675986",
      "link": "https://chem-space.com/CSCS00020675986",
      "smiles": "CC(=O)N1CC1",
      "molFormula": "C4H7NO",
      "cas": "460-07-1",
      "mfcd": null,
      "properties": {
        "mw": 85.106,
        "hac": 6,
        "logp": -0.75446114,
        "rotb": 0,
        "hba": 1,
        "hbd": 0,
        "ringCount": 1,
        "fsp3": 0.75,
        "tpsa": 20.08
      },
      "offerCount": 1,
      "offers": [
        {
          "vendorName": "BOC Sciences",
          "vendorCode": "118576",
          "shipsWithin": null,
          "purity": 95,
          "prices": [
            {
              "pack": 1,
              "uom": "g",
              "priceUsd": null,
              "priceEur": null
            }
          ]
        }
      ]
    }
  ]
}


=== By Substructure ===
=== By Substructure ===
Line 253: Line 38:


=== By Similarity ===
=== By Similarity ===
Example:
curl -X POST \
  "https://api.chem-space.com/v3/search/sim?count=2&page=6&categories=CSSS,CSMS" \
  -H  "Accept: application/json; version=3.1" \
  -H  "Authorization: Bearer <access_token>" \
  -H  "Content-Type: multipart/form-data" \
  -F  "SMILES=CC(N)=O"
=== By Compound ID ===
It can look up by
* CSMB00000000001 - Chemspace ID
* CSC000000065 - old Chemspace ID
* 60-35-5 - CAS
* MFCD06217521 - MFCD
* CSC1=NN=NN1C - SMILES
* BBV-32027078 - vendor ID
Example:
curl -X POST \
  "https://api.chem-space.com/v3/search/text?count=3&page=2&categories=CSMB" \
  -H  "Accept: application/json; version=3.1" \
  -H  "Authorization: Bearer <access_token>" \
  -H  "Content-Type: multipart/form-data" \
  -F  "query=CSMB00000000001, CSC000000065, 60-35-5, MFCD06217521, CSC1=NN=NN1C, BBV-32027078"

Latest revision as of 22:56, 12 April 2022

This is a quick guide on how to use Chemspace API to get pricing information. Link to Chem-space's API https://api.chem-space.com/docs/

Email info@chem-space.com to obtain API Key

Get Access Token

Now that you have obtained the access token. You will use the command below to get the API Key (please replace <API Key> with your own API Key)

curl -X GET \
 "https://api.chem-space.com/auth/token" \
 -H  "Accept: application/json" \
 -H  "Authorization: Bearer <API Key>"
* Output will look like this
{"access_token":"<access_token>",
 "expires_in":3600,
 "api_key":"<API Key>" }

API key and access_token are not the same. API Key can only be used to obtain access token. Access token expires in 1 hour.

Search

Here is a list of catalogs searchable on Chem-Space and their identifiers. You can look up more than one catalogs by specified them under categories argument separated by comma

CSSS (In-stock Screening Compounds)
CSMS (Make-On-Demand Screening Compounds)
CSCS (Custom Request)
CSSB (In-Stock Building Blocks)
CSMB (Make-On-Demand Building Blocks)

By Exact Smiles

Example (look up exact CC(N)=O from Custom Request and Make-On-Demand BB catalogs) :

curl -X POST \
 "https://api.chem-space.com/v3/search/exact?count=3&page=1&categories=CSCS,CSMB" \
 -H  "Accept: application/json; version=3.1" \
 -H  "Authorization: Bearer <access_token>" \
 -H  "Content-Type: multipart/form-data" \
 -F  "SMILES=CC(N)=O"

By Substructure

Example:

curl -X POST \
 "https://api.chem-space.com/v3/search/sub?count=3&page=18&categories=CSSB,CSCS" \
 -H  "Accept: application/json; version=3.1" \
 -H  "Authorization: Bearer <access_token>" \
 -H  "Content-Type: multipart/form-data" \
 -F  "SMILES=CC(N)=O"

By Similarity

Example:

curl -X POST \
 "https://api.chem-space.com/v3/search/sim?count=2&page=6&categories=CSSS,CSMS" \
 -H  "Accept: application/json; version=3.1" \
 -H  "Authorization: Bearer <access_token>" \
 -H  "Content-Type: multipart/form-data" \
 -F  "SMILES=CC(N)=O"

By Compound ID

It can look up by

  • CSMB00000000001 - Chemspace ID
  • CSC000000065 - old Chemspace ID
  • 60-35-5 - CAS
  • MFCD06217521 - MFCD
  • CSC1=NN=NN1C - SMILES
  • BBV-32027078 - vendor ID
Example:
curl -X POST \
 "https://api.chem-space.com/v3/search/text?count=3&page=2&categories=CSMB" \
 -H  "Accept: application/json; version=3.1" \
 -H  "Authorization: Bearer <access_token>" \
 -H  "Content-Type: multipart/form-data" \
 -F  "query=CSMB00000000001, CSC000000065, 60-35-5, MFCD06217521, CSC1=NN=NN1C, BBV-32027078"