f ( R ) gravity is thought to be an alternative to dark energy which can explain the acceleration of the universe . It has been tested by different observations including type Ia supernovae ( SNIa ) , the cosmic microwave background ( CMB ) , the baryon acoustic oscillations ( BAO ) and so on . In this Letter , we use the Hubble constant independent ratio between two angular diameter distances D = D _ { ls } / D _ { s } to constrain f ( R ) model in Palatini approach f ( R ) = R - \alpha H ^ { 2 } _ { 0 } ( - \frac { R } { H ^ { 2 } _ { 0 } } ) ^ { \beta } . These data are from various large systematic lensing surveys and lensing by galaxy clusters combined with X-ray observations . We also combine the lensing data with CMB and BAO , which gives a stringent constraint . The best-fit results are ( \alpha, \beta ) = ( -1.50 , 0.696 ) or ( \Omega _ { m } , \beta ) = ( 0.0734 , 0.696 ) using lensing data only . When combined with CMB and BAO , the best-fit results are ( \alpha, \beta ) = ( -3.75 , 0.0651 ) or ( \Omega _ { m } , \beta ) = ( 0.286 , 0.0651 ) . If we further fix \beta = 0 ( corresponding to \Lambda CDM ) , the best-fit value for \alpha is \alpha = -4.84 _ { -0.68 } ^ { +0.91 } ( 1 \sigma ) _ { -0.98 } ^ { +1.63 } ( 2 \sigma ) for the lensing analysis and \alpha = -4.35 _ { -0.16 } ^ { +0.18 } ( 1 \sigma ) _ { -0.25 } ^ { +0.3 } ( 2 \sigma ) for the combined data , respectively . Our results show that \Lambda CDM model is within 1 \sigma range .