> ## 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/currency — курсы валют для конвертации USD

> Получите таблицу курсов валют с базой USD, которую использует CSBoard в платежных потоках. Умножайте любой price_usd на курс целевой валюты, чтобы получить цену в локальной валюте.

Все цены в API CSBoard выражены в USD. Эндпоинт currency возвращает ту же таблицу курсов, что используется во внутренних потоках сайта для платежей и отображения цен, обеспечивая единый слой конвертации для показа пользователям цен в локальной валюте. Курсы получаются из OpenExchangeRates для основных валют и из Центрального банка России для RUB; кэшируются примерно на один час.

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

## Параметры

Этот эндпоинт не принимает query-параметров.

## Поля ответа

**base** `string` *required*

Всегда `"USD"`. Все курсы выражены относительно одного доллара США.

**rates** `object` *required*

Соответствие кодов валют ISO 4217 их курсам к USD (единиц этой валюты за 1 USD). Пример: `{ "USD": 1, "EUR": 0.92, "RUB": 78.4, "GBP": 0.79 }`.

**updated\_at** `datetime` *required*

Временная метка ISO 8601, когда таблица курсов была последний раз обновлена.

**rub\_source** `string`

Идентификатор источника курса RUB, например `"cbr"` (Центральный банк России).

**base\_source** `string`

Идентификатор источника для курсов, отличных от RUB, например `"openexchangerates"`.

## Конвертация цен

Чтобы отобразить значение `price_usd` в локальной валюте, умножьте его на соответствующий курс:

```
local_price = price_usd × rates["EUR"]
# например, 14.37 USD × 0.92 = 13.22 EUR
```

Поскольку таблица курсов кэшируется примерно на 1 час, запрашивайте её один раз при старте приложения и периодически обновляйте, а не вызывайте этот эндпоинт для каждого товара.

## Пример запроса

```bash theme={null}
curl https://csboard.com/v1/currency \
  -H "Authorization: Bearer csb_pub_..."
```

## Пример ответа

```json theme={null}
{
  "base": "USD",
  "rates": {
    "USD": 1,
    "EUR": 0.92,
    "RUB": 78.4,
    "GBP": 0.79
  },
  "updated_at": "2026-06-29T17:00:00Z",
  "rub_source": "cbr",
  "base_source": "openexchangerates"
}
```

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

| HTTP-статус | Код | Значение |
| - | - | - |
| 401 | `missing_api_key`, `invalid_api_key` | Отсутствует или некорректный API-ключ. |
| 429 | `rate_limit_exceeded` | Превышен лимит чтения ключа (по умолчанию 100/мин). Перед повтором сверьтесь с заголовком `Retry-After`. |

> [!TIP]
>
> Кэшируйте ответ rates на стороне клиента и обновляйте не чаще одного раза в час. Курсы обновляются на том же \~1-часовом цикле, поэтому более частые опросы не дадут более свежих данных и впустую расходуют лимит запросов.


## OpenAPI

````yaml GET /currency
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: Instant Sell
    description: >-
      Sell CS2, Dota 2 and Rust items from any Steam inventory to the CSBoard
      network and get paid to your balance. Invite-only.
  - name: P2P
    description: >-
      List your own CS2 skins on the CSBoard P2P market. Free — any valid key,
      no balance requirement.
  - name: Account
    description: Your balance, settled funds, and trading status.
  - name: Webhooks
    description: Register an endpoint and receive signed order updates instead of polling.
