  The photospheric unsigned magnetic flux has been shown to be highly
correlated with radial velocity (RV) variations caused by solar surface
activity. This activity indicator is therefore a prime candidate to unlock the
potential of RV surveys to discover Earth twins orbiting Sun-like stars. We
show for the first time how a precise proxy of the unsigned magnetic flux
($\Delta\alpha B^2$) can be obtained from Sun-as-a-star intensity spectra by
harnessing the magnetic information contained in over 4000 absorption lines in
the wavelength range from 380 to 690 nm. This novel activity proxy can thus be
obtained from the same spectra from which RVs are routinely extracted. We
derived $\Delta\alpha B^2$ from 500 randomly selected spectra from the HARPS-N
public solar data set, which spans from 2015 to 2018. We compared our estimates
with the unsigned magnetic flux values from the Solar Dynamics Observatory
(SDO) finding excellent agreement (median absolute deviation: 4.9 per cent).
The extracted indicator $\Delta\alpha B^2$ correlates with SDO's unsigned
magnetic flux estimates on the solar rotational timescale (Pearson correlation
coefficient 0.67) and on the three-year timescale of our data set (correlation
coefficient 0.91). We find correlations of $\Delta\alpha B^2$ with the HARPS-N
solar RV variations of 0.49 on the rotational timescale and 0.78 on the
three-year timescale. The Pearson correlation of $\Delta\alpha B^2$ with the
RVs is found to be greater than the correlation of the classical activity
indicators with the RVs. For solar-type stars, $\Delta\alpha B^2$ therefore
represents the best simultaneous activity proxy known to date.
