We demonstrate a nanophotonic sensor for real-time monitoring of fluid flows. The sensor is based on a silicon photonic crystal cavity with a well aligned micro fluidic channel for fluid-injection. The simulated resonant wavelength shift of the sensor with residual oil in holes is 9.0 nm, and the observed experimental shift under the same condition is 10.0 nm. An alternating fluid delivery is applied in a dynamic sensing experiment with syringe pump controlled ratios of water and oil. Excellent agreement between the measured data and the video images of fluidic streams in the optofluidic cell is found.