Chemspace API

From DISI
Jump to navigation Jump to search

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"