  We prepare NbN thin films by DC magnetron sputtering on [100] GaAs
substrates, optimise their quality and demonstrate their use for efficient
single photon detection in the near-infrared. The interrelation between the
Nb:N content, growth temperature and crystal quality is established for 4-22nm
thick films. Optimised films exhibit a superconducting critical temperature of
12.6\pm0.2K for a film thickness of 22\pm0.5nm and 10.2\pm0.2K for 4\pm0.5nm
thick films. The optimum growth temperature is shown to be ~475{\deg}C
reflecting a trade-off between enhanced surface diffusion, which improves the
crystal quality, and arsenic evaporation from the GaAs substrate. Analysis of
the elemental composition of the films provides strong evidence that the
\delta-phase of NbN is formed in optimised samples, controlled primarily via
the nitrogen partial pressure during growth. By patterning optimum 4nm and 22nm
thick films into a 100nm wide, 369\mu m long nanowire meander using electron
beam lithography and reactive ion etching, we fabricated single photon
detectors on GaAs substrates. Time-resolved studies of the photo-response,
absolute detection efficiency and dark count rates of these detectors as a
function of the bias current reveal maximum single photon detection
efficiencies as high as 21\pm2% at 4.3\pm0.1K with ~50k dark counts per second
for bias currents of 98%Ic at a wavelength of 950nm. As expected, similar
detectors fabricated from 22nm thick films exhibit much lower efficiencies
(0.004%) with very low dark count rates <=3cps. The maximum lateral extension
of a photo-generated hotspot is estimated to be 30\pm8nm, clearly identifying
the low detection efficiency and dark count rate of the thick film detectors as
arising from hotspot cooling via the heat reservoir provided by the NbN film.
