Images
Search, list, and upload cat images.
Search images
curl -H "x-api-key: YOUR-API-KEY" "https://api.thecatapi.com/v1/images/search?limit=2"
Example response:
[
{
"id": "KWdLHmOqc",
"url": "https://cdn2.thecatapi.com/images/KWdLHmOqc.jpg",
"width": 3114,
"height": 2609,
"breeds": []
}
]
Useful search filters
| Parameter | Example | Description |
|---|---|---|
limit | 10 | Number of images to return (1–100 with an API key). |
page | 0 | Zero-based page index, see pagination. |
order | RAND | ASC, DESC or RAND by upload date. |
has_breeds | 1 | Only return images that have breed information. |
breed_ids | abys,beng | Comma-separated breed IDs to filter by. |
include_breeds | 1 | Embed the full breed objects in each image. |
include_categories | 1 | Embed category objects in each image. |
sub_id | my-user-123 | Only images uploaded with this sub_id. |
For example, two random Abyssinian images with breed details attached:
curl -H "x-api-key: YOUR-API-KEY" "https://api.thecatapi.com/v1/images/search?limit=2&breed_ids=abys&include_breeds=1"
Get an image by ID
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/images/KWdLHmOqc
Upload an image
curl -X POST -H "x-api-key: YOUR-API-KEY" -F "file=@/path/cat.jpg" https://api.thecatapi.com/v1/images/upload
Synchronous Upload
Upload an image and wait for the analysis (breed detection and categorisation) to complete before the response is returned. This endpoint lives on the dedicated upload host.
curl -X POST -H "x-api-key: YOUR-API-KEY" -F "file=@/path/cat.jpg" https://upload.thecatapi.com/v1/images/upload-sync
See Image Uploads for the full upload flow, status polling and quota checks.
Check Image Status
Poll this endpoint to check if an uploaded image has been processed.
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/images/IMAGE_ID/status
Example Status Response
{
"id": "my-image-123",
"status": "clean",
"updated_at": "2024-01-01T12:00:00.000Z"
}
List your uploaded images
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/images
Filter by sub_id
curl -H "x-api-key: YOUR-API-KEY" "https://api.thecatapi.com/v1/images?sub_id=YOUR-SUB-ID"
Delete an uploaded image
curl -X DELETE -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/images/IMAGE_ID
Get Image Labels
Retrieve the AI-generated labels (breeds, categories) for one of your uploaded images.
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/images/IMAGE_ID/labels