During a solar eclipse the solar irradiance reaching the top of the atmosphere (TOA) is reduced in the Moon shadow. The solar irradiance is commonly measured by Earth observation satellites before the start of the solar eclipse and is not corrected for this reduction, which results in a decrease in the computed TOA reflectances. Consequently, air quality products that are derived from TOA reflectance spectra, such as the ultraviolet (UV) absorbing aerosol index (AAI), are distorted or undefined in the shadow of the Moon. The availability of air quality satellite data in the penumbral and antumbral shadow during solar eclipses, however, is of particular interest to users studying the atmospheric response to solar eclipses. Given the time and location of a point on the Earth's surface, we explain how to compute the obscuration during a solar eclipse, taking into account wavelength-dependent solar limb darkening. With the calculated obscuration fractions, we restore the TOA reflectances and the AAI in the penumbral shadow during the annular solar eclipses on 26 December 2019 and 21 June 2020 measured by the TROPOMI/S5P instrument. We compare the calculated obscuration to the estimated obscuration using an uneclipsed orbit. In the corrected products, the signature of the Moon shadow disappeared, but only if wavelength-dependent solar limb darkening is taken into account. We find that the Moon shadow anomaly in the uncorrected AAI is caused by a reduction of the measured reflectance at 380 nm, rather than a colour change of the measured light. We restore common AAI features such as the sunglint and desert dust, and we confirm the restored AAI feature on 21 June 2020 at the Taklamakan Desert by measurements of the GOME-2C satellite instrument on the same day but outside the Moon shadow. No indication of local absorbing aerosol changes caused by the eclipses was found. We conclude that the correction method of this paper can be used to detect real AAI rising phenomena during a solar eclipse and has the potential to restore any other product that is derived from TOA reflectance spectra. This would resolve the solar eclipse anomalies in satellite air quality measurements in the penumbra and antumbra and would allow for studying the effect of the eclipse obscuration on the composition of the Earth's atmosphere from space.