Cats API

Beginner's Pick Animals / API Key Intermediate HTTPS
61 C
Measured Score 0 50 100 Speed 10/30 Consistency 8/20 Security 20/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

Overview

The Cat API provides random cat images, breed data, and voting features. Beginners use it to learn image APIs and optional API key usage, since it works with or without a key.

Beginner Tip

Works without a key but limited to 10 req/hour. Register free at developers.thecatapi.com to raise the limit to 10 req/second.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.thecatapi.com/v1/images/search?limit=1
Result
HTTP 200 · application/json · 89 bytes · compressed
Response time
318 ms (median of 3) · fastest 242 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
cloudflare
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
id string d08
url string (url) https://cdn2.thecatapi.com/images/d08.jpg
width integer 468
height integer 665

Captured Response

Captured from a real request to https://api.thecatapi.com/v1/images/search?limit=1 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
[
  {
    "id": "d08",
    "url": "https://cdn2.thecatapi.com/images/d08.jpg",
    "width": 468,
    "height": 665
  }
]

Field Reference

id Unique identifier for the cat image
url Direct URL to the cat image (jpg or gif)
width Width of the image in pixels
height Height of the image in pixels

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://docs.thecatapi.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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist application/json
{
  "message": "404 - please consult the documentation for correct url to call. https://docs.thecatapi.com/"
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

429 Too Many Requests Exceeded unauthenticated rate limit of 10 requests per hour
Register for a free API key and pass it as header x-api-key
Empty array response No images match the breed_id filter you provided
Check valid breed IDs at /v1/breeds first before filtering
Image URL returns 404 CDN-cached image was deleted from upstream
Request a new random image rather than caching the URL long-term

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 10/30
Consistency 8/20
Security 20/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 318ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS NO
Category Animals
Difficulty Intermediate
Endpoint last called: 2026-08-10

Related Tags

Recipes Using Cats

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →