ConstThe chemical name to look up
The best-matching CID, or undefined if PubChem has no match
await getCidByName("aspirin");
// Returns: 2244
export const getCidByName: (name: string) => Promise<PubChemCID | undefined> = withTtlCache(
getCidByNameUncached,
{ namespace: 'cidByName' },
);
Resolves a chemical name to its best-matching PubChem CID via PUG-REST. Returns the first (highest-ranked) CID PubChem reports. Results are cached for three days.