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

    Variable getCidsByCasConst

    getCidsByCas: (cas: CAS<string>) => Promise<PubChemCID[] | undefined> = ...

    Retrieves the PubChem CIDs registered for a CAS number via PUG-REST's xref/registry-number lookup. A single CAS number can map to multiple CIDs (e.g. different salt or hydrate forms). Results are cached for three days; unknown CAS numbers resolve to undefined.

    Type declaration

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

        • cas: CAS<string>

          The CAS registry number to look up

        Returns Promise<PubChemCID[] | undefined>

        The matching CIDs, or undefined if PubChem has no cross-reference

    await getCidsByCas("15681-89-7");
    // Returns: [4311764, 22959485, 23673181]
    await getCidsByCas("0000-00-0");
    // Returns: undefined
    export const getCidsByCas: (cas: CAS<string>) => Promise<PubChemCID[] | undefined> = withTtlCache(
    getCidsByCasUncached,
    { namespace: 'cidsByCas' },
    );