Skip to content

CSFloat API Documentation

Armin edited this page Nov 1, 2023 · 14 revisions

BetterFloat uses CSFloat's internal API for detailed information about listed items.

For that, BetterFloat intercepts (without modifying) the website's own requests. Rarely requests are sent by BetterFloat itself. This is done through the browser's natural window.XMLHttpRequest.prototype object.


Table of contents

  1. Common Types
  2. v1/listings
  3. v1/listings/:id

CSFloat API

Common API base URL: https://csfloat.com/api/

Constructing a search string: ?param1=val1&param2=val2

Fetching the API (Javascript):

/*
* Returns the response of the endpoint in JSON format
* @param endpoint example: 'v1/listings'
* @param searchString example: '?limit=30&sort_by=most_recent'
*/
async function fetchCSFloat(endpoint, searchString) {
  return await fetch(`https://csfloat.com/api/` + endpoint + searchString).then(response => response.json());
}

Common Types

CSFloatListing

Name Type Example Description
created_at string "2023-10-31T08:02:11.286404Z" Creation date of the listing
id string "639373541527127967" Unique ID
is_seller boolean false True if this is your own item
is_watchlisted boolean false True if you watchlisted this item
item CSFloatItem - General item related information
price number 2500 Price in USD (cent). Format: '2500' -> $25
reference CSFloatReference - Reference data by Float Appraiser regarding the item
seller CSFloatSeller - Public data about the seller account.
state 'listed' | 'delisted' - Current listing state.
type 'buy now' | 'auction' - Equals to the one sent in the request parameters.
watchers number > 0 1 Numbers of watchers of a listing.

CSFloatItem

Name Type Example Description
asset_id string "34197156135"
def_index number 1209
has_screenshot boolean true
icon_url string "-9a81dlWLwJ2UUGcVs_ns..."
is_commodity boolean true
item_name string "nitr0 (Foil) | Cluj-Napoca 2015"
market_hash_name string "Sticker | nitr0 (Foil) | Cluj-Napoca 2015"
rarity number 5
scm {price: number, volume: number} {price: 2271, volume: 0} Steam market data of this item
sticker_index number 849
tradable 0 | 1 0
type string "sticker"
type_name string "Sticker"

CSFloatSeller

Name Type Example Description
away boolean true
flags number 48
has_valid_steam_api_key boolean true
obfuscated_id string "12710774309940045613" Obfuscated ID of the seller. Unique but does not give away the original ID.
online boolean true
stall_public boolean true
statistics CSFloatSellerStatistics -
verification_mode string "key"

CSFloatSellerStatistics

Name Type Example Description
median_trade_time number 64
total_avoided_trades number 0
total_failed_trades number 0
total_trades number 0
total_verified_trades number 0

CSFloatReference

Data provided by the Float Appraiser. Displayed in the popup on hover over the Float Appraiser text.

Name Type Example Description
base_price number 2872 Price in USD (cent). Format: '2872' -> $28.72
last_updated string "2023-10-31T19:54:20.625276Z" Time of the last Float Appraiser update.
predicted_price number 2872 Base Price including all markups.
quantity number 10 Number of recorded sales used to train the Float Appraiser.

v1/listings

General information

Source https://csfloat.com/
Usage common request on CSFloat's home page
Requires Auth
Rate Limits 5 requests / 1min
Recommended Timeout ~30s / request

Request

Example request: https://csfloat.com/api/v1/listings?limit=30&sort_by=highest_discount&min_ref_qty=10&type=buy_now&min_price=500

Parameter Type Description
limit number <=30 Maximum amount of requested listings
sort_by "highest_discount" | "most_recent" Listing sort method
type 'buy now' | 'auction' Types of desired listings
min_price number Minimum price of listings

Response

Array of Listings. Each listing also contains an Item object.

Name Type Example Description
- Array<Listing> [] Array of listings

v1/listings/:id

General information

Source https://csfloat.com/item/:id
URL wildcard :id ID of the requested listing
Usage common request when loading single items (only on initial page load)
Requires Auth
Rate Limits unknown
Recommended Timeout ~30s / request

Request

Example request: https://csfloat.com/api/v1/listings/639926508831508066

Parameter Type Description
- - No parameters on this endpoint

Response

Single object of type Listing. Also contains an Item object.

Name Type Example Description
- Listing - A single listing object
Clone this wiki locally