Skip to content

Max Orders API ​

This documentation explains how to use the aggregatedMaxOrders GraphQL query to fetch the maximum buy order prices for items across multiple 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.

graphql
# Query
query MaxOrders($markets: [String!]!) {
  aggregatedMaxOrders(markets: $markets) {
    market_hash_name
    orders {
      market_name
      offers
      price
    }
  }
}

# Variables
{
  "markets": [
    "steamcommunity",
    "marketcsgo",
    "buff163"
  ]
}
http
# Endpoint
POST https://api.csmarketcap.com/api/v2/rest/get-aggregated-max-orders

# Request Body
{
  "game_id": 730, // required: The game ID (e.g., 730 for CS2)
  "markets": ["steamcommunity", "marketcsgo", "buff163"] // required: Array of marketplace names
}

# Response Format: AggregatedMaxOrders[]
[
  {
    "market_hash_name": "★ Sport Gloves | Hedge Maze (Factory New)",
    "orders": [
      {
        "market_name": "buff163",
        "offers": 2,
        "price": 25230580
      },
      {
        "market_name": "marketcsgo",
        "offers": 1,
        "price": 6397079
      },
      {
        "market_name": "steamcommunity",
        "offers": 1,
        "price": 1408386
      }
    ]
  }
]

Parameters ​

ParameterTypeDescriptionRequired
markets[String!]!Array of marketplace names to include in the comparisonYes

Supported Markets ​

The following marketplaces are supported for max order querying:

Market NameDescription
buff163BUFF163
csfloatCSFloat
marketcsgoMarketCSGO
dmarketDMarket
ecosteamECOSteam
steamcommunitySteamCommunity
white-marketWhite.Market

Response Fields ​

Root Object ​

FieldTypeDescription
market_hash_nameStringThe unique identifier of the item
orders[OrderInfo]Array of order information for each marketplace

OrderInfo Object ​

FieldTypeDescription
market_nameStringName of the marketplace
offersIntegerNumber of available buy orders
priceIntegerMaximum price among buy orders (divide by 1000 to get the real value)

Code Examples ​

js
const axios = require('axios');

async function getMaxOrders(markets) {
  const query = `
    query MaxOrders($markets: [String!]!) {
      aggregatedMaxOrders(markets: $markets) {
        market_hash_name
        orders {
          market_name
          offers
          price
        }
      }
    }
  `;

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

    console.log('Max orders:', response.data.data.aggregatedMaxOrders);
    return response.data.data.aggregatedMaxOrders;
  } catch (error) {
    console.error('Error fetching max orders:', error);
  }
}

// Compare maximum buy orders across supported marketplaces
getMaxOrders(['steamcommunity', 'marketcsgo', 'buff163']);
js
const axios = require('axios');

async function getMaxOrders(markets, gameId = 730) {
  try {
    const response = await axios({
      url: 'https://api.csmarketcap.com/api/v2/rest/get-aggregated-max-orders',
      method: 'post',
      headers: {
        'api-token': 'YOUR_JWT_TOKEN_HERE',
        'Content-Type': 'application/json'
      },
      data: {
        markets: markets,
        game_id: gameId
      }
    });

    console.log('Max orders:', response.data);
    return response.data;
  } catch (error) {
    console.error('Error fetching max orders:', error);
  }
}

// Compare maximum buy orders across supported marketplaces
getMaxOrders(['steamcommunity', 'marketcsgo', 'buff163']);
js
import { Csmc } from 'csmc-sdk';

const sdk = new Csmc('YOUR_API_KEY');

async function getMaxOrders() {
  await sdk.initialize();
  
  const orders = await sdk.methods.aggregatedMaxOrders({
    game_id: 730,
    markets: ['steamcommunity', 'marketcsgo', 'buff163']
  });
  
  console.log(orders);
  return orders;
}

getMaxOrders();
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 MaxOrders($markets: [String!]!) { aggregatedMaxOrders(markets: $markets) { market_hash_name orders { market_name offers price } } }",
    "variables": {
      "markets": ["steamcommunity", "marketcsgo", "buff163"]
    }
  }'
bash
curl -X POST "https://api.csmarketcap.com/api/v2/rest/get-aggregated-max-orders" \
  -H "Content-Type: application/json" \
  -H "api-token: YOUR_JWT_TOKEN_HERE" \
  -d '{
    "markets": ["steamcommunity", "marketcsgo", "buff163"],
    "game_id": 730
  }'

Example Response ​

json
{
  "data": {
    "aggregatedMaxOrders": [
      {
        "market_hash_name": "★ Sport Gloves | Hedge Maze (Factory New)",
        "orders": [
          {
            "market_name": "buff163",
            "offers": 2,
            "price": 25230580
          },
          {
            "market_name": "marketcsgo",
            "offers": 1,
            "price": 6397079
          },
          {
            "market_name": "steamcommunity",
            "offers": 1,
            "price": 1408386
          }
        ]
      },
      {
        "market_hash_name": "★ Sport Gloves | Pandora's Box (Factory New)",
        "orders": [
          {
            "market_name": "buff163",
            "offers": 3,
            "price": 24815610
          },
          {
            "market_name": "marketcsgo",
            "offers": 1,
            "price": 6409584
          },
          {
            "market_name": "steamcommunity",
            "offers": 1,
            "price": 1431577
          }
        ]
      },
      {
        "market_hash_name": "Sticker | Vox Eminor (Holo) | Katowice 2014",
        "orders": [
          {
            "market_name": "marketcsgo",
            "offers": 1,
            "price": 16953135
          },
          {
            "market_name": "steamcommunity",
            "offers": 1,
            "price": 1408386
          }
        ]
      },
    ]
  }
}

Usage Notes ​

  • This endpoint provides information about the highest buy orders (the maximum price buyers are willing to pay) for items across different marketplaces
  • The offers field indicates the total number of buy orders available, not just those at the maximum price
  • Price values are provided in cents (divide by 1000 to get dollar value)
  • Use this data to identify the best marketplace to sell your items for maximum profit
  • Compare with the Aggregated Min Prices endpoint to understand the full price range (buy and sell sides) across marketplaces

Need help? Contact our support team