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 19 Aug 2026
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 19 Aug 2026, 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.
Alternatives to Dog CEO API
If Dog CEO does not fit, these animal apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| Cat Facts | Free cat facts API with no key. Random feline facts as JSON, with pagination and length filtering. CORS enabled. Tested curl example and live response. | No key | Yes | 19 Aug 2026 |
| TheCatAPI | Free cat image API with breed data, filtering and search. Works without a key for basic use; free key unlocks more. Tested curl example and live JSON. | No key | Yes | 19 Aug 2026 |
| RandomFox | Free fox image API with no key. Returns a random fox photo URL as JSON. CORS enabled, minimal payload. Tested curl example and live response included. | No key | Yes | 19 Aug 2026 |
| HTTP Dog | Free HTTP status code API with no key: a dog photo for every HTTP status, as JSON metadata or direct images in JPG, WebP and AVIF. Tested example. | No key | No | 20 Aug 2026 |
| OBIS | Free marine biodiversity API with no key: 100M+ georeferenced species occurrence records with full taxonomy, depth, date and dataset provenance. Tested example included. | No key | Yes | 21 Aug 2026 |
| Paleobiology Database | Free fossil record API with no key: georeferenced occurrences with taxonomic identification, geological age bounds and collection provenance. Tested example included. | No key | Yes | 21 Aug 2026 |
Dog CEO is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 19 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.