ConstThe molecular formula to look up (e.g. "Na6O18P6")
The best-matching CID, or undefined if PubChem has no match
await getCidByFormula("Na6O18P6"); // 24968
export const getCidByFormula: (formula: string) => Promise<PubChemCID | undefined> = withTtlCache(
getCidByFormulaUncached,
{ namespace: 'cidByFormula' },
);
Resolves a molecular formula to its best-matching PubChem CID via the PUG-REST
fastformulasearch (the plain name endpoint 404s on most formulas). Returns the first CID PubChem reports. Cached for three days.