Zoo Animals API
Random zoo-animal facts and images from a free, no-key API.
What it does
The Zoo Animal API returns random animal profiles with facts — common and Latin name, animal type, habitat, diet, geographic range, length, weight, lifespan and an image link. It is a small curated dataset aimed at learning projects.
Base URL
Authentication
None. /animals/rand for one, /animals/rand/{amount} for several. Reliability note: the API is hosted on a now-discontinued free Heroku tier, so it may be slow to wake or offline — have a fallback.
Code examples
curl -s https://zoo-animal-api.herokuapp.com/animals/rand curl -s https://zoo-animal-api.herokuapp.com/animals/rand/3
import requests
try:
a = requests.get("https://zoo-animal-api.herokuapp.com/animals/rand", timeout=15).json()
print(a["name"], "-", a["habitat"], "-", a["diet"])
except requests.RequestException:
print("API unavailable")Rate limits & quotas
No documented rate limit, but expect cold-start delays (several seconds on the first request after idle) and occasional downtime because of the free hosting. {amount} is capped around 10.
Key response fields
| name / latin_name / animal_type | Identity |
| active_time / habitat / diet / geo_range | Lifestyle and range |
| length_min / length_max / weight_min / weight_max / lifespan | Measurements (imperial) |
| image_link | URL to a photo of the animal |
Common errors
| (timeout / 503) | Heroku dyno asleep or retired — retry once with a long timeout, then fall back. |
| (small dataset) | Only a few dozen animals — repeats come quickly. |
When to use it (and alternatives)
Fine for a classroom project, a ‘animal of the day’ card or a fetch tutorial — if you handle the flakiness. For robust biodiversity data use GBIF or the Encyclopedia of Life; for adoptable pets, Petfinder.
FAQ
Why is the first request so slow?
Free Heroku dynos sleep after inactivity and take several seconds to wake. Use a generous timeout, and consider caching a batch of animals on your side.
Is it still online?
It has been intermittent since Heroku ended its free tier. Build in a fallback (a bundled JSON of animals) so your app degrades gracefully.
How many animals are in the dataset?
A few dozen curated entries — enough for a demo, not a reference. Expect repeats with more than a handful of calls.
New to APIs?
Short guides for working with this API — and any other.