# /chembl/molecules/search

`POST /api/chembl/molecules/search`

Price: 20 credits

Search ChEMBL molecules by text and by structural, clinical and drug-status filters

## How to use it

`query` matches names, synonyms, trade names and research codes; every other field is an exact database filter, and they are combined with AND, so a filter-only request needs no `query`. `name` is a substring of the preferred name while `synonym` must match a whole synonym, which is why a trade name usually needs `synonym`. Rows are the same shape the single-molecule endpoint returns, so no follow-up fetch is needed for structures or calculated properties.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `query` (string, nullable) — Free text matched against preferred names, synonyms, trade names and research codes (examples: "aspirin", "kinase inhibitor"; minLength: 1)
- `name` (string, nullable) — Substring of the preferred name, case-insensitive (examples: "statin"; minLength: 1)
- `synonym` (string, nullable) — Exact synonym, trade name or research code, case-insensitive (examples: "aspirin", "BAY1019036"; minLength: 1)
- `molecule_ids` (array, nullable) — Restrict the answer to these ChEMBL molecule identifiers (examples: ["CHEMBL25","CHEMBL192"])
- `molecule_type` (string, nullable) — Kind of substance the record describes (one of: "Small molecule", "Protein", "Antibody", "Oligosaccharide", "Oligonucleotide", "Enzyme", "Cell", "Gene", "Unclassified", "Unknown")
- `max_phase` (number, nullable) — Highest clinical phase reached, 4 meaning an approved drug (examples: 4; min: 0; max: 4)
- `min_max_phase` (number, nullable) — Keep molecules that reached at least this clinical phase (examples: 3; min: 0; max: 4)
- `first_approval_year_min` (integer, nullable) — Earliest year of first regulatory approval (examples: 2000; min: 1900)
- `first_approval_year_max` (integer, nullable) — Latest year of first regulatory approval (examples: 2020; min: 1900)
- `min_weight` (number, nullable) — Lowest freebase molecular weight in daltons (examples: 200; min: 0)
- `max_weight` (number, nullable) — Highest freebase molecular weight in daltons (examples: 500; min: 0)
- `max_rule_of_five_violations` (integer, nullable) — Highest number of Lipinski rule-of-five violations to keep (examples: 0; min: 0; max: 4)
- `chirality` (integer, nullable) — ChEMBL chirality code: 0 racemic, 1 single enantiomer, 2 achiral, -1 unknown (examples: 1; min: -1; max: 2)
- `usan_stem` (string, nullable) — USAN stem shared by a naming class, written with its hyphen (examples: "-azosin", "-vastatin"; minLength: 1)
- `is_therapeutic` (boolean, nullable) — Molecule is used therapeutically
- `is_dosed_ingredient` (boolean, nullable) — Molecule appears as a dosed ingredient of a medicine
- `is_oral` (boolean, nullable) — Administered orally
- `is_parenteral` (boolean, nullable) — Administered parenterally
- `is_topical` (boolean, nullable) — Administered topically
- `is_withdrawn` (boolean, nullable) — Withdrawn from at least one market
- `is_natural_product` (boolean, nullable) — Derived from a natural product
- `is_prodrug` (boolean, nullable) — Administered as a prodrug
- `is_polymer` (boolean, nullable) — Record describes a polymer
- `is_inorganic` (boolean, nullable) — Record describes an inorganic compound
- `is_veterinary` (boolean, nullable) — Used in veterinary medicine
- `is_first_in_class` (boolean, nullable) — First approved drug of its mechanism
- `is_chemical_probe` (boolean, nullable) — Curated as a chemical probe
- `is_orphan_drug` (boolean, nullable) — Carries an orphan drug designation
- `has_black_box_warning` (boolean, nullable) — Carries a black box warning
- `sort` (string, nullable) — Result ordering (one of: "molecule_chembl_id", "-molecule_chembl_id", "pref_name", "-pref_name", "max_phase", "-max_phase", "first_approval", "-first_approval", "molecule_properties__mw_freebase", "-molecule_properties__mw_freebase")
- `count` (integer, required) — Max number of results (min: 1; max: 5000)

