 He was an unsuccessful candidate for election in 1852 to the Thirty-third Congress.He served as captain in the Nineteenth Infantry of the Regular Army in the Civil War.Farquhar was elected as a Republican to the Thirty-ninth Congress (March 4, 1865 – March 3, 1867).