Skip to Content
Developer HubToolkitFeedgetConditionsByGameIds

getConditionsByGameIds

Fetches detailed conditions data for a given list of game IDs. Returns comprehensive condition information including outcomes, odds, and game relationships.

Usage

import { getConditionsByGameIds } from '@azuro-org/toolkit' const conditions = await getConditionsByGameIds({ chainId: 137, gameIds: ['1006000000000077484167'], })

Props

type GetConditionsByGameIdsParams = { chainId: ChainId gameIds: string | string[] extended?: boolean // opt-in: include new conditions/markets not present in the dictionaries package }
ℹ️

When to enable extended

Optional, defaults to false. When true, the API additionally returns new-generation conditions and outcomes alongside the standard set. Detect a new condition by its first character: conditionId[0] === '5'.

Titles are returned directly in the response. Each condition exposes title (the market name), and each outcome exposes its own title — ConditionDetailedData.title and OutcomeData.title. The toolkit and SDK already handle grouping, sorting, and rendering of new markets out of the box.

  • If your app reads market/outcome metadata only from these hooks’ / utility’s response (no direct use of @azuro-org/dictionaries), enabling the flag is safe — new markets will appear automatically.
  • If your app reads from @azuro-org/dictionaries directly, note that new markets are not in the dictionaries package — their titles live only on the API. Use the title fields returned here.

If you only have a conditionId later (e.g. in a betslip, history, or activity feed) and need its market title, call getConditionsState  — its ConditionStateData now exposes title for the condition and each outcome. The SDK’s useConditionsState  wraps that endpoint.

For new bets, titles also are present in the subgraph.

Return Value

type GetConditionsByGameIdsResponseResult = ConditionDetailedData[]
type ConditionDetailedData = { id: string conditionId: string state: ConditionState title: string // market title isExpressForbidden: boolean isPrematchEnabled: boolean isLiveEnabled: boolean hidden?: boolean margin: string outcomes: OutcomeData[] game: { gameId: string sport: { sportId: string } } wonOutcomeIds: string[] sort: `${number}` /** Modern ("5...") conditions only: used for market grouping */ marketId?: string | null marketVarietyId?: string | null } type OutcomeData = { title: string // outcome title outcomeId: string odds: string sort: `${number}` /** Modern ("5...") conditions only: numeric handicap/line value, e.g. "-2.5" / "+2.5" */ point?: string | null }
enum ConditionState { Active = 'Active', Canceled = 'Canceled', Removed = 'Removed', Resolved = 'Resolved', Stopped = 'Stopped' }
Last updated on