# POST /v1/live/csfloat/buy_orders

Current CSFloat buy orders for one item or one listing, with price, quantity, and the float, phase, and sticker conditions on each order.

Returns the current CSFloat buy orders for one item, or the orders that match one listing. Each order has a price, a quantity, and the conditions it puts on the item, such as a float range, a phase, paint seeds, or stickers.

Available on all plans, at [6 requests per minute on Developer and 36 on Scale](/docs/pricing#live-limits). Each request is for one item or one listing.

Prices are in USD and aren't converted. Data is real-time.

CSFloat returns its top orders for the request, ~25, not a full orderbook. For buy orders across every item, updated on a schedule, use [GET /v1/market/csfloat/latest](/docs/csfloat-orderbook-latest).

## Inputs

| Field | Required | Meaning |
| --- | --- | --- |
| `market_hash_name` | Either this or `listing` | The item, by its exact name. A Doppler or Gamma Doppler phase in the name returns that variant's orders. |
| `listing` | Either this or `market_hash_name` | A CSFloat listing, by its [listing ID](/docs/live-csfloat#ids) in `listing.listing_id`. Returns the buy orders that listing matches. Not with `filters`. |
| `filters` | No | The item you want to sell. See [Filters](#filters). Only with `market_hash_name`. |
| `raw_response` | No | `false` returns [structured rows](/docs/live-overview#raw-and-structured-responses) instead of CSFloat's JSON. |

```json
{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": { "min_float": 0.15, "max_float": 0.18 }
}
```

## Filters

The filters describe the item you want to sell, and CSFloat returns the orders that would take it. Every filter is optional.

| Filter | Type | Meaning |
| --- | --- | --- |
| `min_float`, `max_float` | `number` | The float range of the item you're selling, from 0 to 1. See [Float matching](#float-matching). |
| `phase` | `string` | A Doppler or Gamma Doppler phase or gem. Orders that take any phase can come back too. |
| `paint_seeds` | `integer[]` | Up to 25 paint seeds, each from 0 to 1000. |
| `stickers` | `object` | Up to 5 `entries`, each by `name` or `id`. An entry can add a `count` from 1 to 20 or a `slot` from 0 to 4. |
| `charms` | `object` | One entry, by `name` or `id`. |
| `min_charm_pattern`, `max_charm_pattern` | `integer` | The attached charm's pattern range, from 1 to 99999. |

CSFloat's own request parameters go in [`market_parameters`](/docs/live-overview#filters-and-sorting).

## Sorting

Buy orders take no `sort`, and come back highest price first.

## Request

`POST https://api.cs2.sh/v1/live/csfloat/buy_orders`

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/live/csfloat/buy_orders \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": {
    "min_float": 0.15,
    "max_float": 0.18
  },
  "raw_response": false
}'
```

**Python**

```python
import requests

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

payload = {
    "market_hash_name": "AK-47 | Redline (Field-Tested)",
    "filters": {
        "min_float": 0.15,
        "max_float": 0.18,
    },
    "raw_response": False,
}

response = requests.post(
    "https://api.cs2.sh/v1/live/csfloat/buy_orders",
    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/live/csfloat/buy_orders", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "market_hash_name": "AK-47 | Redline (Field-Tested)",
    "filters": {
      "min_float": 0.15,
      "max_float": 0.18
    },
    "raw_response": false
  }),
});

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{
        "market_hash_name": "AK-47 | Redline (Field-Tested)",
        "filters": map[string]any{
            "min_float": 0.15,
            "max_float": 0.18,
        },
        "raw_response": false,
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/live/csfloat/buy_orders", 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(
  market_hash_name = "AK-47 | Redline (Field-Tested)",
  filters = list(
    min_float = 0.15,
    max_float = 0.18
  ),
  raw_response = FALSE
)

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

