Skip to main content
Market data lives behind two services:
  • STXMarketService — individual markets and market counts
  • STXEventService — events (a match/game), with its markets attached

List markets

var markets = serviceProvider.GetRequiredService<STXMarketService>();

var resp = await markets.GetMarketInfosAsync();

foreach (var m in resp.MarketInfos)
{
    Console.WriteLine($"{m.MarketId}  {m.Status}  {m.Title}");
}
GetMarketInfosAsync returns STXMarketInfosResponse<STXMarketInfo> — the full market object. For lightweight lookups by ID, use the Short variant:
var ids = new[] { "mkt_abc", "mkt_def" };
var short_ = await markets.GetShortMarketInfosAsync(ids);

Pagination & counts

GetMarketInfosWithCountAsync returns a paginated list plus the total count — use it for “showing N of M” views or to drive offset/limit scans:
var page = await markets.GetMarketInfosWithCountAsync(new STXMarketInfosFilter
{
    Status  = STXMarketInfosStatus.OPEN,
    Trading = STXMarketInfosTrading.TRUE,
    Limit   = 100,
    Offset  = 0,
});

Console.WriteLine($"{page.MarketInfos.Count}/{page.Count}");

Filter

STXMarketInfosFilter combines the common filter fields:
FieldType
StatusSTXMarketInfosStatusOPEN / CLOSED / etc.
TradingSTXMarketInfosTradingTRUE / FALSE / ALL
SportstringSport filter ("basketball", "baseball", …)
CompetitionstringCompetition filter ("NBA", "MLB", …)
EventIdstringOnly markets for a given event
Limit / OffsetintPagination

Sports & competitions

var catalog = await markets.GetSportAndCompetitionsAsync();

foreach (var sport in catalog)
{
    Console.WriteLine($"{sport.Sport}");
    foreach (var c in sport.Competitions)
        Console.WriteLine($"  {c}");
}

Events

STXEventService bundles an event with its markets — one call instead of one-markets-per-event:
var events = serviceProvider.GetRequiredService<STXEventService>();

var resp = await events.GetEventInfosAsync(new STXEventInfosFilter
{
    Sport = "basketball",
    EventStatusFilter = new[]
    {
        STXEventStatus.scheduled,
        STXEventStatus.live,
    },
});

foreach (var ev in resp.EventInfos)
{
    Console.WriteLine($"{ev.EventId}  {ev.Title}  ({ev.MarketInfos.Count} markets)");
}

Real-time updates

For live price ticks on open markets, subscribe via the STXMarketChannel websocket wrapper — see WebSockets → Market updates. REST polling is fine for snapshots; channels are required for latency-sensitive use cases.

See also