Get Compound Interactions
pubchem_get_compound_interactionsRetrieve a compound's drug-drug, drug-food, and target interaction records from PubChem, with source labels and paging offsets for each interaction kind.
Instructions
Get a compound's interaction data: drug-drug interactions (DrugBank), drug-food interactions, and chemical-target interactions (binding/activity from BindingDB, ChEMBL, and others). Each entry carries its originating source. Results are paged per kind, with the source-record total and the next offset reported for each. Richest for approved drugs; many compounds have no deposited interaction records. Drug-drug and target interactions come from PubChem's SDQ service, which can refuse automated requests — a refused kind is reported in failedKinds while the others still return; per-target activity is also available from pubchem_get_bioactivity.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cid | Yes | PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds. | |
| kinds | No | Interaction kinds to fetch. "drug-drug" (interactions with other drugs), "drug-food" (dietary interactions), "target" (binding/activity against molecular targets). "drug-drug" and "target" come from PubChem's SDQ service, which can refuse automated requests; "drug-food" comes from PUG View. Per-target activity is also available from pubchem_get_bioactivity. Default: ["drug-drug"]. | |
| offset | No | Zero-based start position within each requested kind, counted in source records rather than returned entries. The same offset applies to every kind in the call, and the kinds advance at different rates — when paging past the first page, request one kind per call and pass that kind's nextOffset. Default: 0. | |
| maxEntries | No | Max entries per kind per page. The per-call cap is 50: a larger value (up to 1000) reads a page of 50 per kind and is reported in cappedInputs. Well-studied drugs have a long tail of interactions; use offset to reach the ones past this page. Default: 10. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cid | No | PubChem Compound ID. | |
| error | No | Present when the call failed. Absent on success. | |
| notice | No | Guidance when a kind failed, when no interaction data was found, when the offset runs past every requested kind, or when further pages remain. Absent when this page is complete and every kind resolved. | |
| offset | No | Zero-based start position read within each requested kind. | |
| paging | No | Per-kind page position, one entry per requested kind that was retrieved. A kind listed in failedKinds is absent — its position is unknown, not exhausted. | |
| entries | No | Interaction entries across the requested kinds. | |
| truncated | No | True when at least one requested kind has source records remaining past this page. Which kinds, and how many records each holds, is in paging[].truncated / paging[].totalRecords. | |
| nextOffset | No | Offset to pass on the next call, reported when exactly one requested kind has records remaining. Omitted when none do, and when several do — those advance to different positions, so read paging[].nextOffset instead. | |
| failedKinds | No | Interaction kinds that could not be retrieved (comma-separated). The returned entries cover the kinds that succeeded. The notice says, per failed kind, whether a retry can help: a timeout or upstream error can clear, while a refusal from PubChem's SDQ service (drug-drug, target) does not. | |
| cappedInputs | No | Inputs that asked for more than their per-call cap, with the value requested and the value served. An ID batch lists the IDs past the cap in unprocessed. Omitted when every input was within its cap. | |
| returnedCount | No | Total interaction entries returned across all kinds. | |
| requestedKinds | No | Interaction kinds requested (comma-separated). |