  Electron Spin Resonance (ESR) describes a suite of techniques for
characterising electronic systems, with applications in physics, materials
science, chemistry, and biology. However, the requirement for large electron
spin ensembles in conventional ESR techniques limits their spatial resolution.
Here we present a method for measuring the ESR spectrum of nanoscale electronic
environments by measuring the relaxation time ($T_1$) of an optically addressed
single-spin probe as it is systematically tuned into resonance with the target
electronic system. As a proof of concept we extract the spectral distribution
for the P1 electronic spin bath in diamond using an ensemble of
nitrogen-vacancy centres, and demonstrate excellent agreement with theoretical
expectations. As the response of each NV spin in this experiment is dominated
by a single P1 spin at a mean distance of 2.7\,nm, the extension of this
all-optical technique to the single NV case will enable nanoscale ESR
spectroscopy of atomic and molecular spin systems.
