ChemPal Documentation - v1.6.0
    Preparing search index...

    Variable getSynonymsByCidConst

    getSynonymsByCid: (cid: PubChemCID) => Promise<string[] | undefined> = ...

    Fetches PubChem's popularity-ranked synonyms for a compound by CID via PUG-REST. Prefer this over getRankedNamesByName when the CID is already known, as it avoids an ambiguous name lookup. Cached for three days.

    Type declaration

      • (cid: PubChemCID): Promise<string[] | undefined>
      • Parameters

        Returns Promise<string[] | undefined>

        The ranked synonym list, or undefined if the CID is unknown

    await getSynonymsByCid(180);
    // Returns: ["acetone", "propan-2-one", "67-64-1", "2-propanone", ...]
    export const getSynonymsByCid: (cid: PubChemCID) => Promise<string[] | undefined> = withTtlCache(
    getSynonymsByCidUncached,
    { namespace: 'synonymsByCid' },
    );