TheDogAPI
Free dog API with breed data: photos, temperament, weight, height, lifespan and breed groups. Works without a key for basic use. Tested curl example.
Endpoint tested and returned HTTP 200 on 20 Aug 2026
What is the TheDogAPI?
TheDogAPI is a free API providing dog photographs alongside detailed breed information — temperament, average weight and height, life span, bred-for purpose and breed group. Basic image requests need no key.
TheDogAPI is the canine counterpart to TheCatAPI, from the same team and with the same interface. Its breed database is the substantive part: temperament descriptors, size ranges and life expectancy for each recognised breed.
As with TheCatAPI, random image requests work with no key, while breed filtering and larger result sets require registering for a free one. The `x-api-key` header is the authentication mechanism, not a query parameter.
Quick facts
- Base URL
https://api.thedogapi.com/v1- Authentication
- Basic image requests work with no key. A free key unlocks breed filtering, pagination and larger limits.
- Rate limit
- Keyless requests are limited and return small result sets; a free key raises the allowance.
- Pricing
- Free tier with optional free key. Paid plans for high volume.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the TheDogAPI
Every request below was executed against the live API on 20 Aug 2026, and the response shown is the real body it returned — not an illustration.
1. Fetch a random dog image
GET https://api.thedogapi.com/v1/images/search
curl 'https://api.thedogapi.com/v1/images/search'const res = await fetch("https://api.thedogapi.com/v1/images/search");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.thedogapi.com/v1/images/search", timeout=20)
res.raise_for_status()
print(res.json())[
{
"id": "sGQvQUpsp",
"url": "https://s3.us-west-2.amazonaws.com/cdn2.thedogapi.com/images/sGQvQUpsp.jpg",
"width": 1080,
"height": 1080
}
]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
images/search | path | Optional | Random dog images. images/search |
limit | integer | Optional | Number of images. Capped without a key. 1 |
breed_ids | string | Optional | Filter by breed — requires an API key. 1 |
breeds | path | Optional | The full breed database. breeds |
x-api-key | header | Optional | Free API key for the full feature set. live_xxx |
Response fields
idstring- Image identifier.
urlstring- Direct image URL, renderable straight into an img tag.
width / heightinteger- Native dimensions — useful for avoiding layout shift.
breedsarray- Breed objects when available, with temperament and measurements.
breeds[].temperamentstring- Comma-separated temperament descriptors.
breeds[].life_spanstring- Typical life expectancy range.
breeds[].bred_for / breed_groupstring- Original purpose and kennel club group.
What you can build with the TheDogAPI
- Build a dog breed browser with photos and temperament data
- Add pet imagery to an adoption or veterinary site
- Create a breed comparison or selection tool
- Test image handling with real, varied dimensions
Common errors and how to fix them
401
Invalid API key.
Fix: Send it in the `x-api-key` header, not as a query parameter.
Empty breeds array
Most images are not linked to a breed.
Fix: Use the /breeds endpoint for breed data, or filter images with breed_ids using a key.
limit ignored
Keyless requests are capped at a small number.
Fix: Register a free key to request larger result sets.
TheDogAPI — frequently asked questions
Can I use TheDogAPI without a key?
Yes for basic random image requests, which is what the example here does. Breed filtering, pagination and larger limits need a free API key.
What breed information is available?
Temperament, average weight and height ranges, life span, what the breed was originally bred for, and its kennel club breed group.
How do I authenticate?
Send your key in the `x-api-key` HTTP header. It is not accepted as a query parameter.
Is it related to TheCatAPI?
Yes, same team and an identical interface, so code written against one works against the other by changing the hostname.
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 TheDogAPI
If TheDogAPI does not fit, these entertainment 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 |
|---|---|---|---|---|
| Official Joke API | Free joke API with no key: random jokes with setup and punchline, filterable by type. Perfect for beginner projects. Tested curl example and live JSON. | No key | Yes | 19 Aug 2026 |
| icanhazdadjoke | Free dad joke API with no key. Returns jokes as JSON, plain text or image depending on the Accept header. Search supported. Tested curl example included. | No key | Yes | 19 Aug 2026 |
| chucknorris.io | Free Chuck Norris jokes API with no key. Random jokes, 16 categories and full-text search. CORS enabled. Tested curl example and live JSON response. | No key | Yes | 19 Aug 2026 |
| Advice Slip | Free advice API with no key. Returns random advice slips as JSON, with search and id lookup. CORS enabled. Tested curl example and live response. | No key | Yes | 19 Aug 2026 |
| Useless Facts | Free random facts API with no key: random or daily trivia facts in English and German with source attribution and permalinks. Tested curl example. | No key | Yes | 19 Aug 2026 |
| xkcd | Free xkcd comic API with no key: fetch any comic by number or the latest, with image URL, title, alt text and publication date. Tested curl example. | No key | No | 19 Aug 2026 |
TheDogAPI is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 20 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.