Search Compounds
pubchem_search_compoundsSearch PubChem for compounds by identifier (name, SMILES, InChIKey), formula, substructure, superstructure, or Tanimoto similarity. Optionally retrieve properties to avoid a follow-up call.
Instructions
Search PubChem for chemical compounds by identifier (name, SMILES, or InChIKey, batched up to 25), molecular formula in Hill notation, substructure or superstructure containment, or 2D Tanimoto similarity. Optionally hydrate results with properties to avoid a follow-up pubchem_get_compound_details call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| searchType | Yes | Search strategy. "identifier": name/SMILES/InChIKey lookup. "formula": molecular formula. "substructure": find compounds containing the query as a substructure. "superstructure": find compounds that are themselves substructures of the query. "similarity": 2D Tanimoto similarity to the query. | |
| identifierType | No | Required for identifier search. Type of chemical identifier: "name", "smiles", or "inchikey". | |
| identifiers | No | Required for identifier search. Array of identifiers to resolve (1-25). Examples: ["aspirin", "ibuprofen"] for name, ["CC(=O)OC1=CC=CC=C1C(=O)O"] for SMILES, ["BSYNRYMUTXBXSQ-UHFFFAOYSA-N"] for inchikey (27-char block format). | |
| formula | No | Required for formula search. Molecular formula in Hill notation (e.g. "C6H12O6", "CaH2O2"). | |
| allowOtherElements | No | Formula search only. When true, includes compounds with additional elements beyond the formula. | |
| query | No | Required for substructure/superstructure/similarity searches. A SMILES string (e.g. "CC(=O)O") or PubChem CID as a string (e.g. "2244"). | |
| queryType | No | Required for structure/similarity searches. Format of the query: "smiles" or "cid". | |
| threshold | No | Similarity search only. Minimum Tanimoto similarity (70-100). 90+ for close analogs, 70-80 for scaffold hops. Default: 90. | |
| maxResults | No | Maximum CIDs to return (1-200). Default: 20. | |
| properties | No | Optional: fetch these properties for each result, avoiding a follow-up details call. E.g. ["MolecularFormula", "MolecularWeight", "CanonicalSMILES"]. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| results | Yes | Matching compounds. | |
| searchType | Yes | Search strategy used: identifier, formula, substructure, superstructure, or similarity. | |
| totalFound | Yes | Total CIDs found before the maxResults cap. | |
| truncated | No | True when CIDs were capped at maxResults — more matches exist than returned. | |
| shown | No | CIDs returned after the maxResults cap. | |
| cap | No | The maxResults cap that was applied. | |
| notice | No | Recovery guidance when no compounds matched — echoes search strategy and suggests how to broaden. Absent when results were returned. |