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

    Variable getRankedNamesByNameConst

    getRankedNamesByName: (name: string) => Promise<string[] | undefined> = ...

    Fetches PubChem's popularity-ranked synonyms for a chemical name via PUG-REST, caching results for three days. The leading entries are the most commonly used names, and CAS numbers appear inline among them. Returns undefined when PubChem has no match.

    Type declaration

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

        • name: string

          The chemical name to look up

        Returns Promise<string[] | undefined>

        The ranked synonym list, or undefined if not found

    await getRankedNamesByName("acetone");
    // Returns: ["acetone", "2-propanone", "67-64-1", "propanone", ...]
    export const getRankedNamesByName: (name: string) => Promise<string[] | undefined> = withTtlCache(
    getRankedNamesByNameUncached,
    { namespace: 'rankedNames' },
    );