Background:The 17 O(p,γ ) 18 F reaction plays an important role in hydrogen burning processes in several different stages of stellar evolution. The rate of this reaction must therefore be known with high accuracy at the relevant temperatures in order to provide the necessary input for astrophysical models. Purpose: The cross section of 17 O(p,γ ) 18 F is characterized by a complicated resonance structure at low energies which needs to be reproduced by theoretical models if a reliable extrapolation to astrophysical energies is required. Experimental data, however, are scarce in a wide energy range, which increases the uncertainty of the extrapolations. The purpose of the present work is therefore to provide consistent and precise cross section values in a wide energy range for the 17 O(p,γ ) 18 F reaction. Method: The cross section is measured using the activation method. This method provides directly the total cross section which can be compared with model calculations. With this technique some typical systematic uncertainties encountered in in-beam γ -spectroscopy experiments can be avoided. Results: The cross section was measured between 500 keV and 1.8 MeV proton energies with a total uncertainty of typically 10%. The results are compared with earlier measurements and it is found that the gross features of the 17 O(p,γ ) 18 F excitation function are relatively well reproduced by the present data. Deviation of roughly a factor of 1.5 is found in the case of the total cross section when compared with the only high energy dataset. At the lowest measured energy our result is in agreement with two recent datasets within one standard deviation and deviates by roughly two standard deviations from a third one. An R-matrix analysis of the present and previous data strengthens the reliability of the extrapolated zero energy astrophysical S factor. Conclusions: Using an independent experimental technique, the literature cross section data of 17 O(p,γ ) 18 F is confirmed in the energy region of the resonances while a lower direct capture cross section is recommended at higher energies. The present dataset provides a constraint for the theoretical cross sections.