Neutron spectroscopy measurements have been performed on single crystals of the antiferromagnetic van der Waals compound NiPS$_3$. Linear spin wave theory using a Heisenberg Hamiltonian with single-ion anisotropies has been applied to determine the magnetic exchange parameters and the nature of the anisotropy. The analysis reveals that NiPS$_3$ is less two-dimensional than its sister compounds, with a relatively large ferromagnetic exchange of $J^{\prime} = -0.3$ meV between the layered \emph{ab} planes. In-plane magnetic exchange interactions up to the third nearest-neighbour were required to fit the data. The nearest-neighbour exchange was ferromagnetic with $J_1 = -2.6$ meV, the second neighbour was antiferromagnetic and small with $J_2 = 0.2$ meV, and the dominant antiferromagnetic third neighbour exchange was $J_3 = 13.5$ meV. The anisotropy was shown to be largely XY-like with a small uniaxial component, leading to the appearance of two low-energy spin wave modes in the spin wave spectrum at the Brillouin zone centre. The analysis could reproduce the spin wave energies, however there are discrepancies with the calculated neutron intensities hinting at more exotic phenomena.