### Example Image Response (Array) Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR This is an example of the JSON response when requesting an array of image objects. ```json [{ "id":"ebv", "url":"https://cdn2.thecatapi.com/images/ebv.jpg", "width":176,"height":540, "breeds":[], "favourite":{} }] ``` -------------------------------- ### Example Image Response (Single Object) Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR This is an example of the JSON response when requesting a single image by its ID. ```json { "id":"0XYvRd7oD", "width":1204,"height":1445, "url":"https://cdn2.thecatapi.com/images/0XYvRd7oD.jpg", "breeds":[{ "weight":{"imperial":"7 - 10","metric":"3 - 5"}, "id":"abys","name":"Abyssinian", "temperament":"Active, Energetic, Independent, Intelligent, Gentle", "origin":"Egypt", "country_codes":"EG", "country_code":"EG", "life_span":"14 - 15", "wikipedia_url":"https://en.wikipedia.org/wiki/Abyssinian_(cat)" }] } ``` -------------------------------- ### Get Image by ID Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR Retrieve a specific cat image using its unique ID. ```APIDOC ## GET /v1/images/{IMAGE_ID} ### Description Retrieves an individual Image by using its unique ID. ### Method GET ### Endpoint /v1/images/{IMAGE_ID} ### Parameters #### Path Parameters - **IMAGE_ID** (string) - Required - The unique ID of the image to retrieve. ### Response #### Success Response (200) - **Image Object**: Contains `id`, `width`, `height`, `url`, and `breeds` information. #### Response Example ```json { "id":"0XYvRd7oD", "width":1204,"height":1445, "url":"https://cdn2.thecatapi.com/images/0XYvRd7oD.jpg", "breeds":[ { "weight":{"imperial":"7 - 10","metric":"3 - 5"}, "id":"abys","name":"Abyssinian", "temperament":"Active, Energetic, Independent, Intelligent, Gentle", "origin":"Egypt", "country_codes":"EG", "country_code":"EG", "life_span":"14 - 15", "wikipedia_url":"https://en.wikipedia.org/wiki/Abyssinian_(cat)" } ] } ``` ``` -------------------------------- ### Get Bengal Images with API Key Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR Retrieve 10 images of a specific breed (Bengal) by providing the breed ID and your API key. ```url https://api.thecatapi.com/v1/images/search?limit=10&breed_ids=beng&api_key=REPLACE_ME ``` -------------------------------- ### Get Random Image URL Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR Use this URL to fetch a single random image from the API. ```url https://api.thecatapi.com/v1/images/search ``` -------------------------------- ### Get Multiple Random Image URLs Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR Fetch up to 10 random images by specifying the limit query parameter. ```url https://api.thecatapi.com/v1/images/search?limit=10 ``` -------------------------------- ### Get Image by ID Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR Retrieve a specific image using its unique ID in the request URL. ```url https://api.thecatapi.com/v1/images/0XYvRd7oD ``` -------------------------------- ### Get Random Images Source: https://developers.thecatapi.com/view-account/ylX4blBYT9FaoVd6OhvR Retrieve a random cat image or a specified number of random images. ```APIDOC ## GET /v1/images/search ### Description Retrieves a random cat image. You can specify the number of images to return using the `limit` query parameter. ### Method GET ### Endpoint /v1/images/search ### Query Parameters - **limit** (1-100) - Optional - Number of images to return between. Default is 1. - **page** (0-n) - Optional - The page number to use when paginating through the images. Default is 0. - **order** (ASC/DESC/RAND) - Optional - The order to return the images in by their upload date. `RAND` = `random`. Default is RAND. - **has_breeds** (1 or 0) - Optional - Only return images that have breed information. Default is 0. - **breed_ids** (Comma delimited string) - Optional - The IDs of the breeds to filter the images. e.g. `?breed_ids=beng,abys`. - **category_ids** (Comma delimited string) - Optional - The IDs of the categories to filter the images. e.g. `?breed_ids=1,5,14`. - **sub_id** (String) - Optional - Filter images that have the `sub_id` value you used when uploading them. ### Request Example ``` https://api.thecatapi.com/v1/images/search?limit=10 ``` ### Response #### Success Response (200) - **Array of Image Objects**: Each object contains `id`, `url`, `width`, `height`, `breeds`, and `favourite` information. #### Response Example (Array of Image Objects) ```json [ { "id":"ebv", "url":"https://cdn2.thecatapi.com/images/ebv.jpg", "width":176,"height":540, "breeds":[], "favourite":{} } ] ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.