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

    Function nistStructureImageUrl

    • Builds the NIST WebBook structure-image URL for a CAS number.

      Parameters

      • cas: string

        A CAS registry number such as 12024-21-4.

      Returns string

      The image URL (CAS hyphens removed, per NIST's C<digits> id format).

      nistStructureImageUrl('12024-21-4');
      // "https://webbook.nist.gov/cgi/cbook.cgi?Struct=C12024214&Type=Color"
      export function nistStructureImageUrl(cas: string): string {
      return `${NIST_STRUCTURE_URL}?Struct=C${cas.replace(/-/g, '')}&Type=Color`;
      }