Ribavirin is an important antiviral with demonstrated activity against coronaviruses such as severe acute respiratory syndrome coronavirus and coronavirus disease 2019 virus. However, abuse of ribavirin will cause great environmental damage and threaten human health owing to its reproductive toxicity and teratogenicity. Therefore, an innovative detection method is demanded for simple and sensitive detection of ribavirin. This work reports an imprinted colloidal crystal array (ICCA) for ribavirin sensing. The building blocks of the ICCA are ribavirin imprinted spheres, which possess superior binding efficiency toward ribavirin. Benefiting from the highly ordered structure, the ICCA exhibits optical properties which change upon binding ribavirin. The changes in reflectance wavelength enable a fast and label‐free detection of ribavirin between 21 and 245 μmol L−1. Moreover, the sensor shows excellent selectivity for ribavirin detection in river water. Overall, all the results reported in this work demonstrate that the ICCA should be a promising detection tool for antivirals. © 2023 Society of Industrial Chemistry.