# POST /v1/archive/csfloat

Daily sale price and volume from CSFloat from 2022 onward.

Returns CSFloat daily average sale price and sale volume. Data begins in 2022 and updates ~1-2x per day.

Max 100 items per request.

## Access

Requires a Scale or Enterprise API key.

## Request

`POST https://api.cs2.sh/v1/archive/csfloat`

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/archive/csfloat \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    "USP-S | Printstream (Factory New)"
  ],
  "start": "2024-01-01",
  "end": "2026-07-26"
}'
```

**Python**

```python
import requests

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

payload = {
    "items": ["USP-S | Printstream (Factory New)"],
    "start": "2024-01-01",
    "end": "2026-07-26",
}

response = requests.post(
    "https://api.cs2.sh/v1/archive/csfloat",
    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/archive/csfloat", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "items": [
      "USP-S | Printstream (Factory New)"
    ],
    "start": "2024-01-01",
    "end": "2026-07-26"
  }),
});

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{
            "USP-S | Printstream (Factory New)",
        },
        "start": "2024-01-01",
        "end": "2026-07-26",
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/archive/csfloat", 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(
    "USP-S | Printstream (Factory New)"
  ),
  start = "2024-01-01",
  end = "2026-07-26"
)

resp <- request("https://api.cs2.sh/v1/archive/csfloat") |>
  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` | No | Start date (YYYY-MM-DD or RFC3339). Default 2020-01-01. |
| `end` | `string` | No | End date (YYYY-MM-DD or RFC3339). Default now. |

## Response

```json
{
  "response_time": "2026-07-26T18:54:19.632716841Z",
  "currency": "USD",
  "start": "2026-04-27T00:00:00Z",
  "end": "2026-07-25T00:00:00Z",
  "items": {
    "USP-S | Printstream (Factory New)": {
      "market_hash_name": "USP-S | Printstream (Factory New)",
      "count": 89,
      "data": [
        {
          "date": "2026-04-27",
          "price": 149.76,
          "volume": 8
        },
        {
          "date": "2026-04-28",
          "price": 189.81,
          "volume": 10
        }
      ]
    }
  }
}
```

## Response fields

[ArchiveCSFloatResponse](/docs/objects#archivecsfloatresponse) 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 day boundary. |
| `end` | `string (date-time)` | Yes | Effective end of the queried range, ceiled to the day boundary. Exclusive. |
| `items` | [`Record<string, ArchiveCSFloatItem>`](/docs/objects#archivecsfloatitem) | Yes | Map of `market_hash_name` to CSFloat sale time-series. |
| `errors` | [ItemError[]](/docs/objects#itemerror) | No | Per-item failures alongside successful results (partial success). |

## Daily data

| Field | Description |
| --- | --- |
| `items.<name>.count` | Number of daily aggregates. |
| `items.<name>.data[]` | Daily aggregates. |
| `data[].date` | Day, `YYYY-MM-DD`, UTC. |
| `data[].price` | Arithmetic average of all sale prices that day, USD. |
| `data[].volume` | Number of sales that day. |
| `items.<name>.variants` | The same shape per variant. |

- `date`, `price`, and `volume` are present on returned daily aggregates. `price` can be `null` when the stored day has volume but no usable price.
- Variants appear under `variants` when CSFloat archive data exists for that variant.
- Valid requested items with no CSFloat archive data return `not_in_archive`.

Full schemas: [ArchiveCSFloatItem](/docs/objects#archivecsfloatitem), [ArchiveCSFloatBucket](/docs/objects#archivecsfloatbucket).

### ArchiveCSFloatItem

CSFloat sale time-series for a single item.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market_hash_name` | `string` | Yes | Steam market hash name. |
| `count` | `integer` | Yes | Number of days with data |
| `data` | [ArchiveCSFloatBucket[]](/docs/objects#archivecsfloatbucket) | Yes | Daily sale aggregates in chronological order. |
| `variants` | `Record<string, object>` | No | Per-variant CSFloat sale time-series for items with Doppler / Gamma Doppler phases or Case Hardened tiers. Keyed by display name. |

### ArchiveCSFloatBucket

One day of sale data on CSFloat.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | `string` | Yes | Date in `YYYY-MM-DD` format (UTC). |
| `price` | `number \| null` | Yes | Arithmetic average of all sale prices (USD) that day. |
| `volume` | `integer` | Yes | Number of sales that day. |

## Errors

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