MarketCheck caches few images from vehicle detail pages to make them available for later use when the original source may not be accessible. This endpoint allows you to retrieve these cached images using the unique listing identifier and image ID.
api_key
is not included in the URLs by default, you can include it by using the append_api_key=true
query parameterapi_key
to the request to access the imageimage_id
provided in the URLsGET https://api.marketcheck.com/v2/image/cache/car/{listing_id}/{image_id}
Path Parameters:
listing_id
: Specific identifier for the vehicle listingimage_id
: Specific identifier for the cached imageOften these URLs are provided in the response of the Inventory Search API or the Car Listing API
The following example demonstrates how to use the Cached Image API to retrieve a cached image using the listing ID and image ID.
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.marketcheck.com/v2/image/cache/car/b88c44a717bc0849bb58b4b64e9834a5/a777f1880b84a982e944441f23a76aca',
params: {api_key: 'YOUR_API_KEY'},
headers: {Accept: 'image/jpeg, application/json'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
To retrieve a cached image, you need to make a GET request to the Cached Image API endpoint with the required parameters.
Your MarketCheck API authentication key. Required for every request, unless OAuth is used.
listing_id
: The specific identifier for the car listing you want to retrieve the cached image for. This parameter is case-sensitive and must be provided in the URL path.image_id
: The specific identifier for the cached image you want to retrieve. This parameter is also case-sensitive and must be provided in the URL path.After performing a search using the Inventory Search API, in response you will receive list of cached image URLs for each listing in media.photo_links_cached
field.
You can use those URLs to retrieve the cached images directly.
Example:
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.marketcheck.com/v2/image/cache/car/b88c44a717bc0849bb58b4b64e9834a5/a777f1880b84a982e944441f23a76aca',
params: {api_key: 'YOUR_API_KEY'},
headers: {Accept: 'image/jpeg, application/json'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
Success Response:
200 OK
- Returns the cached image with appropriate content headers.Content-Type
: The MIME type of the image image/jpeg
Cache-Control
: Public, max-age=14400 (4 hours)Content-Length
: Size of the image file in bytesError Response:
Status Code | Description | Common Causes |
---|---|---|
400 | Bad Request | Invalid parameter values |
401 | Unauthorized | Missing/invalid API key |
403 | Forbidden | Access denied to resource |
422 | Unprocessable Entity | Invalid listing_id or image_id |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Temporary server issues |
502 | Bad Gateway | Issues with upstream services |
503 | Service Unavailable | API maintenance or downtime |
The response schema for the Cached Image API is straightforward, as it returns the JPEG image file directly. The response headers are set to indicate the content type and caching policy.