# POST /v1/market/buff/history

OHLC history for BUFF float ranges and fade ranges since May 19, 2026.

Returns OHLC history for BUFF float ranges and fade ranges. Data begins on May 19, 2026.

Each range from [GET /v1/market/buff/latest](/docs/market-buff-latest) has its own time series, including ranges for Doppler, Gamma Doppler, and Case Hardened variants. OHLC is computed for `ask`, `avg_ask`, and `bid`; `ask_volume` and `bid_volume` are the last values observed in the interval. Data updates every 10 minutes. Max 100 items per request.

## Access

Requires a Scale or Enterprise API key.

## Supported intervals

| Interval | Max range |
| --- | --- |
| `30m` | 90 days |
| `1h` | 365 days |
| `1d` | Unlimited |

`bucket` is the UTC interval start. `open_time` and `close_time` are the actual first and last observations inside it. `updated_at` is BUFF's last update time represented by the bucket; `collected_at` is the cs2.sh collection time represented by it.

## Request

`POST https://api.cs2.sh/v1/market/buff/history`

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/market/buff/history \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    "★ Bayonet | Fade (Factory New)",
    "AK-47 | Case Hardened (Field-Tested)"
  ],
  "start": "2026-07-20",
  "end": "2026-07-23",
  "interval": "1h"
}'
```

**Python**

```python
import requests

headers = {
    "Authorization": "Bearer <<YOUR_API_KEY>>",
    "Accept-Encoding": "gzip",
    "Content-Type": "application/json",
}

payload = {
    "items": ["★ Bayonet | Fade (Factory New)", "AK-47 | Case Hardened (Field-Tested)"],
    "start": "2026-07-20",
    "end": "2026-07-23",
    "interval": "1h",
}

response = requests.post(
    "https://api.cs2.sh/v1/market/buff/history",
    headers=headers,
    json=payload,
)

response.raise_for_status()
data = response.json()
```

**Node**

```javascript
const headers = {
  "Authorization": "Bearer <<YOUR_API_KEY>>",
  "Accept-Encoding": "gzip",
  "Content-Type": "application/json",
};

const response = await fetch("https://api.cs2.sh/v1/market/buff/history", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "items": [
      "★ Bayonet | Fade (Factory New)",
      "AK-47 | Case Hardened (Field-Tested)"
    ],
    "start": "2026-07-20",
    "end": "2026-07-23",
    "interval": "1h"
  }),
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
```

**Go**

```go
package main

import (
    "bytes"
    "compress/gzip"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    payload := map[string]any{
        "items": []any{
            "★ Bayonet | Fade (Factory New)",
            "AK-47 | Case Hardened (Field-Tested)",
        },
        "start": "2026-07-20",
        "end": "2026-07-23",
        "interval": "1h",
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/market/buff/history", bytes.NewReader(body))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer <<YOUR_API_KEY>>")
    req.Header.Set("Accept-Encoding", "gzip")

    resp, err := http.DefaultClient.Do(req)
    if err != nil { panic(err) }
    defer resp.Body.Close()

    if resp.StatusCode < 200 || resp.StatusCode >= 300 {
        body, _ := io.ReadAll(resp.Body)
        panic(fmt.Sprintf("HTTP %d: %s", resp.StatusCode, body))
    }

    var reader io.Reader = resp.Body
    if resp.Header.Get("Content-Encoding") == "gzip" {
        gz, err := gzip.NewReader(resp.Body)
        if err != nil { panic(err) }
        defer gz.Close()
        reader = gz
    }

    var data any
    if err := json.NewDecoder(reader).Decode(&data); err != nil { panic(err) }
    fmt.Printf("%#v\n", data)
}
```

**R**

```r
library(httr2)

payload <- list(
  items = list(
    "★ Bayonet | Fade (Factory New)",
    "AK-47 | Case Hardened (Field-Tested)"
  ),
  start = "2026-07-20",
  end = "2026-07-23",
  interval = "1h"
)

