Skip to content

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:

HeaderValueDescription
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

ParameterTypeDescriptionRequired
market_nameStringThe name of the marketplace to analyze. Supported values: buff163, csgotm, steamcommunityYes
game_idIntegerThe 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

FieldTypeDescription
market_hash_nameStringThe unique identifier of the item
buyOrdersBuyOrderAnalyticsStatistics about buy orders
listingsListingAnalyticsStatistics about sell orders/listings

BuyOrderAnalytics Object

FieldTypeDescription
buy_orders_last_7dIntegerNumber of buy orders in the last 7 days
buy_orders_last_24hIntegerNumber of buy orders in the last 24 hours
median_buy_price_90dIntegerMedian price of buy orders in the last 90 days (divide by 1000 to get the real value)
average_buy_price_90dIntegerAverage price of buy orders in the last 90 days (divide by 1000 to get the real value)
latest_buy_order_priceIntegerPrice of the most recent buy order (divide by 1000 to get the real value)
min_buy_order_priceIntegerMinimum price among current buy orders (divide by 1000 to get the real value)
max_buy_order_priceIntegerMaximum price among current buy orders (divide by 1000 to get the real value)
max_buy_order_price_90dIntegerMaximum buy order price in the last 90 days (divide by 1000 to get the real value)
max_buy_order_price_30dIntegerMaximum buy order price in the last 30 days (divide by 1000 to get the real value)
max_buy_order_price_7dIntegerMaximum buy order price in the last 7 days (divide by 1000 to get the real value)
max_buy_order_price_24hIntegerMaximum buy order price in the last 24 hours (divide by 1000 to get the real value)

ListingAnalytics Object

FieldTypeDescription
sell_orders_last_7dIntegerNumber of sell orders in the last 7 days
sell_orders_last_24hIntegerNumber of sell orders in the last 24 hours
median_sell_price_90dIntegerMedian price of sell orders in the last 90 days (divide by 1000 to get the real value)
average_sell_price_90dIntegerAverage price of sell orders in the last 90 days (divide by 1000 to get the real value)
latest_sell_order_priceIntegerPrice of the most recent sell order (divide by 1000 to get the real value)
min_sell_order_priceIntegerMinimum price among current sell orders (divide by 1000 to get the real value)
max_sell_order_priceIntegerMaximum price among current sell orders (divide by 1000 to get the real value)
min_sell_order_price_90dIntegerMinimum sell order price in the last 90 days (divide by 1000 to get the real value)
min_sell_order_price_30dIntegerMinimum sell order price in the last 30 days (divide by 1000 to get the real value)
min_sell_order_price_7dIntegerMinimum sell order price in the last 7 days (divide by 1000 to get the real value)
min_sell_order_price_24hIntegerMinimum 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
        }
      }
    ]
  }
}

Need help? Contact our support team