Retrieve the synonym list for one or more PubChem Compound IDs (CIDs) via the PUG REST API. Synonyms include IUPAC names, common names, CAS numbers, DTXSIDs, trade names, and other identifiers.
For multiple CIDs, requests are batched at 100 CIDs per POST request. This is significantly faster than per-CID GET requests (e.g., 500 CIDs requires 5 POST requests instead of 500 GET requests).
Native credential and configuration errors stop the call; other PubChem Faults retain their warning and empty-result behavior.
Arguments
- cid
Integer or character vector of PubChem CIDs.
- tidy
Logical. If `TRUE` (default), returns a long-format tibble with `cid` and `synonym` columns. If `FALSE`, returns a list of lists with `CID` and `Synonym` elements.
- cache
Logical. If `TRUE` (default), results are cached in the session environment keyed by CID, so repeated calls for the same CIDs are instant.
Value
When `tidy = TRUE`: a tibble with columns `cid` (integer) and `synonym` (character). When `tidy = FALSE`: a list where each element contains `CID` and `Synonym` fields. Returns an empty tibble/list for invalid CIDs.
