Objective To construct an aptamer-functionalized carboxylated graphene oxide (CGO) fluorescent sensor to achieve highly sensitive and specific detection of ketamine (KET) and its metabolite norketamine (NK) using an aptamer capable of simultaneously recognizing KET and NK. Methods A specific aptamer for simultaneous recognition of KET and NK was screened using graphene oxide-systematic evolution of ligand by exponential enrichment (GO-SELEX) and molecular docking techniques. The aptamer, labeled with Cy5 fluorescence, was chemically conjugated to CGO to construct an aptamer-functionalized CGO fluorescent sensor. By optimizing detection conditions, including the mass concentration of CGO, aptamer concentration, reaction temperature, and incubation time, quantitative analysis of the target analytes was achieved using the ratio of fluorescence intensity changes before and after target addition. The stability of the sensor in biological matrices was evaluated by monitoring fluorescence intensity changes over incubation time in blank blood and urine, in comparison with the traditional physical adsorption-based CGO fluorescent sensor. Spiked recovery experiments in blank blood and urine were conducted to compare performance with that of HPLC-MS/MS. Results A specific aptamer A5 was selected and chemically conjugated with CGO to construct the aptamer-functionalized CGO fluorescent sensor. Under optimized conditions, the proposed fluorescent sensor exhibited a linear detection range of 1.0-5.0 ng/mL for KET, with a limit of detection (LOD) of 0.86 ng/mL; while for NK, the linear detection range was 1.0-5.0 ng/mL, with an LOD of 0.70 ng/mL. Compared with the CGO fluorescent sensor constructed via physical adsorption, this sensor demonstrated greater stability in blood and urine. The spiked recovery rates of KET and NK in blank blood and urine ranged from 81.50% to 110.03%, exhibiting detection performance comparable to that of HPLC-MS/MS. Conclusion The aptamer screening method offers a novel approach for selecting aptamers targeting drugs and their metabolites. The constructed aptamer-functionalized CGO fluorescent sensor provides an efficient and reliable strategy for the high-performance detection of KET and NK.