Market Data

WebSocket

Connect to the real-time marketplace offer stream via WebSocket to receive live item listings from 26 marketplaces.

Endpoint

This endpoint provides a real-time stream of marketplace offers via WebSocket. Once connected and subscribed, you receive live item listings as they are detected across supported marketplaces.

WSS   wss://marketplaceapi.steamapis.com/ws/v2/offers

Authentication

Include your API key as the apiKey query parameter when connecting.

wss://marketplaceapi.steamapis.com/ws/v2/offers?apiKey=YourSecretAPIKey
Your API key must have websocketAccess enabled. Contact support if you need this permission added to your key.

Compression

The server requires the permessage-deflate WebSocket extension. Most clients negotiate this automatically. If yours does not, send the extension header explicitly when connecting:

Sec-WebSocket-Extensions: permessage-deflate

Without it, the handshake fails with 400 Bad Request and the message permessage-deflate is required.

Limits

Each API key is limited to 2 concurrent connections. Opening a third connection closes it with code 1008 (Policy Violation).

Subscription message

After connecting, send a JSON message to subscribe to specific marketplaces and games. subscribeTo and games are required; newFloorOnly is optional.

subscribeTo
string|string[]
Array of marketplace names or numeric IDs to subscribe to. Use all or -1 to subscribe to all marketplaces. Case-insensitive. See Reference for the full list.
games
string[]
Array of game names or Steam App IDs to subscribe to. Use all or -1 to subscribe to all games. Case-insensitive. See Reference for the full list.
newFloorOnly
boolean
Optional, defaults to false. When true, only offers that set a new lowest price for their item on their marketplace are pushed.

Subscription example

index.js
const ws = new WebSocket('wss://marketplaceapi.steamapis.com/ws/v2/offers?apiKey=YOUR_API_KEY');

ws.onopen = () => {
  ws.send(JSON.stringify({
    subscribeTo: ['Buff163', 'CSFloat', 'SkinPort'],
    games: ['CS2', 'Dota2'],
    newFloorOnly: true
  }));
};

ws.onmessage = (event) => {
  const message = JSON.parse(event.data);

  if (message.type === 'subscribed') {
    console.log('Subscribed to:', message.marketplaces, message.games);
  } else if (message.type === 'offer') {
    console.log('New offer:', message.data.name, '$' + message.data.priceUSD);
  } else if (message.type === 'error') {
    console.error('Error:', message.error);
  }
};

ws.onerror = (error) => console.error('WebSocket error:', error);
ws.onclose = () => console.log('Disconnected');

Confirmation message

On successful subscription, you receive a confirmation message.

message.json
{
  "type": "subscribed",
  "marketplaces": ["Buff163", "CSFloat", "SkinPort"],
  "games": ["CS2", "Dota2"],
  "message": "Successfully subscribed to offer stream"
}

Error messages

Errors are returned as JSON messages with type: "error".

ErrorCause
Invalid API keyThe provided API key was not found
WebSocket access not enabledYour API key does not have websocketAccess permission
API key disabledYour account has been disabled
subscribeTo field is requiredMissing the subscribeTo field in your subscription message
games field is requiredMissing the games field in your subscription message
Unknown marketplace: XInvalid marketplace name or ID
Unknown game: XInvalid game name or ID