This is a quantitative and qualitative analysis that measures the levels of porphyrins and their biosimilar precursors, particularly porphobilinogen (PBG) and delta-aminolevulinic acid (ALA), in a 24-hour urine sample or a random urine sample. Elevated urinary PBG during an attack is a hallmark diagnostic marker for acute intermittent porphyria (AIP) and other acute porphyrias.