Skip to content

Trades API (Deprecated API Backward Compatibility)

Drop-in replacement for the deprecated Trades API.

Base path: /api/Trades

INFO

This is the compatibility layer. If you're building a new integration, consider using the native Trades API instead.

Get History by Filters

POST /api/Trades/GetHistoryByFilters

Returns trade history with filtering in deprecated API format.

Request Body

FieldTypeRequiredDescription
startstringNoISO date string for range start
endstringNoISO date string for range end
skipnumberNoNumber of records to skip. Default: 0
user_commentsstring[]NoFilter by comment values
trade_idsstring[]NoFilter by trade IDs
bash
curl -X POST "https://market.vpsbot.io/api/Trades/GetHistoryByFilters" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "start": "2024-01-01T00:00:00Z",
    "end": "2024-01-31T23:59:59Z",
    "skip": 0
  }'
js
const { data } = await client.post(
  '/api/Trades/GetHistoryByFilters',
  {
    start: '2024-01-01T00:00:00Z',
    end: '2024-01-31T23:59:59Z',
    skip: 0
  }
);

Example Response

json
{
  "trades": [
    {
      "trade_id": "uuid-trade-id",
      "status": "completed",
      "comment": "order-001",
      "trade_url": "https://steamcommunity.com/tradeoffer/new/?partner=XXXXX&token=YYYYY",
      "items": [
        {
          "assetid": "30000000001",
          "appid": 730,
          "market_hash_name": "AK-47 | Redline (Field-Tested)",
          "price": 1245,
          "float_value": 0.2531,
          "stickers": []
        }
      ],
      "created_at": "2024-01-15T10:00:00.000Z",
      "updated_at": "2024-01-15T10:05:00.000Z",
      "completed_at": "2024-01-15T10:05:00.000Z",
      "error_type": null,
      "error_message": null
    }
  ],
  "total": 42,
  "has_more": true
}

Filtering Examples

By Date Range

js
await client.post('/api/Trades/GetHistoryByFilters', {
  start: '2024-01-01T00:00:00Z',
  end: '2024-01-31T23:59:59Z'
});

By Comments

js
await client.post('/api/Trades/GetHistoryByFilters', {
  user_comments: ['order-001', 'order-002']
});

By Trade IDs

js
await client.post('/api/Trades/GetHistoryByFilters', {
  trade_ids: ['uuid-1', 'uuid-2']
});

With Pagination

js
// Skip first 50 results
await client.post('/api/Trades/GetHistoryByFilters', {
  skip: 50
});

Deprecated API Trade Object Schema

FieldTypeDescription
trade_idstringUnique trade identifier
statusstringTrade status
commentstring | nullUser comment (equivalent to custom_id)
trade_urlstringSteam trade offer URL
itemsarrayArray of traded items
items[].assetidstringSteam asset ID
items[].appidnumberGame ID
items[].market_hash_namestringItem market hash name
items[].pricenumberPrice (1$ = 1000)
items[].float_valuenumber | nullItem float value
items[].stickersarraySticker data
created_atstringISO timestamp of creation
updated_atstringISO timestamp of last update
completed_atstring | nullISO timestamp of completion
error_typestring | nullError type if failed
error_messagestring | nullError description

Need help? Contact our support team