resp <- request("https://api.cs2.sh/v1/market/buff/history") |>
  req_headers(
    Authorization = "Bearer <<YOUR_API_KEY>>",
    `Accept-Encoding` = "gzip"
  ) |>
  req_body_json(payload) |>
  req_perform()

data <- resp_body_json(resp)
```

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | `string[]` | Yes | List of market_hash_name values (max 100) |
| `start` | `string` | Yes | Start date/time as YYYY-MM-DD or RFC3339 |
| `end` | `string` | No | End date/time as YYYY-MM-DD or RFC3339. Defaults to now. |
| `interval` | `string` | No | Default: `30m`. Allowed: `30m`, `1h`, `1d`. |

## Response

```json
{
  "response_time": "2026-07-26T18:54:21.429446677Z",
  "currency": "USD",
  "start": "2026-07-20T00:00:00Z",
  "end": "2026-07-23T00:00:00Z",
  "interval": "1h",
  "items": {
    "★ Bayonet | Fade (Factory New)": {
      "market_hash_name": "★ Bayonet | Fade (Factory New)",
      "buckets": [
        {
          "bucket_id": "base",
          "bucket_type": "base",
          "data": [
            {
              "bucket": "2026-07-20T00:00:00Z",
              "updated_at": "2026-07-20T00:46:24Z",
              "collected_at": "2026-07-20T00:50:57.483Z",
              "open_ask": 371.36,
              "high_ask": 371.57,
              "low_ask": 371.36,
              "close_ask": 371.57,
              "open_avg_ask": 379.74,
              "high_avg_ask": 379.96,
              "low_avg_ask": 379.74,
              "close_avg_ask": 379.96,
              "open_bid": 359.57,
              "high_bid": 359.78,
              "low_bid": 359.57,
              "close_bid": 359.78,
              "ask_volume": 177,
              "bid_volume": 23,
              "open_time": "2026-07-20T00:00:53.231Z",
              "close_time": "2026-07-20T00:50:57.483Z"
            }
          ]
        }
      ]
    }
  }
}
```

## Response fields

[BUFFMarketFloatHistoryResponse](/docs/objects#buffmarketfloathistoryresponse) fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `response_time` | `string (date-time)` | Yes | When the response was generated. |
| `currency` | `string` | Yes | Currency code (always `USD`). |
| `start` | `string (date-time)` | Yes | Effective start of the queried range, floored to the interval boundary. |
| `end` | `string (date-time)` | Yes | Effective end of the queried range, ceiled to the interval boundary. Exclusive. |
| `interval` | `string` | Yes | Allowed: `30m`, `1h`, `1d`. OHLC bucket size. |
| `items` | [`Record<string, BUFFMarketFloatHistoryItem>`](/docs/objects#buffmarketfloathistoryitem) | Yes | Map of `market_hash_name` to per-item BUFF history. |
| `errors` | [ItemError[]](/docs/objects#itemerror) | No | Per-item failures alongside successful results (partial success). |

## Range history

| Field | Description |
| --- | --- |
| `items.<name>.buckets[]` | The item's price ranges, with identity (`bucket_id`, `bucket_type`, `float`/`fade`) matching `GET /v1/market/buff/latest`. |
| `buckets[].data[]` | OHLC points for the range. |
| `data[].bucket` | UTC interval boundary. |
| `data[].open_time`, `close_time` | The real first and last observation timestamps inside the bucket. |
| `data[].ask`, `avg_ask`, `bid` | OHLC values. |
| `data[].ask_volume`, `bid_volume` | Last-observed volumes in the bucket. |
| `items.<name>.variants` | The same range history nested by variant display name. |

- `float` appears on `float` and `float_fade` ranges; `fade` on `fade` and `float_fade` ranges.

Full schemas: [BUFFMarketFloatHistoryItem](/docs/objects#buffmarketfloathistoryitem), [BUFFMarketFloatHistoryBucket](/docs/objects#buffmarketfloathistorybucket), [BUFFMarketFloatHistoryPoint](/docs/objects#buffmarketfloathistorypoint).

### BUFFMarketFloatHistoryItem

BUFF market float/fade OHLC history for one item.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market_hash_name` | `string` | Yes | Canonical base `market_hash_name`. |
| `buckets` | [BUFFMarketFloatHistoryBucket[]](/docs/objects#buffmarketfloathistorybucket) | No | OHLC history for the base listing's buckets. |
| `variants` | [`Record<string, BUFFMarketFloatHistoryVariant>`](/docs/objects#buffmarketfloathistoryvariant) | No | Per-variant OHLC history for items with Doppler / Gamma Doppler phases or Case Hardened tiers. Keyed by display name. |

### BUFFMarketFloatHistoryBucket

OHLC history for one BUFF market bucket. Each entry in `data` is one interval, in chronological order.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bucket_id` | `string` | Yes | Stable bucket identifier (e.g. `fade:99:100`, `variant:p2\|float:0.00:0.01`). |
| `bucket_type` | `string` | Yes | Allowed: `base`, `float`, `fade`, `float_fade`. Bucket stratification. See `BUFFMarketFloatLatestBucket.bucket_type`. |
| `float` | [BUFFMarketFloatRange](/docs/objects#buffmarketfloatrange) | No | Numeric range for a `float` or `fade` bucket. `min` is inclusive, `max` is exclusive. |
| `fade` | [BUFFMarketFloatRange](/docs/objects#buffmarketfloatrange) | No | Numeric range for a `float` or `fade` bucket. `min` is inclusive, `max` is exclusive. |
| `data` | [BUFFMarketFloatHistoryPoint[]](/docs/objects#buffmarketfloathistorypoint) | Yes | OHLC observations for this bucket, chronological. |

### BUFFMarketFloatHistoryPoint

A single OHLC observation inside a BUFF market float/fade bucket history.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bucket` | `string (date-time)` | Yes | UTC-aligned start of the OHLC interval. |
| `updated_at` | `string (date-time)` | No | When BUFF last refreshed the bucket inside this interval. |
| `collected_at` | `string (date-time)` | No | When cs2.sh fetched the source rows inside this interval. |
| `open_ask` | `number` | No | First ask price (USD) observed in the interval. |
| `high_ask` | `number` | No | Highest ask price (USD) observed in the interval. |
| `low_ask` | `number` | No | Lowest ask price (USD) observed in the interval. |
| `close_ask` | `number` | No | Last ask price (USD) observed in the interval. |
| `open_avg_ask` | `number` | No | First `avg_ask` value observed in the interval. |
| `high_avg_ask` | `number` | No | Highest `avg_ask` value observed in the interval. |
| `low_avg_ask` | `number` | No | Lowest `avg_ask` value observed in the interval. |
| `close_avg_ask` | `number` | No | Last `avg_ask` value observed in the interval. |
| `open_bid` | `number` | No | First bid price (USD) observed in the interval. |
| `high_bid` | `number` | No | Highest bid price (USD) observed in the interval. |
| `low_bid` | `number` | No | Lowest bid price (USD) observed in the interval. |
| `close_bid` | `number` | No | Last bid price (USD) observed in the interval. |
| `ask_volume` | `integer` | No | Last observed ask volume inside the interval. |
| `bid_volume` | `integer` | No | Last observed bid volume inside the interval. |
| `open_time` | `string (date-time)` | Yes | Timestamp of the first observation inside the interval. Distinct from `bucket` (the interval boundary). |
| `close_time` | `string (date-time)` | Yes | Timestamp of the last observation inside the interval. Distinct from `bucket` (the interval boundary). |

## Errors

`404 not_found` means none of the requested valid items have BUFF range history. Partial results return `200` with `errors[]`; possible item codes are `unknown_item`, `invalid_format`, and `not_in_cache`. See [Partial success](/docs/using-the-api#partial-success) and [Request errors](/docs/using-the-api#request-errors).
