Ayers was born in Gloucester, England, in 1836. He married Isabella Eliza Ayers (née Williams) in Newington, Surrey in 1859. She was a daughter of F. F. Williams of London. They came to Canterbury on the Gananoque, which arrived in Lyttelton on 9 May 1860.
Upon his arrival, he built a house at 290 Riverlaw Terrace in Opawa (these days a suburb of Christchurch). The building is these days registered with the New Zealand Historic Places Trust as Category II, with registration number 3730.
For his first 20 years in Christchurch, Ayers was a hairdresser and tobacconist. In 1880, he changed profession and became an auctioneer. His firm, Ayers, Beauchamp & Company, was based at 190 Cashel Street (just east of Manchester Street) and auctioned land, livestock, fruit and general goods.
Ayers was elected as a councillor at Christchurch City Council in 1878, 1879 and 1882.
Ayers and James Gapes contested the Christchurch mayoral election on 24 November 1880, which was won by Gapes. Charles Hulbert and Ayers were nominated for the mayoralty in Christchurch November 1883, and since both were well-known personalities, the election campaign period was interesting and lively. Hulbert won the election, which was held on 28 November, and received 671 votes to 496, a majority of 175 votes.
On 17 November 1885, Ayers was elected unopposed as Mayor of Christchurch. He was installed by the outgoing mayor, Charles Hulbert, at a meeting on 16 December 1885. Even before his installation, he had attended civic duties as mayor-elect together with the mayor, for example the opening of a band rotunda in Latimer Square, the start of the construction of the Corporation Line (tramway) and the opening of the Armagh Street Bridge into Hagley Park. One of his first tasks as mayor was the unveiling of the Moorhouse Statue (commemorating William Sefton Moorhouse) in the Botanic Gardens.
Ayers stood for the mayoralty again in 1886. He was challenged by Charles Louisson, who had been a councillor since 1881. Louisson stood for the mayoralty after a public request made by the other eleven councillors (including Samuel Manning, Samuel Paull Andrews, William Prudhoe and Charles Gray), nine ex mayors (John Ollivier, Henry Sawtell, Fred Hobbs, Henry Thomson, William Wilson, Charles Hulbert, James Gapes, John Anderson and George Ruddenklau) and 13 ex councillors (including Daniel Reese). It was the most keenly contested mayoral election thus far, and Louisson was narrowly beaten by Ayers, with 636 to 631 votes. Ayers retired at the end of his mayoralty a year later, and Louisson decided to stand again and was elected unopposed. Hence, Ayers had been mayor for two terms.
The death on 17 December 1886 of John Coster, who represented the Heathcote electorate in Parliament, caused an 1887 by-election. There were several people interested in standing in the electorate, but with Frederic Jones and Ayers, who had just been elected as Mayor of Christchurch, considered as the only contenders as having a chance of success, most other candidates withdrew from the contest. On nomination day on 2 February 1887, Jones and Ayers were nominated. A third person, James Arthur Williams, nominated himself, but could not find anybody to second this motion. Thus, the by-election was a two-person contest. On election day, 8 February 1887, the majority opinion was that Ayers would win. There was great interest in the election, as evidenced by the high turnout. Jones had a considerable majority over Ayers, with 527 and 336 votes, respectively. The 191 votes majority was mirrored by Jones having won all four polling stations.
Westby Perceval, Ayers, Henry Thomson and Eden George contested the Christchurch South electorate in the 1887 election. Perceval won the election and Ayers came a distant second.
After his mayoralty, Ayers lived a mostly private life. He did, however, become a borough councillor in Linwood. He was known as an avid gardener and had a great love for flowers, and generally had a flower in his button hole.
After suffering from failing health for some time, Ayers died on 16 September 1900 at his home in River Road in Avonside. He was buried at Linwood Cemetery. He was survived by his wife and eight of their children. His wife died on 9 September 1927 and was buried with her husband.