We investigate the observational constraints on the oscillating scalar field model using data from type Ia supernovae , cosmic microwave background anisotropies , and baryon acoustic oscillations . According to a Fourier analysis , the galaxy number count N from redshift z data indicates that galaxies have preferred periodic redshift spacings . We fix the mass of the scalar field as m _ { \phi } = 3.2 \times 10 ^ { -31 } h { eV } such that the scalar field model can account for the redshift spacings , and we constrain the other basic parameters by comparing the model with accurate observational data . We obtain the following constraints : \Omega _ { m, 0 } = 0.28 \pm 0.03 ( 95 % C.L . ) , \Omega _ { \phi, 0 } < 0.035 ( 95 % C.L . ) , \xi > -158 ( 95 % C.L . ) ( in the range \xi \leq 0 ) . The best fit values of the energy density parameter of the scalar field and the coupling constant are \Omega _ { \phi, 0 } = 0.01 and \xi = -25 , respectively . The value of \Omega _ { \phi, 0 } is close to but not equal to 0 . Hence , in the scalar field model , the amplitude of the galaxy number count can not be large . However , because the best fit values of \Omega _ { \phi, 0 } and \xi are not 0 , the scalar field model has the possibility of accounting for the periodic structure in the N – z relation of galaxies . The variation of the effective gravitational constant in the scalar field model is not inconsistent with the bound from observation .