The Dog API

⭐ Beginner's Pick Animals / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

The Dog API provides hundreds of dog breed images, searchable breed metadata like temperament and life span, and user-uploaded photo voting. It requires a free API key but registration takes under a minute and the free tier is generous enough for most hobby projects. Use it to build breed encyclopedias, random dog photo generators, or pet-matching quizzes.

💡

Beginner Tip

Register at https://thedogapi.com to get your free API key, then add the header "x-api-key: YOUR_KEY" to every request — without it most endpoints return a 401 error.

Available Data

random dog image URLs
breed and sub-breed lists
breed-specific images

Example Response

JSON Response
{
  "message": "https://images.dog.ceo/breeds/retriever-golden/n02099601_1.jpg",
  "status": "success"
}

Field Reference

[].id Unique numeric identifier for the breed
[].name Official breed name, e.g. "Labrador Retriever"
[].temperament Comma-separated list of personality traits
[].life_span Typical life expectancy range, e.g. "10 - 12 years"
[].image.url Direct URL to a representative photo of the breed

Implementation Example

const url = "https://thedogapi.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Missing or incorrect x-api-key header
Add -H "x-api-key: YOUR_API_KEY" to your curl command or set the header in your HTTP client
Empty results array Querying a breed name that does not match the database spelling exactly
Call /breeds first to list all valid breed names and pick the exact string from there
CORS blocked in browser The API does not send CORS headers, so browser fetch calls fail
Route requests through your own backend server when building a web app

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 9/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS NO
Category Animals
Difficulty Intermediate
Verified: 2026-04-07

Similar APIs

View All →