Call ChEMBL Data Web Service Directly

Provides a tutorial example on how to call ChEMBL data Web services directly with the 'curl' command.

If you want to call ChEMBL Web Services directly with HTTPS GET/POST protocols, you can follow this tutorial.

1. Make sure you have "curl" installed on your computer.

2. Get a list of all records of a given resource with a GET request.

(syntax)
curl https://www.ebi.ac.uk/chembl/api/data/{resource}

(example)
herong$ curl https://www.ebi.ac.uk/chembl/api/data/molecule

<response>
  <molecules>
    <molecule>
      <molecule_chembl_id>CHEMBL6329</molecule_chembl_id>
      <molecule_properties>
        <alogp>2.11</alogp>
        <aromatic_rings>3</aromatic_rings>
        <full_molformula>C17H12ClN3O3</full_molformula>
        <full_mwt>341.75</full_mwt>
      </molecule_properties>
      <molecule_structures>
        <canonical_smiles>Cc1cc(-n2ncc(=O)[nH]...</canonical_smiles>
        <molfile>
            ...

3. Get a single resource with the resource id.

(syntax)
curl https://www.ebi.ac.uk/chembl/api/data/{resource}/{id}

(example)
herong$ curl https://www.ebi.ac.uk/chembl/api/data/molecule/CHEMBL6329

<molecule>
  <molecule_chembl_id>CHEMBL6329</molecule_chembl_id>
  <molecule_properties>
    <alogp>2.11</alogp>
    <aromatic_rings>3</aromatic_rings>
    <full_molformula>C17H12ClN3O3</full_molformula>
    <full_mwt>341.75</full_mwt>
  </molecule_properties>
  <molecule_structures>
    <canonical_smiles>Cc1cc(-n2ncc(=O)[nH]...</canonical_smiles>
    <molfile>
      ...

4. Filter resource records with a keyword.

(syntax)
curl https://www.ebi.ac.uk/chembl/api/data/{resource}/search?q={keyword}

(example)
herong$ curl https://www.ebi.ac.uk/chembl/api/data/molecule/search?q=aspirin

<response>
    <molecules>
        <molecule>
            <cross_references>
                <molecule>
                    <xref_id>aspirin</xref_id>
                    <xref_name>aspirin</xref_name>
                    <xref_src>DailyMed</xref_src>
                </molecule>
                ...

5. Filter with resource records with other filters:

https://www.ebi.ac.uk/chembl/api/data/target?pref_name__iregex=(cdk1|cdk2)
https://www.ebi.ac.uk/chembl/api/data/target?target_type__exact=SINGLE+PROTEIN

6. Get result in JSON format.

(syntax)
curl https://www.ebi.ac.uk/chembl/api/data/{resource}?format=json​

(example)
herong$ curl https://www.ebi.ac.uk/chembl/api/data/molecule?format=json​

For more information, see ChEMBL Data Web Services specifications at https://chembl.gitbook.io/chembl-interface-documentation/web-services/chembl-data-web-services.

Table of Contents

 About This Book

 Introduction of Molecules

 Molecule Names and Identifications

 Molecule Mass and Weight

 Protein and Amino Acid

 Nucleobase, Nucleoside, Nucleotide, DNA and RNA

 Gene and Chromosome

 Protein Kinase (PK)

 DNA Sequencing

 Gene Mutation

 SDF (Structure Data File)

 PyMol Installation

 PyMol GUI and CLI

 PyMol Selections

 PyMol Editing Functions

 PyMol Measurement Functions

 PyMol Movie Functions

 PyMol Python Integration

 PyMol Object Functions

ChEMBL Database - European Molecular Biology Laboratory

 What Is ChEMBL

 ChEMBL Speical Web Portals

 Download ChEMBL Database

 ChEMBL FTP Repository

 ChEMBL Web Services API

Call ChEMBL Data Web Service Directly

 ChEMBL Data Resource - molecule

 ChEMBL Data Resource - activity

 ChEMBL Data Resource - assay

 ChEMBL Data Resource - document

 ChEMBL Data Resource - target

 ChEMBL Data Resource - chembl_id_lookup

 ChEMBL Related Tools

 chembl_webresource_client - Python Client

 chembl_webresource_client - Usage Examples

 chembl_webresource_client - RetryError Exception

 ChEMBL Terminologies

 PubChem Database - National Library of Medicine

 PDB (Protein Data Bank)

 INSDC (International Nucleotide Sequence Database Collaboration)

 HGNC (HUGO Gene Nomenclature Committee)

 Relocated Tutorials

 Resources and Tools

 Molecule Related Terminologies

 References

 Full Version in PDF/EPUB