ChEMBL logo

ChEMBL

spacer
ChEMBL Statistics
  Loading Statistics...
spacer

ChEMBL Web Services

Web Service Update (February 2015)

A new version of the ChEMBL web services are now available, which expose significantly more data from the under underlying ChEMBL database and introduce new functionality. In addition to the web services that provide access to ChEMBL data, web services that provide access to commonly used cheminformatic methods are also available.

Web Services Documentation

Online interactive documentation is available for both ChEMBL web services:


ChEMBL Web Service Type Documentation
ChEMBL Data https://www.ebi.ac.uk/chembl/api/data/docs
Cheminformatic Utils (aka 'ChEMBL Beaker') https://www.ebi.ac.uk/chembl/api/utils/docs

ChEMBL Data Web Services

The updated ChEMBL web services are not compatible with the previous version of the ChEMBL web services. For this reason we still provide access to the earlier version and the older documentation. We encourage users to migrate any applications using the previous ChEMBL web services to the updated version described on this page.


Getting Started

To best way to get started is to have a look at some example URLs requesting data from the ChEMBL web services. The table below provides a list of examples and a description of the data being returned.


Description Example URL
Return all molecules https://www.ebi.ac.uk/chembl/api/data/molecule
Keyword search for targets that contain 'cyclin' in pref_name https://www.ebi.ac.uk/chembl/api/data/target?pref_name__contains=cyclin
Return molecules with molecular weight <= 300 https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_properties__mw_freebase__lte=300
Return molecules with molecular weight <= 300 AND pref_name ends with nib https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_properties__mw_freebase__lte=300&pref_name__iendswith=nib
Return image for CHEMBL25 https://www.ebi.ac.uk/chembl/api/data/image/CHEMBL25
Substructure search with SMILES CC(=O)Oc1ccccc1C(=O)O (Aspirin) https://www.ebi.ac.uk/chembl/api/data/substructure/CC(=O)Oc1ccccc1C(=O)O
Similarity search with SMILES CN1C(=O)C=C(c2cccc(Cl)c2)c3cc(ccc13)[C@@](N)(c4ccc(Cl)cc4)c5cncn5C with 80% tanimoto similarity cut off https://www.ebi.ac.uk/chembl/api/data/similarity/CN1C(=O)C=C(c2cccc(Cl)c2)c3cc(ccc13)[C@@](N)(c4ccc(Cl)cc4)c5cncn5C/80

Resources

The following table provides a list of all ChEMBL web service resources currently available.


Resource Name Description URL
Activity Activity values recorded in an Assay https://www.ebi.ac.uk/chembl/api/data/activity
Assay Assay details as reported in source Document/Dataset https://www.ebi.ac.uk/chembl/api/data/assay
ATC WHO ATC Classification for drugs https://www.ebi.ac.uk/chembl/api/data/atc_class
BindingSite Target binding site definition https://www.ebi.ac.uk/chembl/api/data/binding_site
Biotherapeutic Biotherapeutic molecules, which includes HELM notation and sequence data https://www.ebi.ac.uk/chembl/api/data/biotherapeutic
CellLine Cell line information https://www.ebi.ac.uk/chembl/api/data/cell_line
ChEMBLIdLookup Look up ChEMBL Id entity type https://www.ebi.ac.uk/chembl/api/data/chembl_id_lookup
Document Document/Dataset from which Assays have been extracted https://www.ebi.ac.uk/chembl/api/data/document
Image Graphical (png, svg, json) representation of Molecule https://www.ebi.ac.uk/chembl/api/data/image/CHEMBL1
Mechanism Mechanism of action information for FDA-approved drugs https://www.ebi.ac.uk/chembl/api/data/mechanism
Molecule Molecule information, including properties, structural representations and synonyms https://www.ebi.ac.uk/chembl/api/data/molecule
MoleculeForm Relationships between molecule parents and salts https://www.ebi.ac.uk/chembl/api/data/molecule_form
ProteinClassification Protein family classification of TargetComponents https://www.ebi.ac.uk/chembl/api/data/protein_class
Substructure Molecule substructure search https://www.ebi.ac.uk/chembl/api/data/substructure/CN%28CCCN%29c1cccc2ccccc12
Similarity Molecule similarity search https://www.ebi.ac.uk/chembl/api/data/similarity/CC%28=O%29Oc1ccccc1C%28=O%29O/70
Source Document/Dataset source https://www.ebi.ac.uk/chembl/api/data/source
Target Targets (protein and non-protein) defined in Assay https://www.ebi.ac.uk/chembl/api/data/target
TargetComponent Target sequence information (A Target may have 1 or more sequences) https://www.ebi.ac.uk/chembl/api/data/target_component

