Skip to main content

Images

Search, list, and upload dog images.

Search images

curl -H "x-api-key: YOUR-API-KEY" "https://api.thedogapi.com/v1/images/search?limit=2"

Example response:

[
{
"id": "BJa4kxc4X",
"url": "https://cdn.thedogapi.com/images/BJa4kxc4X.jpg",
"breeds": []
}
]

List an image by ID

curl -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images/BJa4kxc4X

Upload an image

curl -X POST -H "x-api-key: YOUR-API-KEY" -F "file=@/path/dog.jpg" https://api.thedogapi.com/v1/images/upload

Synchronous Upload

Upload an image and wait for the analysis (breeding/categorization) to complete before the response is returned.

curl -X POST -H "x-api-key: YOUR-API-KEY" -F "file=@/path/dog.jpg" https://api.thedogapi.com/v1/images/upload-sync

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.thedogapi.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.thedogapi.com/v1/images

Filter by sub_id

curl -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images?sub_id=YOUR-SUB-ID

Delete an uploaded image

curl -X DELETE -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images/IMAGE_ID

Get image analysis

curl -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images/IMAGE_ID/analysis

Get Image Labels

Retrieve the AI-generated labels (breeds, categories) for an image.

curl -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images/IMAGE_ID/labels

Tag an image with a breed

curl -X POST -H "Content-Type: application/json" -H "x-api-key: YOUR-API-KEY" \
-d '{"breed_id": 10}' \
https://api.thedogapi.com/v1/images/IMAGE_ID/breeds

List breeds for an image

curl -H "x-api-key: YOUR-API-KEY" https://api.thedogapi.com/v1/images/IMAGE_ID/breeds

Remove a breed tag

curl -X DELETE -H "x-api-key: YOUR-API-KEY" \
https://api.thedogapi.com/v1/images/IMAGE_ID/breeds/BREED_ID