Research question: Hysterosalpingography (HSG) with an oil-based contrast has been shown to increase ongoing pregnancy rates compared with HSG with water-based contrast, but it remains unclear if an effect of HSG occurs compared with no HSG. Design: A secondary data-analysis of a prospective cohort study among 4556 couples that presented with unexplained subfertility in 38 clinics in the Netherlands between January 2002 and December 2004. A time-varying Cox regression with inverse probability of treatment weighing was used to analyse ongoing pregnancy rates in women after undergoing the HSG procedure (with the use of either water- or oil-based contrast media) compared with women who did not undergo HSG. Results: The probability of natural conception within 24 months after first presentation at the fertility clinic was increased after HSG, regardless of the type of contrast medium used, compared with no HSG (adjusted hazard ratio 1.48, 95% CI 1.26 to 1.73, corresponding to an absolute increase in 6-month pregnancy rate of +6%). When this analysis was limited to HSGs that were made with water-contrast, the treatment effect remained (adjusted hazard ratio 1.40, 95% CI 1.16 to 1.70). Conclusions: HSG increases the ongoing pregnancy rate of couples with unexplained subfertility compared with no HSG, regardless of the contrast medium used. Results need to be validated in future, preferably randomized, studies.