We present a method of extracting the exchange parameters of the classical Heisenberg model from first-principles calculations of spin-spiral total energies based on density functional theory. The exchange parameters of the transition-metal monoxides MnO and NiO are calculated and used to estimate magnetic properties such as transition temperatures and magnon energies. Furthermore we show how to relate the magnon energies directly to differences in spin-spiral total energies for systems containing an arbitrary number of magnetic sublattices. This provides a comparison between magnon energies using a finite number of exchange parameters and the infinite limit.