STXMarketService handles everything market-related — from paginated listings to lightweight ID-based lookups — while STXEventService lets you fetch events together with their nested markets in a single call. Both services are registered as transient, so you can resolve them anywhere you inject dependencies. For task-oriented examples, see the Markets guide.
GetMarketInfosAsync
Returns a paginated list of fullSTXMarketInfo objects. Use STXMarketInfosFilter to narrow results by status, sport, competition, or event.
Return type: Task<STXMarketInfosResponse<STXMarketInfo>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
filter | STXMarketInfosFilter | No | Filter and pagination options. Omit to retrieve the default page of all markets. |
Example
GetMarketInfosWithCountAsync
Identical toGetMarketInfosAsync but the response includes a TotalCount field, which is useful when you need to render pagination controls.
Return type: Task<STXMarketInfosWithCountResponse<STXMarketInfo>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
filter | STXMarketInfosFilter | No | Filter and pagination options. |
Example
GetMarketInfosAsync (generic)
A generic overload that lets you project the response into your own model typeT. Use this when you only need a subset of market fields and want to avoid deserializing the full STXMarketInfo.
Return type: Task<STXMarketInfosResponse<T>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
filter | STXMarketInfosFilter | No | Filter and pagination options. |
Example
GetMarketInfosWithCountAsync (generic)
Generic overload ofGetMarketInfosWithCountAsync. Returns total count alongside your projected model.
Return type: Task<STXMarketInfosWithCountResponse<T>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
filter | STXMarketInfosFilter | No | Filter and pagination options. |
GetShortMarketInfosAsync
Fetches lightweight market data — only ID, status, and title — for a specific list of market IDs. Use this when you already know the IDs you want and don’t need the full market payload. Return type:Task<STXMarketInfosResponse<STXShortMarketInfo>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
marketIds | IEnumerable<string> | Yes | One or more market IDs to look up. |
Example
GetShortMarketInfosWithLimitAsync
Same asGetShortMarketInfosAsync but enforces a server-side result limit, guarding against oversized ID lists.
Return type: Task<STXMarketInfosResponse<STXShortMarketInfo>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
marketIds | IEnumerable<string> | Yes | Market IDs to look up. The server caps the result set. |
GetShortMarketInfosWithCountAsync
Returns short market info plus aTotalCount for the supplied ID list.
Return type: Task<STXMarketInfosWithCountResponse<STXShortMarketInfo>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
marketIds | IEnumerable<string> | Yes | Market IDs to look up. |
GetShortMarketInfosWithCountWithLimitAsync
Combines the server-side limit ofGetShortMarketInfosWithLimitAsync with the count field of GetShortMarketInfosWithCountAsync.
Return type: Task<STXMarketInfosWithCountResponse<STXShortMarketInfo>>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
marketIds | IEnumerable<string> | Yes | Market IDs to look up. |
GetSportAndCompetitionsAsync
Returns the complete sports and competitions catalog. Use this to populate sport/competition pickers or to discover valid filter values forSTXMarketInfosFilter.
Return type: Task<List<STXSportAndCompetitions>>
Parameters
This method takes no parameters.Example
GetEventInfosAsync
Returns a list of events, each containing the nestedSTXMarketInfo objects that belong to it. Use STXEventInfosFilter to scope by sport, competition, status, or date window.
Return type: Task<STXEventInfosResponse>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
filter | STXEventInfosFilter | No | Filter options. Omit to retrieve the default page of upcoming events. |
Example
Filter and model reference
STXMarketInfosFilter
Use this class to control which markets are returned and how results are paginated.Status and Trading are defined in STX.Sdk.Enums. See the GitHub source for the complete list.
STXMarketInfo — key fields
| Field | Description |
|---|---|
MarketId | Unique market identifier |
EventId | ID of the parent event |
Status | open, closed, settled, or similar |
Sport, Competition, Title | Human-readable descriptors |
Rules | Market type — PLAYER_STAT_LINE, SPREAD, OVER_UNDER, and others |
Specifier | Line value, e.g. 7.5 or "Player Name|id|STAT|value" |
MaxPrice | Settlement maximum in cents |
Participants | Teams or players involved in the market |