Skip to main content

Overview

The market feed is a live, read-only copy of every CS2 listing you can buy through /secure/buy, priced for your account. It holds two books: You choose all (both books, the default), internal or external when you connect. Every listing’s price is what /secure/buy charges you for it, so the listing id and price can be passed to a buy as they are. You connect with your API key: no certificate file, no IP allowlist and no credentials to request.
The earlier Price Feed stays available and unchanged. It carries the AssetPay pool only and needs credentials issued by AssetPay.

Quick start (SDK)

syncFeed fetches your login, waits until your prices are ready, loads both books, then follows their streams. It reloads by itself when the feed is refilled, when it fell too far behind, and when your login changes.

Connecting by hand

1

Get your login

GET /secure/feed with your API key returns a rediss:// URL and the key names for your account:
Connect with the URL as is. The certificate is public, so no CA file is needed. Turn off any INFO-based ready check (ioredis: enableReadyCheck: false); your login cannot run INFO.
2

Wait until your prices are ready

HGET <keys.meta> ready returns 1 once every price on your lane is written. Poll every few seconds until then.
3

Note each stream position

For each book you read, XREVRANGE <stream> + - COUNT 1 before loading, so nothing written while you load is missed.
4

Load

HGETALL <items> gives every item key. For each one, HGETALL <rows><itemKey> and HGETALL <prices><itemKey>. A listing exists when it has both a row and a price.
5

Follow

XREAD BLOCK 5000 STREAMS <stream...> <position...> in a loop, applying each entry and advancing that stream’s position.

Keys

An item key is the catalog itemId, or itemId:Phase_2 for a Doppler phase, the same itemId /secure/prices returns.

Item

Listing

id and delivery (instant or standard) are always present; every other field is left out when it has no value. revertRefundPercent is the share of the price refunded if you reverse a delivered trade (external listings only). Ignore fields you don’t recognise.

Stream entries

Each entry has type and data, a JSON string { "id", "itemKey" }. Only the last entry per listing matters, so collapse a batch before reading. A listing whose Doppler phase was corrected arrives as an item.add under its new item key; drop the old one. A remove for a listing you don’t hold is a no-op.

Staying in sync

Reload from step 2 when any of these happens:
  • gen changed in state: the feed was rebuilt.
  • The stream was trimmed past your position: the oldest entry still in the stream (XRANGE <stream> - + COUNT 1, or first-entry in XINFO STREAM) is newer than the last id you read. Streams keep about 200,000 entries, which is only a few minutes of the external book, so a reader that stops for longer reloads. Don’t use max-deleted-entry-id: trimming never moves it.
  • NOPERM: your login changed, because your password was rotated or your pricing changed. Fetch the login again first.
Check gen and the oldest stream entry every few seconds while you follow. When frozen is 1, external prices may be stale and buys of external listings are more likely to be refused. If the external book stays unavailable for 15 minutes, its listings are removed through the stream and come back the same way.

Your login

  • It can only read: both books, state, and your own prices. Anything else returns NOPERM, and listing keys with SCAN or KEYS is not allowed.
  • Rotate the password from the dashboard (POST /merchants/me/feed/rotate). The old password stops working at once, open connections included.
  • Prices follow your pricing. When your pricing changes, your login moves to the new prices and the old keys return NOPERM.

Buying

Pass the listing id as itemId and the feed price as price to /secure/buy. If the price moved since you read it, a drop is charged at the current price, a rise within your slippageBps or maxPrice is charged at the current price, and a larger rise is refused with PRICE_CHANGED before anything is charged. A trade holds listings of one book only.