The Dog API
Dog images and breed data — the canine sibling of The Cat API.
What it does
The Dog API (thedogapi.com) provides dog photos and structured breed data: temperament, bred-for purpose, breed group, weight and height ranges, and life span. With a free key you also get favourites, votes and image uploads.
Base URL
Authentication
Works without a key at a low limit. A free API key (sign up by email) goes in the x-api-key header and raises limits + unlocks breed filtering and account features.
Code examples
curl -s "https://api.thedogapi.com/v1/images/search?limit=3&breed_ids=1" \ -H "x-api-key: $DOG_API_KEY"
import requests
r = requests.get("https://api.thedogapi.com/v1/breeds",
headers={"x-api-key": KEY}, timeout=10)
for b in r.json()[:5]:
print(b["name"], "-", b["temperament"], "|", b["life_span"])Rate limits & quotas
Without a key: about 10 images per search and no breed filter. With a free key: higher limit values, breed filtering, and roughly 10,000 requests/month. Over the limit returns HTTP 429.
Key response fields
| (images/search) [].url / width / height | Image and dimensions |
| (images/search) [].breeds[] | Embedded breed data when you filter by breed |
| (breeds) [].name / temperament / bred_for / breed_group | Descriptive fields |
| (breeds) [].weight.metric / height.metric / life_span | Ranges as strings (e.g. "9 - 11") |
| (breeds) [].reference_image_id | Build an image URL or fetch via /images/{id} |
Common errors
| 401 | Invalid x-api-key (a wrong key is worse than none). |
| 429 | Monthly or burst limit exceeded. |
| 400 | breed_ids filter used without a key, or a bad parameter. |
When to use it (and alternatives)
Use it when you need breed information, not just photos — breed pickers, ‘which dog suits me’ quizzes, care guides. For photos only, dog.ceo is simpler and key-less. The Cat API is the identical sibling for cats.
FAQ
Do I need a key?
Not to fetch a few random images. You do need one to filter by breed, request more than ~10 per call, or use favourites/votes/uploads. It is free.
How are weight and height returned?
As range strings in both imperial and metric, e.g. weight.metric = "9 - 11" (kg). Parse the range yourself.
How do I show a breed's picture?
Each breed has a reference_image_id; fetch /images/{id} for the URL, or filter /images/search by that breed.
New to APIs?
Short guides for working with this API — and any other.