I don't know how it works in other places but my city has a website. I went to the city website and went to the building official/ordinances area. In that area of the website, they had a link for our city's ordinances and municipal codes. In that link, it lists all the codes. The animals were listed in the Code of Ordinances - Chapter 2 - Animals.
I would suggest looking up your city webpage or calling your City Hall to start. They should be able to direct you to where you can read the exact code for your city.
My city does not allow livestock/farm animals of any kind with the exceptions of: our local zoo and: ~~animals kept as a part of a state educational institution or the owners of animals temporarily exhibited at any fair or agricultural exhibition, or to "pony rides" or other animal rides operated on a temporary basis .
I am tempted to register my kids for 4-H to get some hens for eggs but then there's the problem of my husband getting on board. . .