James McLevy was born in Ballymacnab in Co. Armagh, the son of a farmer. He later moved to Edinburgh and became a builder's labourer, before joining the police. In 1833 he became a detective and handled 2,220 cases during his 30-year career, almost always securing a conviction. He published a series of extremely popular books in the 1860s, including Curiosities of Crime in Edinburgh, The Sliding Scale of Life and The Disclosures of a Detective.