Rainsford was elected Member of Parliament for Northampton in April 1660 for the Convention Parliament. In 1660 he became treasurer of Lincoln's Inn and on 26 October 1660 he was sworn serjeant-at-law. He was one of those designated a member of the projected order of Knights of the Royal Oak. He was re-elected MP for Northampton in 1661 for the Cavalier Parliament, and sat until 16 November 1663 when he was raised to the bench as Baron of the Exchequer. He presided over the commission which sat at Dublin during the earlier months of 1663 to supervise the execution of the Act of Settlement 1662, and on his return to England was raised to the exchequer bench, 16 November the same year.