  We perform the most sensitive search to-date for the existence of ultralight
axions using data from the NuSTAR telescope. We search for stellar axion
production in the M82 starburst galaxy and the M87 central galaxy of the Virgo
cluster and then the subsequent conversion into hard X-rays in the surrounding
magnetic fields. We sum over the full stellar populations in these galaxies
when computing the axion luminosity, and we account for the conversion of
axions to photons by using magnetic field profiles in simulated IllustrisTNG
analogue galaxies. We show that analyzing NuSTAR data towards these targets
between roughly 30 to 70 keV shows no evidence for axions and leads to robust
constraints on the axion-photon coupling at the level of $|g_{a\gamma\gamma}|
\lesssim 6.4 \times 10^{-13}$ GeV$^{-1}$ for $m_a \lesssim 10^{-10}$ eV at 95%
confidence.
