Swart was elected as a Democratic-Republican to the 10th United States Congress, holding office from March 4, 1807, to March 3, 1809. He was sheriff of Schoharie County in 1810 and 1813, and served in the New York State Senate from 1817 to 1820. He resumed the practice of his profession in Schoharie and died there in 1829; interment was in the Old Stone Fort Cemetery.