Meta Data and Pagination

It is now possible to download all data from a specific ChEMBL web service resource. This is made possible by returning responses from the web services in 'pages', which can be navigated through using a 'page_meta' section. The 'page_meta' section includes information about total number of hits, total number of pages and links to the next and previous pages. An example 'page_meta' section is displayed below:

"page_meta": {

    "limit": 20,
    "next": "/chembl/api/data/activity.json?limit=20&offset=20",
    "offset": 0,
    "previous": null,
    "total_count": 13520737

}
To download all ChEMBL activity endpoints (>13 million), the following URL can be used: https://www.ebi.ac.uk/chembl/api/data/activity. By inspecting the the 'page_meta' section the link to page 2 can be found, e.g. https://www.ebi.ac.uk/chembl/api/data/activity?limit=20&offset=20.


Filtering and Ordering

It is possible to apply search filters to all resource requests using a URL friendly query language. For example, it is possible to return all ChEMBL targets that contain the term 'kinase' in the pref_name attribute with the following URL: https://www.ebi.ac.uk/chembl/api/data/target?pref_name__contains=kinase.

The pattern for applying a filter is as follows:

https://www.ebi.ac.uk/chembl/api/data/[resource]?[field]__[filter_type]=[value]

Examples of other filter type are listed in the table below.


Filter Type Description Example URL
exact (iexact) Exact match with query https://www.ebi.ac.uk/chembl/api/data/assay?assay_type__exact=B
contains (icontains) Wild card search with query https://www.ebi.ac.uk/chembl/api/data/assay?description__icontains=toxicity
startswith (istartswith) Starts with query https://www.ebi.ac.uk/chembl/api/data/target?pref_name__istartswith=serotonin
endswith (iendswith) Ends with query https://www.ebi.ac.uk/chembl/api/data/cell_line?cell_source_tissue__iendswith=carcinoma
regex (iregex) Regular expression query https://www.ebi.ac.uk/chembl/api/data/target?pref_name__iregex=(cdk1|cdk2)
gt (gte) Greater than (or equal) https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_properties__full_mwt__gte=100
lt (lte) Less than (or equal) https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_properties__alogp__lte=5
range Within a range of values https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_properties__full_mwt__range=200,500
in Appears within list of query values https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_chembl_id__in=CHEMBL25,CHEMBL941,CHEMBL1000
isnull Field is null https://www.ebi.ac.uk/chembl/api/data/molecule?helm_notation__isnull=false

To order the results returned by a particular field the 'order=[field]' argument as added to a request. For example a user can sort targets based on the pref_name using the following URL: https://www.ebi.ac.uk/chembl/api/data/target?order_by=pref_name

The default ordering is in ascending order. To return the results in descending orede place a '-' before the field name: https://www.ebi.ac.uk/chembl/api/data/target?order_by=-pref_name

Note that it is possible combine order_by and filter arguments:https://www.ebi.ac.uk/chembl/api/data/target?pref_name__contains=kinase&order_by=-pref_name


Chemical Searching

The 'Substructure' and 'Similarity' web service resources allow for the chemical content of ChEMBL to be searched. Similar to the other resources, these search based resources except filtering, paging and ordering arguments. These methods accept SMILES, InChI Key and molecule ChEMBL_ID as arguments and in the case of similarity searches an additional identity cut-off is needed. Some example molecule searches are provided in the table below.


