CHEESE APISearch

Substructure search

Exact positive assembled-product matching with evidence and explicit coverage.

Suggest an edit

POST /api/v2/search_substructure is a separate query engine, not a similarity scorer.

Enamine substructure search is enabled in production on release 2026-09-06.2, over the filtered approximately 93.41B source population. All 326 route partitions are indexed. Native candidates are assembled, checked for population membership, and verified against the original query, including bond order, recursive SMARTS, and chirality.

{
  "query": {"format": "smarts", "value": "C(=O)N1CCC1"},
  "database_id": "enamine-real-v5a",
  "limit": 100,
  "timeout_seconds": 30
}

The endpoint accepts positive smiles and the documented SMARTS subset. Results contain exact assembled-product atom and bond match indices, reaction provenance, and optional synthons. Matching uses the pinned engine's aromaticity, chirality, standardization, and sanitization policy.

import deepmedchem as dmc

motif_hits = dmc.substructure(
    "[N;R0][N;R0]C(=O)",
    format="smarts",
    database="enamine",
    limit=10,
    timeout_seconds=45,
    timeout=60,
)

The response reports indexed and available reactions/products plus coverage_fraction. A coverage warning means unindexed space was not searched; it is never evidence that the uncovered space has no match. timed_out=true returns bounded partial results. Pure-negative/global-count queries and unrestricted Boolean expressions are not supported.

Demanding motifs can take tens of seconds. timeout_seconds controls the server search budget, separately from the ordinary synchronous execution limit. Set the SDK HTTP timeout above that budget to allow for serialization and transport. Exact returned matches and full index coverage do not guarantee exhaustive enumeration before the deadline.

POST /api/v2/substructure is a temporary deprecated SMILES-only alias. Migrate to the typed route; the alias returns Deprecation and a successor link.