# How to Download and Cache All Current CS2 Prices

> `GET /v1/prices/latest` returns one current snapshot containing every tracked item and all six marketplaces, which can be stored as a local read cache.

The response is large and `Accept-Encoding: gzip` is required. The saved representation should keep the response envelope and source objects intact so freshness and missing-data rules can be changed later.

## What the snapshot contains

- `response_time`, `currency`, and an `items` map keyed by exact `market_hash_name`.
- Source objects for BUFF, Youpin, CSFloat, Skinport, Steam, and C5Game, with unsupported or unavailable fields represented as null.
- Per-source `updated_at` and `collected_at` timestamps.
- Supported Doppler, Gamma Doppler, and Case Hardened records nested under `variants`.

Live prices generally refresh every ~5-10 minutes, with source-specific differences. A newly generated response can contain source rows collected at different times.

## Cache update model

Fetch the snapshot from a server process with bearer authentication and gzip enabled. Validate that the response has `currency: USD`, a parseable `response_time`, and an `items` map before making it visible to readers.

Write a complete new local representation and replace the prior cache only after validation. Updating individual item rows in place can leave a mixed snapshot if the update stops partway through. If the application keeps last-known values for missing rows, store them separately with their original `collected_at` rather than merging them into the current cache.

Index the cached `items` map locally for selected-item reads. This gives every lookup the same snapshot `response_time` and avoids repeated downloads during one application cycle.

## Applicable endpoint

| Endpoint | Returns | Plans |
| --- | --- | --- |
| `GET /v1/prices/latest` | Complete current item and source snapshot | All plans |

## Cache caveats

- `response_time` says when the API response was generated. Use each source's `collected_at` to decide whether that quote is fresh enough.
- An absent item or null source field is not a zero price. Keep the API's missing-data semantics in the cache.
- The snapshot contains current listing and bid observations, not a historical change log. Use OHLC history when the application needs prior values.
- The current-price reference does not document conditional ETag revalidation. Do not make cache correctness depend on an undocumented validator.

See [current item prices](/resources/how-to-get-current-cs2-item-prices) for source-field selection after the snapshot is cached.
