Get Compound Cross-References
pubchem_get_compound_xrefsRetrieve external database cross-references for a compound, including PubMed citations, patents, gene/protein links, registry numbers, and taxonomy IDs, with paged results by type.
Instructions
Get external database cross-references for a compound: PubMed citations, patent IDs, gene/protein associations, registry numbers, and taxonomy IDs. Results are paged per type — capped at maxPerType with the total count reported; reach the IDs past a page with offset. PubMed IDs come highest (most recently assigned) first and the other numeric types in ascending order; string IDs keep PubChem's order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cid | Yes | PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds. | |
| offset | No | Zero-based index of the first ID to return within each xref type. The same offset is applied to every requested type. Pass the nextOffset from a previous call to read the following page. Default: 0. | |
| xrefTypes | Yes | Cross-reference types to retrieve. String IDs: RegistryID (DSSTox/EPA registry numbers), RN (CAS numbers), PatentID. Numeric IDs: PubMedID, GeneID (NCBI Gene), ProteinGI (legacy NCBI Protein GI), TaxonomyID. | |
| maxPerType | No | Max IDs to return per xref type per page. The per-call cap is 500: a larger value (up to 1000) returns 500 per type and is reported in cappedInputs. A compound may have thousands of PubMed references; use offset to reach the ones past this page. Total count always reported. Default: 50. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cid | No | PubChem Compound ID. | |
| error | No | Present when the call failed. Absent on success. | |
| xrefs | No | Cross-references grouped by type. | |
| notice | No | Recovery guidance when every requested xref type returned zero IDs, when the offset runs past every type, or when further pages remain. Absent when this page is complete and non-empty. | |
| offset | No | Zero-based index of the first ID returned within each type. | |
| truncated | No | True when at least one requested type has IDs remaining past this page. Which types, and how many IDs each holds in total, is in xrefs[].truncated / xrefs[].totalAvailable. | |
| nextOffset | No | Offset to pass on the next call to continue past this page. Omitted when no requested type has further IDs. | |
| 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. |