chembl-search-molecules
chembl_search_moleculesDiscovery entry point for compounds. Find by name / ChEMBL ID / InChIKey with the default search_type=name (supply query), or run a structure search with search_type exact | similarity | substructure (supply structure as a SMILES). At least one of query or structure is required, and structure is required for the three structure modes. Returns ChEMBL ID, preferred name, canonical SMILES, formula, MW, AlogP, Lipinski violations, QED, and max clinical phase on every row; only search_type=similarity adds a Tanimoto similarity percent. Chain molecule_chembl_id into chembl_get_bioactivities or chembl_get_drug_info. A capped result carries nextCursor — pass it back as cursor with the same filters to read the next page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum molecules to return. Defaults to the server default (25) when omitted. | |
| query | No | Search text for search_type=name — a drug name, ChEMBL ID, or InChIKey, e.g. "imatinib" or "CHEMBL25". | |
| cursor | No | Opaque continuation token from a previous call's nextCursor — resumes where that page ended. Omit for the first page. Re-send the same query/structure/filters that minted it (only limit may change; it sets this page's size); redeeming it against different filters walks a different result set. | |
| structure | No | SMILES string for structure search, e.g. "CC(=O)Oc1ccccc1C(=O)O". Required when search_type is exact/similarity/substructure. | |
| search_type | No | name = text lookup (query); exact = exact structure match; similarity = Tanimoto ≥ threshold; substructure = contains the structure. All structure modes need `structure`. | name |
| max_phase_min | No | For search_type=name, restrict to compounds at or above this max clinical phase (e.g. 4 for marketed drugs only). | |
| similarity_threshold | No | Minimum Tanimoto similarity percent for search_type=similarity (40–100; ChEMBL rejects below 40). Ignored for other modes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The limit that was applied. | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Number of molecules returned. | |
| notice | No | Guidance when nothing matched — echoes the query and suggests how to broaden. | |
| molecules | No | Matching compounds (up to the limit). | |
| truncated | No | True when the result was capped at the limit. | |
| nextCursor | No | Opaque token for the next page — pass it back as cursor with the same filters. Absent when this page is the last one. | |
| totalCount | No | Total compounds matching before the limit was applied. |