In 1666, when attending King Charles II at Oxford, he studied in the Bodleian Library, and he was appointed Lancaster Herald on 16 November 1676.
With Gregory King, Sandford laboured two years to write a history of the coronation of James II and VII and Mary.
Ifan K. Fletcher in The Literature of Splendid Occasions in English History called this book the most important descriptive book of the late seventeenth century: "James's exalted notions of his kingly office caused him to go minutely into the records of the past.
He appointed a Commission for the right ordering of the ceremony in all its details and to draw up a kind of code of precedents to serve for future coronations.
He died on 17 January 1694, "advanced in years, neglected, and poor", in the prison of Newgate, where he had been confined for debt, and was buried in St. Bride's upper churchyard.