API Directory › 🐾 Animals › Dog CEO
No authHTTPSCORS

Dog CEO API

Free, no-key API serving thousands of dog images by breed.

Category
Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open Dog CEO docs ↗

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

https://dog.ceo/api

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
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
JavaScript
const { message } = await fetch("https://dog.ceo/api/breed/corgi/images/random")
  .then(r => r.json());
img.src = message;  // a jpg URL

Rate limits & quotas

No documented rate limit; images are CDN-hosted and responses are tiny. Cache the breed list — it changes rarely.

Key response fields

statussuccess or error
messageA URL (single image), an array of URLs (list), or an object of breeds → sub-breeds
codeHTTP-style code on errors

Common errors

status: error, code 404Unknown 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.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Animals APIs

← Back

More Animals APIs · All 196 APIs