paths:
  /currency:
    get:
      tags:
        - Market data
      summary: FX rates (USD base)
      description: >-
        FX rates with USD as the base. Every price in this API is USD — use this
        to convert to a local currency. Same rate table the site and payment
        flows use (cached ~1h).
      operationId: getCurrency
      responses:
        '200':
          description: Current FX rates.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Currency'
              example:
                base: USD
                rates:
                  USD: 1
                  EUR: 0.92
                  RUB: 78.4
                  GBP: 0.79
                updated_at: '2026-06-29T17:00:00Z'
                rub_source: cbr
                base_source: openexchangerates
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Currency:
      type: object
      properties:
        base:
          type: string
          example: USD
        rates:
          type: object
          additionalProperties:
            type: number
          description: Currency code → units per 1 USD.
        updated_at:
          type: string
          format: date-time
        rub_source:
          type: string
        base_source:
          type: string
      required:
        - base
        - rates
        - updated_at
    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, item_unavailable adds unavailable_ids and, on
        CS2 buys, unknown_ids).
      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
    RateLimitError:
      type: object
      description: >-
        The `429` body of a per-key bucket. Endpoint-specific limits send only
        `code` and `detail`.
      properties:
        code:
          type: string
          description: >-
            `rate_limit_exceeded` for the key's buckets. Endpoint-specific
            limits use their own code (`snapshot_rate_limited`, `rate_limited`).
        detail:
          type: string
          description: Human-readable explanation.
        bucket:
          type: string
          enum:
            - read
            - trading
            - buy_orders
          description: Which bucket is spent.
        limit_per_min:
          type: integer
          description: That bucket's ceiling per minute.
        retry_after_sec:
          type: integer
          minimum: 1
          maximum: 60
          description: >-
            Seconds until the window restarts — the same number as
            `Retry-After`.
      required:
        - code
  responses:
    Unauthorized:
      description: Missing or invalid API key (`missing_api_key` or `invalid_api_key`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: missing_api_key
            detail: >-
              Provide your API key via `Authorization: Bearer csb_pub_…`.
              Generate one at https://csboard.com/profile?tab=api
    RateLimited:
      description: >-
        A per-key limit is spent. The key's own buckets answer
        `rate_limit_exceeded` with `bucket` (`read`, `trading` or `buy_orders`),
        `limit_per_min` and `retry_after_sec`. `Retry-After` is the seconds left
        until the one-minute window restarts (1–60), not a flat 60.
        Endpoint-specific limits (`snapshot_rate_limited` on the price snapshot,
        `rate_limited` on Instant Sell) send only `code` and `detail`.
      headers:
        Retry-After:
          description: >-
            Seconds until the one-minute window restarts (1–60). Waiting that
            long is always enough.
          schema:
            type: integer
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-RateLimit-Bucket:
          $ref: '#/components/headers/X-RateLimit-Bucket'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          example:
            code: rate_limit_exceeded
            detail: >-
              Read rate limit of 100 requests/min exceeded. The counter restarts
              in 23 s. For new listings use GET /v1/listings/stream instead of
              polling.
            bucket: read
            limit_per_min: 100
            retry_after_sec: 23
  headers:
    X-RateLimit-Limit:
      description: >-
        The ceiling per minute of the bucket this call spent (named in
        `X-RateLimit-Bucket`).
      schema:
        type: integer
      example: 3000
    X-RateLimit-Remaining:
      description: Calls left on that bucket in the current one-minute window.
      schema:
        type: integer
        minimum: 0
      example: 2987
    X-RateLimit-Reset:
      description: >-
        Seconds until the one-minute window restarts and the counter starts
        again.
      schema:
        type: integer
        minimum: 1
        maximum: 60
      example: 41
    X-RateLimit-Bucket:
      description: >-
        The bucket this call spent: `read` (reads and every other keyed call) or
        `trading` (buys, order reads, claims, cancels, balance). A `429` from
        the buy-order limit says `buy_orders`.
      schema:
        type: string
        enum:
          - read
          - trading
          - buy_orders
      example: trading
  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. Calls made with a
        key are metered only by that key's own limits — there is no per-IP limit
        on top — and every answer carries `X-RateLimit-Limit`,
        `X-RateLimit-Remaining`, `X-RateLimit-Reset` and `X-RateLimit-Bucket`
        for the bucket the call spent. See [Rate limits](/rate-limits).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.