ConstThe compound's PubChem CID
The SDF text and which depiction it is, or undefined if neither is available
await getStructureSdf(2519); // caffeine: { sdf: '2519\n -OEChem-…', recordType: '3d' }
await getStructureSdf(5234); // sodium chloride, no conformer: { sdf: …, recordType: '2d' }
export const getStructureSdf: (cid: PubChemCID) => Promise<StructureRecord | undefined> =
withTtlCache(getStructureSdfUncached, { namespace: 'structureSdf' });
Fetches a compound's structure as SDF, preferring the computed 3D conformer and falling back to the 2D layout when PubChem has no 3D record for it. Cached for three days.