The in-situ high-frequency monitoring of total nitrogen (TN) and total phosphorus (TP) in rivers is a challenge and key to instant water quality judgment and early warning. Based on the physical and chemical association between TN/TP and sensor-measurable predictors, we proposed a novel “indirect” measurement method for TN and TP in rivers. This method combines the timeliness of multi-sensor and the accuracy of intelligent algorithms, utilizing 188,629 data sets from 131 water monitoring stations across China. Under 5 algorithms and 4 predictor group scenarios, the results showed that: (1) extra tree regression (ETR) with 6 predictors exhibited the best precision, and mean determination coefficient (R2) of TN and TP inversion across 131 stations reached 0.78 ± 0.25 and 0.79 ± 0.22 respectively; (2) among 6 potential predictors, the importance degrees of temperature, electrical conductivity, NH4-N, and turbidity were large than pH and dissolved oxygen (DO), and >80 % of stations exhibited acceptable prediction accuracy (R2 > 0.6) when the number of predictors (P) ranged from 4 to 6, which showed good tolerability to predictor variations; (3) the accurate classification rate of water quality standard (ACRws) of all stations based on TN and TP reached 90.41 ± 6.96 % and 92.33 ± 6.41 %; (4) in 9 regions/basins of China, this method showed universal application potential with no significant prediction difference. Compared with laboratory test, water quality automatic monitoring station, and remote sensing inversion, the proposed method has high-frequency, high-precision, regional adaptability, low cost, and stable operation under rainy, cloudy, and nighttime conditions. The new method may provide important technological support for timely pollutant tracing, pre-warning, and emergency control for river pollution.