Most baryonic matter resides in the intergalactic medium (IGM). This diffuse gas is primarily composed of ionized hydrogen and helium and fills the space between galaxies. Observations of this environment are crucial for better understanding the physical processes in it. We present an analysis of the IGM absorption using blazar spectra from the first eROSITA all-sky survey (eRASS1) performed onboard of the Spectrum-Roentgen-Gamma mission (SRG) and XMM-Newton X-ray observations. First, we fit the continuum spectra using a log-parabolic spectrum model and fixed the Galactic absorption. Then, we included a collisional ionization equilibrium model, namely IONeq, to account for the IGM absorption. The column density N(H) and metallicity (Z) were set as free parameters. At the same time, the redshift of the absorber was fixed to half the blazar redshift as an approximation of the full line-of-sight absorber. We measured IGM-N(H) for 147 sources for SRG and 10 sources for XMM-Newton. We found a clear trend between IGM-N(H) and the blazar redshifts that scales as (1 + z)1.63 ± 0.12. The mean hydrogen density at z = 0 is n0 = (2.75 ± 0.63)×10−7 cm−3. The mean temperature over the redshift range is log(T/K) = 5.6 ± 0.6, and the mean metallicity is Z = 0.16 ± 0.09. We found no acceptable fit using a power-law model for the temperatures or metallicities as a function of the redshift. These results indicate that the IGM contributes substantially to the total absorption seen in the blazar spectra.