# Cached Image API

Canonical URL: https://developers.marketcheck.com/uk/apis/cached-image

Updated: Nov 16, 2026

This is the Markdown version of https://developers.marketcheck.com/uk/apis/cached-image. Every page of this site has one at its own address with .md added (the home page's is https://developers.marketcheck.com/uk/index.md). The prices are at https://developers.marketcheck.com/uk/pricing.md.

> One GET returns a UK dealer listing's photo as a JPEG, by listing id and image id. Recorded UK requests, the headers they answered with and screens.

Cached Image returns a UK listing's photo as a JPEG from MarketCheck's servers, for when the photo on the dealer's website is no longer reachable. Its addresses come in the cached photo links of UK search and listing responses.

- Endpoint: `GET https://api.marketcheck.com/v2/image/cache/car/{listing_id}/{image_id}`, with `api_key` as a query parameter
- Regions: United Kingdom
- Docs: https://docs.marketcheck.com/uk/docs/api/cars/vehicle-listing/cached-image
- This page: https://developers.marketcheck.com/uk/apis/cached-image

## Good to know
- The response is the JPEG itself, not JSON: read the status and the `Content-Type`, `Content-Length` and `Cache-Control` headers.
- Private caching only: a photo may be cached on individual machines for up to four hours, never on public CDNs or shared publicly.
- Send `append_api_key=false` with a listing call: one recorded without it put the key in every photo URL, though the UK docs default it to `false`.
- A photo URL without the key needs `api_key` added when you fetch it.

## Use cases

### A photo slot that falls back to the cached copy
A listing page fills its photo slot from a cached URL when the dealer's photo no longer loads. The call answers with the JPEG, and its Cache-Control header marks it private: the browser may keep it, a shared cache may not.

Request: One cached photo of one UK listing, by its listing id and image id.
```bash
curl "https://api.marketcheck.com/v2/image/cache/car/f82ff8217f9969f1e2fe71edd4846f14/93663ea26ed90f2285f3a56438484403?api_key=YOUR_API_KEY"
```

Response (recorded Nov 16, 2026). The endpoint answers with the JPEG itself. Shown here are the HTTP status and the response headers that describe the image (its type, size and caching), not the image.
```json
{
  "status": 200,
  "headers": {
    "content-type": "image/jpeg",
    "content-length": "71784",
    "cache-control": "private, max-age=14400"
  }
}
```

### Photo URLs that carry no key
A pipeline or an assistant that passes photo URLs along should not pass your key with them. Fetch the listing with append_api_key=false and media.photo_links_cached holds cached image URLs with no key; add api_key only when a photo is fetched.

Request: Full details for one UK listing, with append_api_key=false so that its photo URLs carry no key.
```bash
curl "https://api.marketcheck.com/v2/listing/car/uk/14d30ec2d1b6d2269429bfce06def6db4468a5d2bc8abaf9b0fb201745e6d549?api_key=YOUR_API_KEY&append_api_key=false"
```

Response (recorded Nov 16, 2026). Showing the listing's heading and build, and the first 3 of 23 cached photo URLs it returned (only those were recorded); the rest of the listing is left out.
```json
{
  "id": "14d30ec2d1b6d2269429bfce06def6db4468a5d2bc8abaf9b0fb201745e6d549",
  "heading": "Ford Puma 1.0T EcoBoost MHEV ST-Line Vignale Euro 6 (s/s) 5dr - 2022 (72 plate)",
  "build": {
    "year": 2022,
    "make": "Ford",
    "model": "Puma",
    "trim": "St-line Vignale Mhev",
    "body_type": "SUV"
  },
  "media": {
    "photo_links_cached": []
  }
}
```

## Key parameters
- `listing_id` (string, required): Specific identifier for the vehicle listing
- `image_id` (string, required): Specific identifier for the cached image
- `api_key` (string, required): Your MarketCheck API authentication key. Required for every request, unless OAuth is used.
- `append_api_key` (boolean): If `true`, the response URLs (such as cached images & relevant links) include the `api_key` query parameter along with value; if `false`, they do not. Default: `false`.

## Questions

### What does the MarketCheck Cached Image API return for a UK listing?
The MarketCheck Cached Image API returns one photo of a UK dealer listing as a JPEG file, not JSON. A GET to /v2/image/cache/car/{listing_id}/{image_id} with your key answers with the image and its headers: Content-Type, the size in Content-Length and Cache-Control, for when the dealer's own photo is no longer reachable.

### Where do the listing_id and image_id of a UK cached photo come from?
A UK cached photo's listing_id and image_id come from the cached photo URLs in media.photo_links_cached, which MarketCheck's UK Inventory Search and UK Car Listing Details return for each listing. Each URL is a complete Cached Image request, with the listing_id and the image_id in its path. A data feed from MarketCheck that includes cached image URLs works the same way.

### Should UK cached photo URLs carry my API key?
Cached photo URLs should not carry your key once they leave your server. A Cached Image URL that carries your key shows the key to anyone who sees the URL. Ask for the URLs with append_api_key=false, which a recorded UK listing call needed despite the docs' default, and add api_key to the request only when your server fetches a photo.

## Related APIs
- Car Listing Details: https://developers.marketcheck.com/uk/apis/listing-details
- Inventory Search: https://developers.marketcheck.com/uk/apis/inventory-search

## Price per call
What one call costs on each UK plan, in pounds, from the UK Data Fee Schedule. The fee is charged in addition to the plan's monthly price. Per-call rates are lower on Growth and Scale than on Starter.

| Endpoint | Starter (£0/mo) | Growth (£249/mo) | Scale (£599/mo) | Enterprise |
| --- | --- | --- | --- | --- |
| Cached Images | £0.012 (£12.00 per 1,000) | £0.008 (£8.00 per 1,000) | £0.006 (£6.00 per 1,000) | Set with our team |

The UK Data Fee Schedule: https://developers.marketcheck.com/uk/pricing.md

Replace YOUR_API_KEY with your key from https://developers.marketcheck.com/uk/api-keys, and call the API from your server so the key stays private.
