Markets
Section titled “Markets”using STX.Sdk;using STX.Sdk.Models;
using var client = new STXClient();var page = await client.GetMarketsAsync(status: ["open"], trading: true, limit: 3);foreach (var market in page) Console.WriteLine($"{market.Symbol} bid {market.Bids?.FirstOrDefault()?.Price} offer {market.Offers?.LastOrDefault()?.Price}");Console.WriteLine($"more pages: {page.HasMore}");STXNHL-26OCT221900FLAPIT-GAMEFLA bid 0.4600 offer 0.5100STXNBA-26OCT221900CLEPHI-GAMEPHI bid 0.4800 offer 0.5200STXNCAAF-26OCT221900LIBKENN-GAMEKENN bid 0.4800 offer 0.5200more pages: TrueBids are sorted best first and Offers highest first, so the best offer is the last one.
| Parameter | Meaning |
|---|---|
marketIds, eventIds |
One or more ids |
status |
One or more, lowercase, e.g. ["open"]; see Market status |
trading |
true for only the markets accepting orders now, false for only those that are not |
sports, competitions |
One or more |
sortBy, sortDirection |
e.g. sortBy: "event_start", sortDirection: "desc" |
limit, cursor |
Page size (default 100, at most 200) and the cursor from the previous page |
Filters combine with AND; a list filter matches any of its values. marketIds is the exception: with it, the call returns exactly those markets on one page, and every other filter, sort and paging parameter is ignored. GetMarketAsync(id) fetches one market and throws STXNotFoundException when there is none.
Pagination
Section titled “Pagination”A list method returns one STXPage<T>: a read-only list of the items, with Cursor (null on the last page) and HasMore. To walk every page, use the GetAll...Async twin, an IAsyncEnumerable<T> that follows the cursor for you:
Market? market = null;await foreach (var m in client.GetAllMarketsAsync(status: ["open"], trading: true, sortBy: "event_start", sortDirection: "desc")){ if (m.EventStatus == "scheduled") { market = m; break; }}Console.WriteLine($"{market?.MarketId} {market?.Symbol} {market?.MaxPrice}");// 21ce76c1-52aa-492f-a20e-59fb82ad0552 STXNCAAF-26OCT272000SHSUMOST-GAMEMOST 1.0000status: ["open"] with trading: true returns only the markets that are open and accept orders now. A pre_open market also accepts limit orders, but they wait at accepted and do not reach the book until it opens.
Or page by hand:
var page = await client.GetMarketsAsync(status: ["open"], limit: 100);while (true){ foreach (var m in page) Console.WriteLine(m.Symbol); if (!page.HasMore) break; page = await client.GetMarketsAsync(status: ["open"], limit: 100, cursor: page.Cursor);}Events
Section titled “Events”var events = await client.GetEventsAsync(limit: 3);foreach (var e in events) Console.WriteLine($"{e.EventId} {e.Title} {e.Status}");// 00304c72-8019-42b1-b940-9899ca6f4745 Crypto 15 min ending 1:00am EDT scheduled// 8a7077c4-17d1-4327-b4ca-a8dad7d89abe Crypto 15 min ending 12:30am EDT in_progress
await foreach (var e in client.GetAllEventsAsync(promoted: true)) Console.WriteLine(e.Title);GetEventsAsync filters on eventIds, sports, competitions, eventTypes, title, status and promoted, and sorts with sortBy (start_time) and sortDirection.
Live prices
Section titled “Live prices”Bids and Offers are a snapshot of the top of the book. To follow prices as they move, stream them; see WebSockets.

