The Cat API
Cat images, breeds and facts with a generous free tier.
What it does
The Cat API (thecatapi.com) serves random cat images and structured breed data — temperament, origin, description, weight, life span, and links to Wikipedia and breed standards. With a free key you get breed filtering, favourites, votes and uploads.
Base URL
Authentication
Usable without a key at a low limit. A free API key goes in the x-api-key header and unlocks breed filters, larger limit values and account features.
Code examples
curl -s "https://api.thecatapi.com/v1/images/search?limit=3&breed_ids=beng" \ -H "x-api-key: $CAT_API_KEY"
import requests
r = requests.get("https://api.thecatapi.com/v1/images/search",
params={"limit": 5, "has_breeds": 1},
headers={"x-api-key": KEY}, timeout=10)
for img in r.json():
b = img["breeds"][0] if img["breeds"] else {}
print(img["url"], "-", b.get("name"))Rate limits & quotas
No key: ~10 images per search, no breed filter, modest daily use. Free key: higher limits (roughly 10,000 requests/month) and full filtering. Over the limit: HTTP 429.
Key response fields
| (images/search) [].id / url / width / height | Image data |
| (images/search) [].breeds[] | Breed info when the image has an associated breed |
| (breeds) [].name / origin / temperament / description | Descriptive fields |
| (breeds) [].weight.metric / life_span | Ranges as strings |
| (breeds) [].wikipedia_url / reference_image_id | External link and cover image id |
Common errors
| 401 | Invalid x-api-key. |
| 429 | Rate/quota limit exceeded. |
| 400 | Breed filter or large limit used without a key. |
When to use it (and alternatives)
The pick for cat apps that need breed detail. For ‘just give me a cat picture’ with zero setup, Cataas is even simpler; The Dog API is the identical sibling for dogs.
FAQ
How do I only get images that have breed data?
Add has_breeds=1 to /images/search, or filter with breed_ids= (needs a key). Without that, most random images have an empty breeds array.
Is a key required?
No for basic random images; yes for breed filtering, bigger batches and favourites/votes. Keys are free.
Can users save favourites?
Yes — the /favourites, /votes and /images/upload endpoints let you build a per-user gallery, keyed by a sub_id you choose.
New to APIs?
Short guides for working with this API — and any other.