In today's society, heavy metal ions and antibiotic contaminants have caused great harm to water systems and human health. In this study, six isostructural lanthanide metal-organic frameworks [Ln(H3imda)2(TPA)(H2O)2](Tb for CUST-881, Eu for CUST-882, Dy for CUST-883, Er for CUST-884, Nd for CUST-885, Sm for CUST-886) were constructed by selecting terephthalic acid (TPA) and 4,5-Imidazoledicarboxylic acid (H3imda) and lanthanide metal ions via solvethermal method. Among them, CUST-881 and CUST-882 can selectively detect Fe3+, Cr2O72−, CrO42, and ceftriaxone sodium (CRO) in water systems and uric acid in urine. CUST-881 shows very low detection limits for these five substances. Furthermore, Principal Component Analysis (PCA) was used to distinguish Fe3+, Cr2O72−, CrO42−, and CRO in water. To our knowledge, this is the first time that they have been able to be simultaneously distinguished. In addition, the possible sensing mechanism was studied through UV–visible spectroscopy, Infrared spectroscopy, and PXRD analysis. Furthermore, the probe also showed satisfactory repeatability and recovery when applied to UA samples that simulated urine. Based on the above results, lanthanide metal-organic frameworks have great potential for practical monitoring of contaminants in water environments.