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

    Function pubchemCasSearchUrl

    • Builds a PubChem search URL for a CAS number. Use this when the exact CID is unknown — PubChem's search lands the user on the matching compound (or a short result list) for the CAS number.

      Parameters

      • cas: string

        The CAS registry number

      Returns string

      The PubChem search URL for the CAS number

      pubchemCasSearchUrl("67-64-1");
      // Returns: "https://pubchem.ncbi.nlm.nih.gov/#query=67-64-1"
      export function pubchemCasSearchUrl(cas: string): string {
      return `https://pubchem.ncbi.nlm.nih.gov/#query=${encodeURIComponent(cas)}`;
      }