The name of the chemical to get the IUPAC name of
The IUPAC name of the chemical
export async function getIUPACName(name: string): Promise<Maybe<string>> {
const response = await fetch(
`https://cactus.nci.nih.gov/chemical/structure/${encodeURIComponent(name)}/iupac_name`,
);
const data = await response.text();
if (!data) return;
return data.trim();
}
Gets the IUPAC name of a chemical from the Cactus API.