Votes and Favourites
Create and list votes or favourites for images.
List favourites
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/favourites
Create a favourite
curl -X POST -H "Content-Type: application/json" -H "x-api-key: YOUR-API-KEY" \
-d '{"image_id": "KWdLHmOqc"}' \
https://api.thecatapi.com/v1/favourites
Add a sub_id to the body to record which of your users favourited the image, then filter with ?sub_id= when listing.
Vote on an image
curl -X POST -H "Content-Type: application/json" -H "x-api-key: YOUR-API-KEY" \
-d '{"image_id": "KWdLHmOqc", "value": 1}' \
https://api.thecatapi.com/v1/votes
Try It: Vote on Cats
📦 Source Code: View on GitHub
Get a favourite
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/favourites/FAVOURITE_ID
Delete a favourite
curl -X DELETE -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/favourites/FAVOURITE_ID
List votes
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/votes
Get a vote
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/votes/VOTE_ID
Votes are a permanent record of user sentiment and cannot be deleted. To reverse a vote, post a new vote with the opposite value.