Dog CEO API
Free, no-key API serving thousands of dog images by breed.
What it does
The Dog API (dog.ceo) serves random dog photos, optionally filtered by breed or sub-breed, plus the full breed/sub-breed list. Images come from the Stanford Dogs Dataset. It is one of the most-used ‘learn to fetch’ APIs.
Base URL
Authentication
None. /breeds/image/random, /breed/{breed}/images/random, /breed/{breed}/{sub}/images, /breeds/list/all, /breeds/image/random/{count} (up to 50).
Code examples
curl -s https://dog.ceo/api/breeds/image/random curl -s https://dog.ceo/api/breed/hound/afghan/images/random curl -s https://dog.ceo/api/breeds/list/all
const { message } = await fetch("https://dog.ceo/api/breed/corgi/images/random")
.then(r => r.json());
img.src = message; // a jpg URLRate limits & quotas
No documented rate limit; images are CDN-hosted and responses are tiny. Cache the breed list — it changes rarely.
Key response fields
| status | success or error |
| message | A URL (single image), an array of URLs (list), or an object of breeds → sub-breeds |
| code | HTTP-style code on errors |
Common errors
| status: error, code 404 | Unknown breed or sub-breed — check /breeds/list/all (all lowercase). |
| (sub-breed order) | Path is /breed/{breed}/{sub}/, e.g. /breed/hound/afghan/ — breed first. |
When to use it (and alternatives)
The classic choice for a ‘random dog’ button, breed galleries and teaching HTTP. For structured breed data (temperament, size, lifespan) use The Dog API; for cats, The Cat API or Cataas.
FAQ
How do I list every breed?
/breeds/list/all returns an object mapping each breed to an array of its sub-breeds (empty array if none). Breed names are lowercase and single words.
Can I get several images at once?
Yes — /breeds/image/random/6 or /breed/{breed}/images/random/6 (capped around 50).
Are the images free to use?
They come from an academic dataset. Fine for demos and hobby projects; verify licensing before commercial use.
New to APIs?
Short guides for working with this API — and any other.