data <- resp_body_json(resp)
```

## Response

```json
{
  "market": "string",
  "operation": "string",
  "data": null,
  "page": {
    "page_size": 0,
    "has_next": false,
    "next_cursor": "string",
    "cursor_expires_at": "string",
    "total_count": 0,
    "total_exact": false
  },
  "warnings": [
    {
      "code": "string",
      "field": "string",
      "message": "string"
    }
  ],
  "response_time": "string"
}
```

## Response fields

[LiveResponse](/docs/objects#liveresponse) fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market` | `string` | No | The marketplace: `youpin`, `csfloat`, or `steam`. |
| `operation` | `string` | No | The operation that ran, such as `listings`. |
| `data` | `object` | No | With `raw_response: true`, the default, the marketplace's own JSON, unchanged. With `raw_response: false`, the operation's structured object, which is one of `LiveListingsData`, `LiveListingDetailData`, `LiveBuyOrdersData`, `SteamBuyOrderBook`, `LiveFloatRankData`, or `LiveSearchData`. |
| `page` | [LivePage](/docs/objects#livepage) \| `null` | No | Paging for the next request. `null` on operations that aren't paged. |
| `warnings` | [LiveRequestWarning[]](/docs/objects#liverequestwarning) | No | Notes about the request itself. Absent when there are none. |
| `response_time` | `string (date-time)` | No | When cs2.sh sent the response (UTC). |

## Response data

By default, `data` is CSFloat's own JSON, with prices in cents. With `raw_response: false`, `data.buy_orders[]` holds one [LiveBuyOrder](/docs/objects#livebuyorder) per order:

| Field | Description |
| --- | --- |
| `price`, `currency` | The order price in USD. |
| `quantity` | How many items the order wants at that price. |
| `market_hash_name` | The item the order is for. |
| `conditions` | The order's restrictions, as `min_float`, `max_float`, `variant`, `paint_seeds`, and `stickers`. `null` means the order takes any copy of the item. |
| `id`, `created_at` | Always `null`, because CSFloat reports orders as price and quantity rows. |

## Float matching

A float range returns the orders whose accepted range covers all of it, plus the orders with no float condition. With `min_float` 0.15 and `max_float` 0.18:

| Order accepts | Returned |
| --- | --- |
| Any float | Yes |
| 0.15 to 0.20 | Yes |
| 0.16 to 0.17 | No. It doesn't cover the whole range. |
| 0.17 to 0.25 | No. It only overlaps. |

To check one exact float, send it as both bounds. On [Youpin](/docs/live-youpin-buy-orders), the bounds must equal an order's own bounds instead.

## Notes

An order with `conditions` set to `{}` and an `unmapped_condition` entry in `data.warnings` has a condition cs2.sh couldn't read. Treat it as a restricted order, not one that takes any copy.

## Errors

If CSFloat has no listing with the ID in `listing.listing_id`, the request returns `404` with `details.field` set to `listing.listing_id`. Other errors are the [shared live errors](/docs/live-overview#errors-and-retries).

## POST /v1/live/csfloat/buy_orders/options

Returns the valid [choices](/docs/live-overview#filter-options) for one field of a buy orders request. The filters take free input, such as floats, seeds, and names, so only one field has choices:

| `field` | Choices | Needs an item |
| --- | --- | --- |
| `market_hash_name` | The item's Doppler or Gamma Doppler variants | Yes |

Each option's `query` is a complete buy orders request for that variant.

```json
{
  "market_hash_name": "★ Karambit | Doppler (Factory New)",
  "field": "market_hash_name"
}
```

Sticker and charm names come from the [listings options path](/docs/live-csfloat-listings#post-v1livecsfloatlistingsoptions).

### Request

`POST https://api.cs2.sh/v1/live/csfloat/buy_orders/options`

**curl**

```bash
curl -X POST https://api.cs2.sh/v1/live/csfloat/buy_orders/options \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "market_hash_name": "★ Karambit | Doppler (Factory New)",
  "field": "market_hash_name"
}'
```

**Python**

```python
import requests

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

payload = {
    "market_hash_name": "★ Karambit | Doppler (Factory New)",
    "field": "market_hash_name",
}

response = requests.post(
    "https://api.cs2.sh/v1/live/csfloat/buy_orders/options",
    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/live/csfloat/buy_orders/options", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "market_hash_name": "★ Karambit | Doppler (Factory New)",
    "field": "market_hash_name"
  }),
});

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{
        "market_hash_name": "★ Karambit | Doppler (Factory New)",
        "field": "market_hash_name",
    }
    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.cs2.sh/v1/live/csfloat/buy_orders/options", 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(
  market_hash_name = "★ Karambit | Doppler (Factory New)",
  field = "market_hash_name"
)

resp <- request("https://api.cs2.sh/v1/live/csfloat/buy_orders/options") |>
  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 |
| --- | --- | --- | --- |
| `field` | `string` | Yes | The request field to list choices for, such as `filters.weapon` or `filters.stickers.entries[].name`. |
| `contains` | `string` | No | Text that a choice's label must contain, matched without regard to case. |
| `cursor` | `string` | No | The `page.next_cursor` from the previous page of choices, sent as the only field. |

### Response

```json
{
  "market": "string",
  "operation": "string",
  "field": "string",
  "availability": "string",
  "completeness": "string",
  "options": [
    {
      "label": "string",
      "query": {
        "path": "string",
        "body": null
      }
    }
  ],
  "metadata": null,
  "page": {
    "page_size": 0,
    "has_next": false,
    "next_cursor": "string",
    "cursor_expires_at": "string",
    "total_count": 0,
    "total_exact": false
  },
  "response_time": "string"
}
```

### Response fields

[LiveOptionsResponse](/docs/objects#liveoptionsresponse) fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `market` | `string` | No | The marketplace. |
| `operation` | `string` | No | The data operation the choices apply to. |
| `field` | `string` | No | The request field the choices are for. |
| `availability` | `string` | No | Whether choices could be loaded for this request. |
| `completeness` | `string` | No | `complete` when the list holds every accepted value. `partial` when it holds suggestions, and other values may also work. |
| `options` | [LiveOption[]](/docs/objects#liveoption) | No | The choices. |
| `metadata` | `object` | No | Information about the choice list, such as when it was fetched. |
| `page` | [LivePage](/docs/objects#livepage) | No | Paging for long choice lists. |
| `response_time` | `string (date-time)` | No | When cs2.sh sent the response (UTC). |
