Appearance
Market Analytics API
This documentation explains how to use the getMarketOrderAnalytics
GraphQL query to fetch detailed market analytics for items on specific marketplaces.
Authentication
All API requests require authentication using a JWT token. Include the following header in your requests:
Header | Value | Description |
---|---|---|
api-token | <generated_jwt> | Your JWT authentication token |
For information on how to generate your JWT token, please refer to the Authentication Guide.
Query
graphql
query MarketAnalytics($market_name: String!, $game_id: Int) {
getMarketOrderAnalytics(market_name: $market_name, game_id: $game_id) {
market_hash_name
buyOrders {
buy_orders_last_7d
buy_orders_last_24h
median_buy_price_90d
average_buy_price_90d
latest_buy_order_price
min_buy_order_price
max_buy_order_price
max_buy_order_price_90d
max_buy_order_price_30d
max_buy_order_price_7d
max_buy_order_price_24h
}
listings {
sell_orders_last_7d
sell_orders_last_24h
median_sell_price_90d
average_sell_price_90d
latest_sell_order_price
min_sell_order_price
max_sell_order_price
min_sell_order_price_90d
min_sell_order_price_30d
min_sell_order_price_7d
min_sell_order_price_24h
}
}
}
Variables
json
{
"market_name": "buff163",
"game_id": 730
}
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
market_name | String | The name of the marketplace to analyze. Supported values: buff163 , csgotm , steamcommunity | Yes |
game_id | Integer | The ID of the game. Supported values: 730 (CS:GO), 440 (Team Fortress 2), 570 (Dota 2), 252490 (Rust) | No (default: 730 ) |
Game Support by Marketplace
- csgotm: Supports all games (
730
,440
,570
,252490
) - buff163: Currently only supports CS:GO (
730
) - steamcommunity: Currently supports CS:GO (
730
) and Dota 2 (570
), with support for all games coming soon
Response Fields
Root Object
Field | Type | Description |
---|---|---|
market_hash_name | String | The unique identifier of the item |
buyOrders | BuyOrderAnalytics | Statistics about buy orders |
listings | ListingAnalytics | Statistics about sell orders/listings |
BuyOrderAnalytics Object
Field | Type | Description |
---|---|---|
buy_orders_last_7d | Integer | Number of buy orders in the last 7 days |
buy_orders_last_24h | Integer | Number of buy orders in the last 24 hours |
median_buy_price_90d | Integer | Median price of buy orders in the last 90 days (divide by 1000 to get the real value) |
average_buy_price_90d | Integer | Average price of buy orders in the last 90 days (divide by 1000 to get the real value) |
latest_buy_order_price | Integer | Price of the most recent buy order (divide by 1000 to get the real value) |
min_buy_order_price | Integer | Minimum price among current buy orders (divide by 1000 to get the real value) |
max_buy_order_price | Integer | Maximum price among current buy orders (divide by 1000 to get the real value) |
max_buy_order_price_90d | Integer | Maximum buy order price in the last 90 days (divide by 1000 to get the real value) |
max_buy_order_price_30d | Integer | Maximum buy order price in the last 30 days (divide by 1000 to get the real value) |
max_buy_order_price_7d | Integer | Maximum buy order price in the last 7 days (divide by 1000 to get the real value) |
max_buy_order_price_24h | Integer | Maximum buy order price in the last 24 hours (divide by 1000 to get the real value) |
ListingAnalytics Object
Field | Type | Description |
---|---|---|
sell_orders_last_7d | Integer | Number of sell orders in the last 7 days |
sell_orders_last_24h | Integer | Number of sell orders in the last 24 hours |
median_sell_price_90d | Integer | Median price of sell orders in the last 90 days (divide by 1000 to get the real value) |
average_sell_price_90d | Integer | Average price of sell orders in the last 90 days (divide by 1000 to get the real value) |
latest_sell_order_price | Integer | Price of the most recent sell order (divide by 1000 to get the real value) |
min_sell_order_price | Integer | Minimum price among current sell orders (divide by 1000 to get the real value) |
max_sell_order_price | Integer | Maximum price among current sell orders (divide by 1000 to get the real value) |
min_sell_order_price_90d | Integer | Minimum sell order price in the last 90 days (divide by 1000 to get the real value) |
min_sell_order_price_30d | Integer | Minimum sell order price in the last 30 days (divide by 1000 to get the real value) |
min_sell_order_price_7d | Integer | Minimum sell order price in the last 7 days (divide by 1000 to get the real value) |
min_sell_order_price_24h | Integer | Minimum sell order price in the last 24 hours (divide by 1000 to get the real value) |
Code Examples
js
const axios = require('axios');
async function getMarketAnalytics(marketName, gameId = 730) {
const query = `
query MarketAnalytics($market_name: String!, $game_id: Int) {
getMarketOrderAnalytics(market_name: $market_name, game_id: $game_id) {
market_hash_name
buyOrders {
buy_orders_last_7d
buy_orders_last_24h
median_buy_price_90d
average_buy_price_90d
latest_buy_order_price
min_buy_order_price
max_buy_order_price
max_buy_order_price_90d
max_buy_order_price_30d
max_buy_order_price_7d
max_buy_order_price_24h
}
listings {
sell_orders_last_7d
sell_orders_last_24h
median_sell_price_90d
average_sell_price_90d
latest_sell_order_price
min_sell_order_price
max_sell_order_price
min_sell_order_price_90d
min_sell_order_price_30d
min_sell_order_price_7d
min_sell_order_price_24h
}
}
}
`;
try {
const response = await axios({
url: 'https://api.csmarketcap.com/api/v2/graphql',
method: 'post',
headers: {
'Content-Type': 'application/json',
'api-token': 'YOUR_JWT_TOKEN_HERE'
},
data: {
query: query,
variables: {
market_name: marketName,
game_id: gameId
}
}
});
console.log('Market analytics:', response.data.data.getMarketOrderAnalytics);
return response.data.data.getMarketOrderAnalytics;
} catch (error) {
console.error('Error fetching market analytics:', error);
}
}
// Replace with the actual supported market name and game ID
getMarketAnalytics('buff163', 730); // For CS:GO items on Buff163
bash
curl -X POST https://api.csmarketcap.com/api/v2/graphql \
-H "Content-Type: application/json" \
-H "api-token: YOUR_JWT_TOKEN_HERE" \
-d '{
"query": "query MarketAnalytics($market_name: String!, $game_id: Int) { getMarketOrderAnalytics(market_name: $market_name, game_id: $game_id) { market_hash_name buyOrders { buy_orders_last_7d buy_orders_last_24h median_buy_price_90d average_buy_price_90d latest_buy_order_price min_buy_order_price max_buy_order_price max_buy_order_price_90d max_buy_order_price_30d max_buy_order_price_7d max_buy_order_price_24h } listings { sell_orders_last_7d sell_orders_last_24h median_sell_price_90d average_sell_price_90d latest_sell_order_price min_sell_order_price max_sell_order_price min_sell_order_price_90d min_sell_order_price_30d min_sell_order_price_7d min_sell_order_price_24h } } }",
"variables": {
"market_name": "buff163",
"game_id": 730
}
}'
Example Response
json
{
"data": {
"getMarketOrderAnalytics": [
{
"market_hash_name": "AK-47 | Redline (Field-Tested)",
"buyOrders": {
"buy_orders_last_7d": 432, // 0.432$
"buy_orders_last_24h": 78, // 0.078$
"median_buy_price_90d": 1187, // 1.187$
"average_buy_price_90d": 1204, // ...
"latest_buy_order_price": 1220,
"min_buy_order_price": 1150,
"max_buy_order_price": 1300,
"max_buy_order_price_90d": 1350,
"max_buy_order_price_30d": 1330,
"max_buy_order_price_7d": 1300,
"max_buy_order_price_24h": 1280
},
"listings": {
"sell_orders_last_7d": 289,
"sell_orders_last_24h": 52,
"median_sell_price_90d": 1245,
"average_sell_price_90d": 1256,
"latest_sell_order_price": 1250,
"min_sell_order_price": 1230,
"max_sell_order_price": 1400,
"min_sell_order_price_90d": 1200,
"min_sell_order_price_30d": 1210,
"min_sell_order_price_7d": 1220,
"min_sell_order_price_24h": 1230
}
},
{
"market_hash_name": "AWP | Asiimov (Field-Tested)",
"buyOrders": {
"buy_orders_last_7d": 376,
"buy_orders_last_24h": 65,
"median_buy_price_90d": 3367,
"average_buy_price_90d": 3402,
"latest_buy_order_price": 3450,
"min_buy_order_price": 3280,
"max_buy_order_price": 3600,
"max_buy_order_price_90d": 3780,
"max_buy_order_price_30d": 3710,
"max_buy_order_price_7d": 3650,
"max_buy_order_price_24h": 3600
},
"listings": {
"sell_orders_last_7d": 203,
"sell_orders_last_24h": 38,
"median_sell_price_90d": 3567,
"average_sell_price_90d": 3589,
"latest_sell_order_price": 3550,
"min_sell_order_price": 3520,
"max_sell_order_price": 3800,
"min_sell_order_price_90d": 3420,
"min_sell_order_price_30d": 3480,
"min_sell_order_price_7d": 3500,
"min_sell_order_price_24h": 3520
}
}
]
}
}