Dog CEO API
Free dog image API with no key: 20,000+ photos across 100+ breeds and sub-breeds, random or filtered. CORS enabled. Tested curl example and live JSON.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the Dog CEO API?
The Dog CEO API is a free API serving over 20,000 dog photographs organised by breed and sub-breed. It requires no API key, supports random and breed-filtered requests, and is CORS-enabled.
Dog CEO is built on the Stanford Dogs Dataset and exposes it through an unusually clean URL scheme: `/breeds/image/random` for any dog, `/breed/hound/images` for a specific breed, and `/breed/hound/afghan/images` for a sub-breed.
The breed and sub-breed hierarchy makes it a better teaching API than it first appears. Building a breed picker that loads sub-breeds only after a breed is chosen is a realistic dependent-dropdown exercise using real data.
Quick facts
- Base URL
https://dog.ceo/api- Authentication
- No key required.
- Rate limit
- No published limit.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Dog CEO API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Fetch a random dog image
GET https://dog.ceo/api/breeds/image/random
curl 'https://dog.ceo/api/breeds/image/random'const res = await fetch("https://dog.ceo/api/breeds/image/random");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://dog.ceo/api/breeds/image/random", timeout=20)
res.raise_for_status()
print(res.json()){
"message": "https://images.dog.ceo/breeds/spaniel-brittany/n02101388_1249.jpg",
"status": "success"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<breed> | path | Optional | Breed name, lowercase, e.g. /breed/hound/images. hound |
<subbreed> | path | Optional | Sub-breed under a breed, e.g. /breed/hound/afghan/images. afghan |
random/<count> | path | Optional | Number of random images, up to 50. random/3 |
Response fields
messagestring|array|object- The payload — an image URL, an array of URLs, or the breed list object depending on endpoint.
statusstring- `success` or `error`. Check before using `message`.
What you can build with the Dog CEO API
- Build a breed and sub-breed dependent dropdown with real data
- Test image grids, lazy loading and infinite scroll
- Add random pet photos to a veterinary or adoption site
- Practise handling a response field whose type varies by endpoint
Common errors and how to fix them
status: error, 'Breed not found'
Unknown breed name.
Fix: Fetch the valid list from /breeds/list/all — breed names are lowercase and sub-breeds are a separate path segment.
Unexpected message type
`message` is a string on random endpoints and an array on list endpoints.
Fix: Branch on the endpoint you called rather than assuming a single shape.
Dog CEO API — frequently asked questions
Is the Dog API free?
Yes, Dog CEO is completely free with no API key and no signup, and it is CORS-enabled for direct browser use.
How do I list all available dog breeds?
Request /breeds/list/all, which returns an object keyed by breed with an array of sub-breeds for each — ideal for building dependent dropdowns.
How many dog images are there?
Over 20,000 across more than 100 breeds, sourced from the Stanford Dogs Dataset.
Why is the message field sometimes a string and sometimes an array?
It holds whatever the endpoint returns — a single URL for random requests, an array for list requests, and an object for the breed list. Handle the shape per endpoint.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Image Cropper
Crop images online to an exact rectangle with pixel-precise x, y, width and height inputs or aspect-ratio presets. Free, private and browser-based.
Dog CEO is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.