Raw schema
{
"type": "object",
"properties": {
"searchType": {
"type": "string",
"enum": [
"identifier",
"formula",
"substructure",
"superstructure",
"similarity",
"assay"
],
"description": "Search strategy; each mode needs its own fields. \"identifier\": name/SMILES/InChI/InChIKey lookup โ requires identifierType and identifiers. \"formula\": molecular formula โ requires 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. substructure, superstructure, and similarity require query and queryType. \"assay\": compounds tested in a PubChem bioassay โ requires aid; activeOnly (default true) keeps only the compounds the assay marked active."
},
"identifierType": {
"description": "Required for identifier search. Type of chemical identifier: \"name\", \"smiles\", \"inchi\" (a full InChI string, case-sensitive), or \"inchikey\".",
"type": "string",
"enum": [
"name",
"smiles",
"inchi",
"inchikey"
]
},
"identifiers": {
"description": "Required for identifier search. Array of identifiers to resolve. The per-call cap is 25: the first 25 are looked up, and any past that (up to 1000 in all) are returned in unprocessed, in input order, and reported in cappedInputs. Examples: [\"aspirin\", \"ibuprofen\"] for name, [\"CC(=O)OC1=CC=CC=C1C(=O)O\"] for SMILES, [\"InChI=1S/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)\"] for inchi (sent exactly as written, case kept), [\"BSYNRYMUTXBXSQ-UHFFFAOYSA-N\"] for inchikey (27-char block format; uppercased before lookup, any case accepted).",
"minItems": 1,
"maxItems": 1000,
"type": "array",
"items": {
"type": "string"
}
},
"formula": {
"description": "Required for formula search. Molecular formula in Hill notation (e.g. \"C6H12O6\", \"CaH2O2\").",
"type": "string"
},
"allowOtherElements": {
"default": false,
"description": "Formula search only. When true, includes compounds with additional elements beyond the formula.",
"type": "boolean"
},
"query": {
"description": "Required for substructure/superstructure/similarity searches. A SMILES string (e.g. \"CC(=O)O\") or PubChem CID as a string from 1 to 2147483647 (e.g. \"2244\").",
"type": "string"
},
"queryType": {
"description": "Required for structure/similarity searches. Format of the query: \"smiles\" or \"cid\".",
"type": "string",
"enum": [
"smiles",
"cid"
]
},
"threshold": {
"default": 90,
"description": "Similarity search only. Minimum Tanimoto similarity (70-100). 90+ for close analogs, 70-80 for scaffold hops. Default: 90.",
"type": "number",
"minimum": 70,
"maximum": 100
},
"aid": {
"description": "Required for assay search. PubChem Assay ID (AID) whose compounds to list, from 1 to 2147483647, e.g. 1000. Find AIDs for a biological target with pubchem_search_assays.",
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"activeOnly": {
"default": true,
"description": "Assay search only. When true (default), lists only the compounds the assay marked active; false lists every compound it tested.",
"type": "boolean"
},
"offset": {
"default": 0,
"description": "Zero-based index of the first CID to return. Pass the nextOffset from a previous call to read the following page. Identifier lookups resolve every match up front, so paging them is free, and assay searches fetch only the requested page, so both page to the end of their matches. Formula, substructure, superstructure, and similarity searches have to ask PubChem for offset + maxResults records to reach a page, so deep pages cost progressively more upstream: those four accept an offset up to 10000. Default: 0.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"maxResults": {
"default": 20,
"description": "Maximum CIDs to return per page. The per-call cap is 200: a larger value (up to 1000) returns a page of 200 and is reported in cappedInputs. Use offset to reach matches past this page. Default: 20.",
"type": "integer",
"minimum": 1,
"maximum": 1000
},
"properties": {
"description": "Optional: fetch these properties for each result, avoiding a follow-up details call. E.g. [\"MolecularFormula\", \"MolecularWeight\", \"CanonicalSMILES\"].",
"type": "array",
"items": {
"type": "string",
"enum": [
"MolecularFormula",
"MolecularWeight",
"CanonicalSMILES",
"IsomericSMILES",
"InChI",
"InChIKey",
"IUPACName",
"Title",
"XLogP",
"ExactMass",
"MonoisotopicMass",
"TPSA",
"Complexity",
"Charge",
"HBondDonorCount",
"HBondAcceptorCount",
"RotatableBondCount",
"HeavyAtomCount",
"IsotopeAtomCount",
"AtomStereoCount",
"DefinedAtomStereoCount",
"UndefinedAtomStereoCount",
"BondStereoCount",
"DefinedBondStereoCount",
"UndefinedBondStereoCount",
"CovalentUnitCount",
"Volume3D"
]
}
}
},
"required": [
"searchType"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}