Skip to content

Steam Analytics API

This documentation explains how to use the getSteamAnalytics GraphQL query to fetch detailed analytics for items on the Steam marketplace, including sales history, listings, and buy orders.

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 SteamAnalytics($game_id: Int) {
  getSteamAnalytics(game_id: $game_id) {
    market_hash_name
    sales {
      last_90d
      last_30d
      last_7d
      last_24h
      avg_daily_volume
      median_price_90d
      average_price_90d
      latest_median_price_sold
    }
    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
    }
    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
    }
  }
}

Variables

json
{
  "game_id": 730
}

Parameters

ParameterTypeDescriptionRequired
game_idIntegerThe ID of the game. Supported values: 730 (CS:GO), 570 (Dota 2)No (default 730)

Game Support

Currently, Steam Analytics API supports only:

  • CS:GO (730)
  • Dota 2 (570)

Support for more games (Team Fortress 2, Rust, etc.) is planned for future releases.

Response Fields

Root Object

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

SalesAnalytics Object

FieldTypeDescription
last_90dIntegerNumber of sales in the last 90 days
last_30dIntegerNumber of sales in the last 30 days
last_7dIntegerNumber of sales in the last 7 days
last_24hIntegerNumber of sales in the last 24 hours
avg_daily_volumeFloatAverage daily sales volume
median_price_90dIntegerMedian price of sales in the last 90 days (divide by 1000 to get the real value)
average_price_90dIntegerAverage price of sales in the last 90 days (divide by 1000 to get the real value)
latest_median_price_soldIntegerMedian price of most recent sales (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)

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)

Code Examples

js
const axios = require('axios');

async function getSteamAnalytics(gameId = 730) {
  const query = `
    query SteamAnalytics($game_id: Int) {
      getSteamAnalytics(game_id: $game_id) {
        market_hash_name
        sales {
          last_90d
          last_30d
          last_7d
          last_24h
          avg_daily_volume
          median_price_90d
          average_price_90d
          latest_median_price_sold
        }
        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
        }
        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
        }
      }
    }
  `;

  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: {
          game_id: gameId
        }
      }
    });

    console.log('Steam analytics:', response.data.data.getSteamAnalytics);
    return response.data.data.getSteamAnalytics;
  } catch (error) {
    console.error('Error fetching Steam analytics:', error);
  }
}

// Get analytics for CS:GO items
getSteamAnalytics(730);

// Or for Dota 2 items
// getSteamAnalytics(570);
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 SteamAnalytics($game_id: Int) { getSteamAnalytics(game_id: $game_id) { market_hash_name sales { last_90d last_30d last_7d last_24h avg_daily_volume median_price_90d average_price_90d latest_median_price_sold } 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 } 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 } } }",
    "variables": {
      "game_id": 730
    }
  }'

Example Response

json
{
  "data": {
    "getSteamAnalytics": [
      {
        "market_hash_name": "AK-47 | Redline (Field-Tested)",
        "sales": {
          "last_90d": 12645, // 12.645$
          "last_30d": 4320, // ...
          "last_7d": 1048,
          "last_24h": 156,
          "avg_daily_volume": 140.5,
          "median_price_90d": 1232,
          "average_price_90d": 1256,
          "latest_median_price_sold": 1245
        },
        "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
        },
        "buyOrders": {
          "buy_orders_last_7d": 432,
          "buy_orders_last_24h": 78,
          "median_buy_price_90d": 1187,
          "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
        }
      },
      {
        "market_hash_name": "AWP | Asiimov (Field-Tested)",
        "sales": {
          "last_90d": 9876,
          "last_30d": 3210,
          "last_7d": 845,
          "last_24h": 124,
          "avg_daily_volume": 109.7,
          "median_price_90d": 3425,
          "average_price_90d": 3467,
          "latest_median_price_sold": 3450
        },
        "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
        },
        "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
        }
      }
    ]
  }
}

Need help? Contact our support team