In this work, Yb3+ and Er3+-co-doped Sr9In(PO4)7 upconversion fluorescent materials with dual functionality were synthesized though simple high-temperature solid state method. Based on International Commission on Illumination (CIE) color coordinates, the calculation of color purity at different temperatures demonstrates the attainment of highly pure green luminescence (color purity >90 %) for the synthesized materials. The analysis of activation energy proves that synthesized materials are stable. Utilizing the fluorescence intensity ratio (FIR) of the thermally coupled energy levels (2H11/2, 4S3/2) as a metric for optical sensing performance, absolute sensitivity and relative sensitivity are determined, and their maximum values are 0.44 % and 1.13 %, respectively. Inspired by the variation in CIE coordinates with temperature, thermally responsive two-dimensional barcode image was developed, demonstrating the practical application of Sr9In(PO4)7:Yb/Er materials in the field of information security and anti-counterfeiting.