> ## Documentation Index
> Fetch the complete documentation index at: https://api.csboard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/prices/snapshot.ndjson.gz — полный снимок цен

> Скачайте полный каталог цен CSBoard в виде gzip-сжатого NDJSON. По одному PriceRow на строку. Спроектировано под массовую загрузку с условными запросами по ETag.

Эндпоинт snapshot отдаёт полный список цен CSBoard в виде одного gzip-сжатого файла NDJSON. Каждая распакованная строка — это один JSON-объект `PriceRow`, той же схемы, что возвращает `GET /v1/prices`. Это рекомендуемый путь для потребителей полного каталога: сайтов сравнения, арбитражных ботов или дата-пайплайнов, которым нужна полная локальная копия списка цен. Для точечных запросов по подмножеству товаров используйте `GET /v1/prices`.

**Требуется аутентификация.** Отправьте ключ как `Authorization: Bearer csb_pub_...`.

**Лимит запросов:** 1 запрос в минуту, отдельно от общего лимита 30 запросов/мин. Планируйте интервал опроса соответствующе.

## Заголовки запроса

<ParamField header="If-None-Match" type="string">
  Передайте значение `ETag` из предыдущего ответа snapshot, чтобы сделать условный запрос. Если снимок не изменился с момента этого ETag, сервер вернёт `304 Not Modified` без тела, экономя трафик и избегая повторной загрузки.
</ParamField>

## Заголовки ответа

| Заголовок          | Описание                                                                                                                            |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `ETag`             | Непрозрачная строка версии, идентифицирующая этот снимок. Сохраните её и отправьте обратно в `If-None-Match` при следующем запросе. |
| `Content-Encoding` | `gzip` — тело всегда сжато gzip.                                                                                                    |

## Тело ответа

Поток, сжатый gzip. После распаковки каждая строка (разделитель — перевод строки) представляет собой валидный JSON-объект, соответствующий схеме `PriceRow`:

| Поле               | Тип            | Описание                                  |
| ------------------ | -------------- | ----------------------------------------- |
| `market_hash_name` | string         | Steam market hash name.                   |
| `wear`             | string \| null | Диапазон износа или `null`.               |
| `doppler_phase`    | string \| null | Фаза Doppler или `null`.                  |
| `min_price_usd`    | number         | Самая дешёвая текущая цена продажи в USD. |
| `qty`              | integer        | Количество листингов в этой группе.       |

## Пример: загрузка и просмотр

```bash theme={null}
curl https://csboard.com/v1/prices/snapshot.ndjson.gz \
  -H "Authorization: Bearer csb_pub_..." \
  --output snapshot.ndjson.gz \
  && gunzip -c snapshot.ndjson.gz | head -5
```

Пример распакованного вывода:

```jsonl theme={null}
{"market_hash_name":"AK-47 | Redline (Field-Tested)","wear":"Field-Tested","doppler_phase":null,"min_price_usd":11.92,"qty":73}
{"market_hash_name":"AWP | Asiimov (Field-Tested)","wear":"Field-Tested","doppler_phase":null,"min_price_usd":54.20,"qty":12}
{"market_hash_name":"Karambit | Doppler (Factory New)","wear":"Factory New","doppler_phase":"Ruby","min_price_usd":1240.00,"qty":1}
```

## Пример: условный запрос с ETag

При первой загрузке вы получаете заголовок `ETag`. Передавайте его обратно в последующих запросах, чтобы не скачивать неизменённый снимок повторно:

```bash theme={null}
# Первый запрос — сохраните ETag из заголовков ответа
curl https://csboard.com/v1/prices/snapshot.ndjson.gz \
  -H "Authorization: Bearer csb_pub_..." \
  --dump-header headers.txt \
  --output snapshot.ndjson.gz

# Последующий запрос — условная загрузка
curl https://csboard.com/v1/prices/snapshot.ndjson.gz \
  -H "Authorization: Bearer csb_pub_..." \
  -H "If-None-Match: \"etag-value\"" \
  --output snapshot.ndjson.gz
```

