Skip to main content

Working with 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

List your uploaded images

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

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

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