On November 22, 1831, a special election was held in Pennsylvania's 11th congressional district to fill a vacancy caused by the death of William Ramsey (D) on September 29, 1831.
McCoy took his seat December 5, 1831, at the start of the 1st session of the 22nd Congress