In this work we present a method to quantitatively measure the optical absorption of single nanowires that can be applied over a wide range of temperatures and with a high enough sensitivity to enable the measurement of below-band-gap absorption (as well as the absorption of single molecules). The method is based on accurately measuring the heat flow coming from a nanowire when it is illuminated by a laser beam. We experimentally verify this method by measuring the absorption of both a zincblende and a wurtzite GaAs, a wurtzite GaP, and a superlattice Zn3P2 nanowire. Furthermore, we find that the Zn3P2 nanowires have the largest absorption of all these materials. We analyze the advantages and disadvantages of the method and study its range of applicability.