Skip to content

Price Recommendations API ​

This documentation explains how to use the getPriceRecommendations GraphQL query to fetch price recommendations for items in different games.

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 PriceRecommendations($game_id: Int, $type: RecommendationType) {
  getPriceRecommendations(game_id: $game_id, type: $type) {
    market_hash_name
    suggested_price
    unstable_reasons
    total_sales
    price_difference
    price_change_percentage
    liquidity_score
  }
}

# Variables
{
  "game_id": 730,
  "type": "general"
}
http
# Endpoint
POST https://api.csmarketcap.com/api/v2/rest/get-price-recommendations

# Request Body
{
  "game_id": 730, // required: The game ID (e.g., 730 for CS2)
  "type": "general", // optional: Recommendation type (general, quick_sell, etc.)
  "markets": ["bitskins"] // optional: Array of marketplace names
}

# Response Format: PriceRecommendation[]
[
  {
    "market_hash_name": "AK-47 | Redline (Field-Tested)",
    "suggested_price": 1245,
    "unstable_reasons": [],
    "total_sales": 1245,
    "price_difference": 0.15,
    "price_change_percentage": 1.22,
    "liquidity_score": 7500
  },
  {
    "market_hash_name": "AWP | Asiimov (Field-Tested)",
    "suggested_price": 3467,
    "unstable_reasons": ["BIG_LISTINGS_DIFFERENCE"],
    "total_sales": 897,
    "price_difference": -1.23,
    "price_change_percentage": -3.43,
    "liquidity_score": 9200
  }
]

Parameters ​

ParameterTypeDescriptionRequired
game_idIntegerThe ID of the game. Supported values: 730 (CS:GO), 440 (Team Fortress 2), 570 (Dota 2), 252490 (Rust)No (default: 730)
typeRecommendationTypeType of price recommendation. (Which type of markets used to generate recommendation) Possible values: general (all supported markets excluding gambling ones), p2p (supported P2P markets)No (default: general)

Response Fields ​

FieldTypeDescription
market_hash_nameStringThe unique identifier of the item
suggested_priceIntegerThe recommended price for the item (actual price can be obtained via division by 1000)
unstable_reasons[UnstableReason]List of reasons why the price might be unstable
total_salesIntegerTotal number of sales for this item
price_differenceFloatDifference between current and suggested price
price_change_percentageFloatPercentage change in price
liquidity_scoreIntegerLiquidity score from 0 to 10000, indicating how liquid the item is in the markets

RecommendationType Enum ​

The type parameter accepts the following values:

typescript
enum RecommendationType {
  general = 'general',       // All supported markets excluding gambling ones
  p2p = 'p2p'                // Supported P2P markets only
}

UnstableReason Enum ​

The unstable_reasons field may contain one or more of the following values:

typescript
enum UnstableReason {
  NOT_POPULAR = 'NOT_POPULAR',         // Item is not traded frequently
  NO_ORDERS = 'NO_ORDERS',             // No buy orders exist for this item
  NO_LISTINGS = 'NO_LISTINGS',         // No sell listings exist for this item
  LISTINGS_PRICE = 'LISTINGS_PRICE',   // Unusual pricing in listings
  BIG_LISTINGS_DIFFERENCE = 'BIG_LISTINGS_DIFFERENCE', // Large price gap between listings
  BOOST_RISK = 'BOOST_RISK',           // Risk of price manipulation
  NO_THREE_MONTH_SALES = 'NO_THREE_MONTH_SALES', // No sales in the last three months
  THREE_MONTH_SALES = 'THREE_MONTH_SALES', // Sales data limited to past three months
}

Code Examples ​

js
const axios = require('axios');

async function getPriceRecommendations(gameId = 730, type = 'general') {
  const query = `
    query PriceRecommendations($game_id: Int, $type: RecommendationType) {
      getPriceRecommendations(game_id: $game_id, type: $type) {
        market_hash_name
        suggested_price
        unstable_reasons
        total_sales
        price_difference
        price_change_percentage
        liquidity_score
      }
    }
  `;

  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,
          type: type
        }
      }
    });

    console.log('Price recommendations:', response.data.data.getPriceRecommendations);
    return response.data.data.getPriceRecommendations;
  } catch (error) {
    console.error('Error fetching price recommendations:', error);
  }
}

getPriceRecommendations();
js
const axios = require('axios');

async function getPriceRecommendations(gameId = 730, type = 'general', markets = []) {
  try {
    const response = await axios({
      url: 'https://api.csmarketcap.com/api/v2/rest/get-price-recommendations',
      method: 'post',
      headers: {
        'api-token': 'YOUR_JWT_TOKEN_HERE',
        'Content-Type': 'application/json'
      },
      data: {
        game_id: gameId,
        type: type,
        markets: markets
      }
    });

    console.log('Price recommendations:', response.data);
    return response.data;
  } catch (error) {
    console.error('Error fetching price recommendations:', error);
  }
}

getPriceRecommendations(730, 'general', ['bitskins']);
js
import { Csmc } from 'csmc-sdk';

const sdk = new Csmc('YOUR_API_KEY');

async function getPriceRecommendations() {
  await sdk.initialize();
  
  const recommendations = await sdk.methods.priceRecommendations({
    game_id: 730,
    markets: ['bitskins'],
  });
  
  console.log(recommendations);
  return recommendations;
}

getPriceRecommendations();
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 PriceRecommendations($game_id: Int, $type: RecommendationType) { getPriceRecommendations(game_id: $game_id, type: $type) { market_hash_name suggested_price unstable_reasons total_sales price_difference price_change_percentage liquidity_score } }",
    "variables": {
      "game_id": 730,
      "type": "general"
    }
  }'
bash
curl -X POST "https://api.csmarketcap.com/api/v2/rest/get-price-recommendations" \
  -H "Content-Type: application/json" \
  -H "api-token: YOUR_JWT_TOKEN_HERE" \
  -d '{
    "game_id": 730,
    "type": "general",
    "markets": ["bitskins"]
  }'

Example Response ​

json
{
  "data": {
    "getPriceRecommendations": [
      {
        "market_hash_name": "AK-47 | Redline (Field-Tested)",
        "suggested_price": 1245, // 12.45$
        "unstable_reasons": [],
        "total_sales": 1245,
        "price_difference": 0.15,
        "price_change_percentage": 1.22,
        "liquidity_score": 7500
      },
      {
        "market_hash_name": "AWP | Asiimov (Field-Tested)",
        "suggested_price": 3467, // 34.67$
        "unstable_reasons": ["BIG_LISTINGS_DIFFERENCE"],
        "total_sales": 897,
        "price_difference": -1.23,
        "price_change_percentage": -3.43,
        "liquidity_score": 9200
      }
    ]
  }
}

Need help? Contact our support team