You can make as many requests as you like to api/images/get without an API key, but you'll only get access to the first 1000 Images. With an API Key you get access to all the Images, and you can Vote, Favourite and even Upload your own pictures.
This lets you pass a unique identifier, like a Facebook or Twitter User id, with your API requests. This way you can get all the Favourites and Votes set by one of your Users. We don't care what it is and will not use this information for anything else.
Important: To protect yourself from Copyright issues, when you show an Image you MUST have it linked to; or clearly show the 'source_url' the value of the XML, or leave the link in-place with HTML format. This then links back to the image on thecatapi.com, where we then link to where we do the same to the last known Copyright holder.
| Name | Values | Required | Description | Default |
|---|---|---|---|---|
| api_key | apply for one | No | Passing this gives you access to all the images, voting, favouriting, uploading etc | none |
| image_id | string | No | Unique id of the Image to return. Will only ever return one Image. | none |
| format | xml / html / src | No | The output format, as XML, an HTML img tag, or the src to use in an img tag. | src |
| results_per_page | Between 1 and 100 | No | The number of Cats to respond with. If format is set to src then only one will be returned. | 1 |
| type | jpg / png / gif | No | A comma separated string of file types to return. e.g. jpg,png | jpg,gif,png |
| category | complete list | No | Filter the Cats returned to those wearing hats, in space, in boxes etc. | none |
| size | small, med, full | No | Size of returned Images, small = 250x, med = 500x, full = original size. | full |
| sub_id | string | No | Passing this will return the value of any Favourite or Votes set with the same sub_id for the image. | none |
http://thecatapi.com/api/images/get?format=xml&results_per_page=20
| Name | Values | Required | Description | Default |
|---|---|---|---|---|
| api_key | Yes | none | ||
| image_id | string | Yes | Unique id of the image to vote on. | none |
| score | integer | Yes | The score you want to give to the image 1 = bad / 10 = good. | none |
| sub_id | string | No | Any value you wish to associate with this vote, could be a unique id you have for one of your Users like a facebook id. This allows you to only have one vote on an Image per User. | none |
http://thecatapi.com/api/images/vote?api_key=[YOUR-API-KEY]&sub_id=12345&image_id=bC24&score=10
| Name | Values | Required | Description | Default |
|---|---|---|---|---|
| api_key | Yes | none | ||
| sub_id | string | No | If this is passed, then only votes cast with this sub_id will be returned. Useful to find out which votes have been cast by which of your Users. | none |
http://thecatapi.com/api/images/getvotes?api_key=[YOUR-API-KEY]&sub_id=12345
| Name | Values | Required | Description | Default |
|---|---|---|---|---|
| api_key | Yes | none | ||
| image_id | string | Yes | Unique id of the image to favourite or un-favourite | none |
| action | string (add or remove) | No | This allows you to say whether to add a favourite or remove it | add |
| sub_id | string | No | Any value you wish to associate with this, could be a unique id you have for one of your Users like a facebook id. This allows you to favourite this Image once per User. | none |
http://thecatapi.com/api/images/favourite?api_key=[YOUR-API-KEY]&sub_id=12345&image_id=bC24
http://thecatapi.com/api/images/favourite?api_key=[YOUR-API-KEY]&sub_id=12345&image_id=bC24&action=remove
| Name | Values | Required | Description | Default |
|---|---|---|---|---|
| api_key | Yes | none | ||
| sub_id | string | No | If this is passed, then only the Favourites cast with this sub_id will be returned. Great for finding out which Images have been Favourited by a User. | none |
http://thecatapi.com/api/images/getfavourites?api_key=[YOUR-API-KEY]&sub_id=12345
| Name | Values | Required | Description | Default |
|---|---|---|---|---|
| api_key | Yes | none | ||
| image_id | string | Yes | Unique id of the image to report | none |
| sub_id | string | No | Any value you wish to associate with this, could be a unique id you have for one of your Users like a facebook id. This allows you to favourite this Image once per User. | none |
| reason | string | No | Any particular reason why it needs reporting, contains nothing but hippos, doesn't work etc | none |
http://thecatapi.com/api/images/report?api_key=[YOUR-API-KEY]&sub_id=12345&image_id=8
http://thecatapi.com/api/categories/list
| Name | Required | Default |
|---|---|---|
| api_key | Yes | none |
http://thecatapi.com/api/stats/getoverview?api_key=[YOUR-API-KEY]