Ответ `304 Not Modified` означает, что снимок идентичен уже имеющемуся у вас — повторная загрузка не нужна.

## Коды ошибок

| HTTP-статус | Код                     | Значение                                                                  |
| ----------- | ----------------------- | ------------------------------------------------------------------------- |
| 304         | *(без тела)*            | Снимок не изменился с переданного `If-None-Match` ETag.                   |
| 401         | `unauthorized`          | Отсутствует или некорректный API-ключ.                                    |
| 429         | `snapshot_rate_limited` | Превышен отдельный лимит снимка — 1 запрос/мин. Подождите перед повтором. |

<Tip>
  Всегда сохраняйте `ETag` из каждой успешной загрузки и отправляйте его обратно в `If-None-Match` при следующем запросе. Ответ `304` не расходует квоту лимита запросов и позволяет поддерживать локальную копию в актуальном состоянии без лишних повторных загрузок.
</Tip>

<Note>
  Этот эндпоинт предназначен для **массовой загрузки полного каталога**. Если вам нужны цены только для конкретного товара или отфильтрованного подмножества, используйте `GET /v1/prices` — он поддерживает фильтры по search, category и wear и не учитывается в лимите snapshot.
</Note>


## OpenAPI

````yaml GET /prices/snapshot.ndjson.gz
openapi: 3.1.0
info:
  title: CSBoard API
  version: 1.0.0
  description: >-
    Market data over the CSBoard marketplace — live listings, floats, stickers,
    minAsk prices, FX rates — plus opt-in buying straight from your balance.
    Free to read, key-gated, built for automation.
  contact:
    name: CSBoard
    url: https://csboard.com/docs
servers:
  - url: https://csboard.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Status
    description: Liveness and freshness probes.
  - name: Market data
    description: Read the live catalog, prices, and FX rates.
  - name: Trading
    description: Buy listings from your CSBoard balance. Opt-in, key-gated.
  - name: Account
    description: Your balance, settled funds, and trading status.
paths:
  /prices/snapshot.ndjson.gz:
    get:
      tags:
        - Market data
      summary: Full price-list snapshot (gzipped NDJSON)
      description: >-
        Full gzipped NDJSON dump of the price list — one price row JSON per
        line. Use this for full-catalog ingestion (e.g. comparison sites), not
        pagination. Rate limited to 1 request/minute. Supports ETag /
        If-None-Match: an unchanged snapshot returns 304 Not Modified.
      operationId: getPriceSnapshot
      parameters:
        - name: If-None-Match
          in: header
          description: >-
            Conditional request. Pass the ETag from a previous snapshot to
            receive 304 if unchanged.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Gzipped NDJSON stream. Each decompressed line is one PriceRow JSON
            object. Sets an ETag header.
          headers:
            ETag:
              description: >-
                Opaque snapshot version. Send back as If-None-Match to skip
                unchanged downloads.
              schema:
                type: string
          content:
            application/x-ndjson:
              schema:
                type: string
                format: binary
        '304':
          description: Not Modified — the snapshot has not changed since the ETag you sent.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: unauthorized
            message: Missing or invalid API key.
    RateLimited:
      description: Rate limit exceeded. Includes a Retry-After header.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rate_limit_exceeded
            message: Too many requests.
  schemas:
    Error:
      type: object
      description: >-
        All errors return { code, detail }. Some carry extra fields (e.g.
        price_moved adds current_total_usd, insufficient_balance adds
        required_usd/current_usd).
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code, e.g. rate_limit_exceeded,
            trading_not_enabled, price_moved.
        detail:
          type: string
          description: Human-readable explanation.
      required:
        - code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your key as a Bearer token on every request: `Authorization: Bearer
        csb_pub_...`. Generate keys in your CSBoard profile.

````