Chemical Search Description Example URL
Substructure search for against ChEMBL using aspirin SMILES string https://www.ebi.ac.uk/chembl/api/data/substructure/CC(=O)Oc1ccccc1C(=O)O
Substructure search for against ChEMBL using aspirin CHEMBL_ID https://www.ebi.ac.uk/chembl/api/data/substructure/CHEMBL25
Substructure search for against ChEMBL using aspirin InChI Key https://www.ebi.ac.uk/chembl/api/data/substructure/BSYNRYMUTXBXSQ-UHFFFAOYSA-N
Similarity (80% cut off) search for against ChEMBL using aspirin SMILES string https://www.ebi.ac.uk/chembl/api/data/similarity/CC(=O)Oc1ccccc1C(=O)O/80
Similarity (80% cut off) search for against ChEMBL using aspirin CHEMBL_ID https://www.ebi.ac.uk/chembl/api/data/similarity/CHEMBL25/80
Similarity (80% cut off) search for against ChEMBL using aspirin InChI Key https://www.ebi.ac.uk/chembl/api/data/similarity/BSYNRYMUTXBXSQ-UHFFFAOYSA-N/80

Searching with InChI key is only possible for InChI keys found in the ChEMBL database. The system does not try and convert InChI key to a chemical representation.


Molecule Images

The Image resource returns a graphical representation of a ChEMBL molecule. Unlike the other resources it does not except filtering and paging arguments, but does except image specific arguments. These are defined in the table below.


Image Argument Description Allowed Values Default Value Example URL
format Image format png, svg and json png https://www.ebi.ac.uk/chembl/api/data/image/CHEMBL25?format=svg
dimensions Size of image in pixels 1-500 500 https://www.ebi.ac.uk/chembl/api/data/image/CHEMBL25?dimensions=200
ignoreCoords Choose to use or ignore coordinates in ChEMBL molfiles 1 or 0 0 (Use ChEMBL molfile coordinates) https://www.ebi.ac.uk/chembl/api/data/image/CHEMBL25?ignoreCoords=1
engine Chemical toolkit used to generate image rdkit or indigo rdkit https://www.ebi.ac.uk/chembl/api/data/image/CHEMBL25?engine=indigo

Web Service Client

To help users get started with using the updated ChEMBL web services the existing web service client has also been released. This is written in the Python programming language and is available to download from GitHub.


Example Queries

The table below provides a list of example searches a user may wish to carry out using the ChEMBL web services. The aim of the list is highlight the type of data that can be retrieved from ChEMBL using the web services. The examples can be adapted, extended and chained togther to build up more complex workflows.


Description Example URL
Get all approved drugs https://www.ebi.ac.uk/chembl/api/data/molecule?max_phase=4
Get all molecules in ChEMBL with no Rule-of-Five violations https://www.ebi.ac.uk/chembl/api/data/molecule?molecule_properties__num_ro5_violations=0
Get all biotherapeutic molecules https://www.ebi.ac.uk/chembl/api/data/molecule?biotherapeutic__isnull=false
Get all functional/phenotypic assays (assay_type=F), from the literature (src_id 1) https://www.ebi.ac.uk/chembl/api/data/assay?assay_type=F&src_id=1
Get all binding assays (assay_type=B), which also contain the term 'insulin' https://www.ebi.ac.uk/chembl/api/data/assay?assay_type=B&description__icontains=insulin
Get all Clearance activity values (standard_type=CL), for rat, mouse and human https://www.ebi.ac.uk/chembl/api/data/activity?standard_type=CL&target_organism__in=Homo%20sapiens,Rattus%20norvegicus,Mus%20musculus
Get all cell lines, which end with the term 'carcinoma' https://www.ebi.ac.uk/chembl/api/data/cell_line?cell_source_tissue__iendswith=carcinoma
Get all mechanism of action details muscarinic acetylcholine receptor antagonists https://www.ebi.ac.uk/chembl/api/data/mechanism?mechanism_of_action__icontains=Muscarinic%20acetylcholine%20receptor&action_type=ANTAGONIST
Get all targets (single protein, protein complexes, protein families etc.), which contain UniProt accession Q13936 https://www.ebi.ac.uk/chembl/api/data/target?target_components__accession=Q13936
Get the entity type for CHEMBL1000 https://www.ebi.ac.uk/chembl/api/data/chembl_id_lookup?chembl_id=CHEMBL1000