## Response

### 200 — Successful Response

- `@type` (string) (default: "ChemblMolecule")
- `id` (string) (default: "")
- `name` (string) (default: "")
- `molecule_type` (string) (default: "")
- `structure_type` (string) (default: "")
- `chirality` (integer, nullable)
- `availability_type` (integer, nullable)
- `max_phase` (number, nullable)
- `first_approval_year` (integer, nullable)
- `usan_year` (integer, nullable)
- `usan_stem` (string) (default: "")
- `usan_substem` (string) (default: "")
- `usan_stem_definition` (string) (default: "")
- `atc_classifications` (array) (default: [])
- `helm_notation` (string) (default: "")
- `is_therapeutic` (boolean, nullable)
- `is_dosed_ingredient` (boolean, nullable)
- `is_first_in_class` (boolean, nullable)
- `is_prodrug` (boolean, nullable)
- `is_natural_product` (boolean, nullable)
- `is_polymer` (boolean, nullable)
- `is_inorganic` (boolean, nullable)
- `is_veterinary` (boolean, nullable)
- `is_chemical_probe` (boolean, nullable)
- `is_orphan_drug` (boolean, nullable)
- `is_withdrawn` (boolean, nullable)
- `has_black_box_warning` (boolean, nullable)
- `is_oral` (boolean, nullable)
- `is_parenteral` (boolean, nullable)
- `is_topical` (boolean, nullable)
- `properties` (object, nullable)
  - `@type` (string) (default: "ChemblMoleculeProperties")
  - `full_molecular_formula` (string) (default: "")
  - `full_weight` (number, nullable)
  - `freebase_weight` (number, nullable)
  - `alogp` (number, nullable)
  - `psa` (number, nullable)
  - `qed_weighted` (number, nullable)
  - `np_likeness_score` (number, nullable)
  - `aromatic_ring_count` (integer, nullable)
  - `heavy_atom_count` (integer, nullable)
  - `hydrogen_bond_acceptor_count` (integer, nullable)
  - `hydrogen_bond_donor_count` (integer, nullable)
  - `rotatable_bond_count` (integer, nullable)
  - `rule_of_five_violation_count` (integer, nullable)
  - `is_rule_of_three_pass` (boolean, nullable)
- `structures` (object, nullable)
  - `@type` (string) (default: "ChemblMoleculeStructures")
  - `smiles` (string) (default: "")
  - `inchi` (string) (default: "")
  - `inchi_key` (string) (default: "")
  - `molfile` (string) (default: "")
- `hierarchy` (object, nullable)
  - `@type` (string) (default: "ChemblMoleculeHierarchy")
  - `molecule_id` (string) (default: "")
  - `parent_molecule_id` (string) (default: "")
  - `active_molecule_id` (string) (default: "")
- `synonyms` (array) (default: [])
  - `@type` (string) (default: "ChemblMoleculeSynonym")
  - `name` (string) (default: "")
  - `type` (string) (default: "")
- `cross_references` (array) (default: [])
  - `@type` (string) (default: "ChemblCrossReference")
  - `source` (string) (default: "")
  - `id` (string) (default: "")
  - `name` (string) (default: "")
- `biotherapeutic` (object, nullable)
  - `@type` (string) (default: "ChemblBiotherapeutic")
  - `molecule_id` (string) (default: "")
  - `description` (string) (default: "")
  - `helm_notation` (string) (default: "")
  - `components` (array) (default: [])
    - `@type` (string) (default: "ChemblBiocomponent")
    - `component_id` (string) (default: "")
    - `type` (string) (default: "")
    - `description` (string) (default: "")
    - `organism` (string) (default: "")
    - `tax_id` (string) (default: "")
    - `sequence` (string) (default: "")

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

The entity was not found, or a precondition failed

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

