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

    Function pubchemStructureImageUrl

    • Builds the URL of a compound's 2D structure image (PNG) from its CID.

      Parameters

      Returns string

      The PUG-REST PNG image URL

      pubchemStructureImageUrl(180);
      // Returns: "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/180/PNG"
      export function pubchemStructureImageUrl(cid: PubChemCID): string {
      return `${PUG_REST_BASE}/compound/cid/${cid}/PNG`;
      }