Use Cases

The following use cases is provided as an example of how it is possible chain together ChEMBL web service calls to awnser to complicated questions usin ChEMBL data.

Investigating the potency of approved drugs against their efficacy targets

Since ChEMBL includes both mechanism of action information for approved drugs and pharmacology data from published assays, it is interesting to combine this information and investigate the potency of a drug against its efficacy target. This might be done either to confirm or refute the proposed target assignment, or to better understand how the in-vitro potency of a compound might relate to clinical efficacy or ADMET properties. The following example shows how this type of analysis could be carried out using the ChEMBL web services.

  1. Use the molecule end point to retrieve a list of approved drugs (max_phase=4):

    https://www.ebi.ac.uk/chembl/api/data/molecule?max_phase=4

    Using ChEMBL_20, this will retrieve 2795 drugs in total. We will use CHEMBL998 (loratadine) as an example, but the same workflow could be repeated for the others.


  2. Use the mechanism end point to retrieve the mechanism of action and target of each drug:

    https://www.ebi.ac.uk/chembl/api/data/mechanism?molecule_chembl_id=CHEMBL998

    Loratadine is reported to be a histamine H1 receptor antagonist, represented by the ChEMBL target CHEMBL231.


  3. Use the assay end point to identify any binding assays (assay_type=B) for the human histamine H1 receptor:

    https://www.ebi.ac.uk/chembl/api/data/assay?target_chembl_id=CHEMBL231&relationship_type=D&assay_type=B

    Note the relationship_type=D filter restricts the results to assays where we are confident that the human receptor was tested and not an orthologue. A total of 213 assays are identified. We will take CHEMBL1909156 as an example.


  4. Combine the results of the above queries to identify any potency measurements for loratadine in these assays:

    https://www.ebi.ac.uk/chembl/api/data/activity?molecule_chembl_id=CHEMBL998&assay_chembl_id=CHEMBL1909156

    This assay reports an IC50 value of 170nM and a Ki measurement of 20nM for loratadine against the histamine H1 receptor.

    This process could be repeated for the other 212 assays by either iterating through them individually or, where a sufficiently small number of assays are returned, using the __in filter on the activity end point to retrieve several assays at once e.g.,

    https://www.ebi.ac.uk/chembl/api/data/activity?molecule_chembl_id=CHEMBL998&assay_chembl_id__in=CHEMBL830379,CHEMBL1909156,CHEMBL882906,CHEMBL691450

    An additional 2 assays are identified in this way, reporting an IC50 value of 290nM and a Ki value of 414nM. These values could be averaged, or the lowest taken, to give an indication of the average potency of the compound, or the assay conditions could be investigated further to try to identify which assay might be most reliable or informative (the ChEMBL identifier for the document from which the data are extracted is also provided by the activity end point).

Cheminformatic Utils Web Services

In addition to the described data-focused web services, a utility web service that provides RESTful access to commonly used cheminformatic methods has been released. These web services have been developed under the name 'ChEMBL Beaker' and provide users with access chemical property calculators (e.g. molecular weight), structure format converters (e.g. molfile to SMILES) and a structure standardiser. The methods being exposed by this service are providing RESTful interface to the RDKit cheminformatics library. These services also provide access to methods that extract chemical information from images. The OSRA library is used to expose this functionality. Online documentation is available is available.

spacer
spacer