Developer Hub
🔮 For applications
Guides & Tutorials
Custom markets

Apart from the predominant sports markets, Azuro now allows to integrate custom markets.

ℹ️

If you use our SDK, no additional changes are needed; just ensure you are using version 5.2.8 or above.

The steps to get custom (i.e. markets other than sport markets) are the same as for sports markets, but there is a slight difference in how the names of markets and selections are generated.

GraphQL

New unique hub has been created it works same as others sports and esports hubs.

For sports markets, you use the @azuro-org/dictionaries (opens in a new tab) library to gain names for markets and selections, but for custom markets, you need to use the title field from the Condition and Outcome entities:

query games {
  games(
    where: {
      sport_: {
        sporthub: "unique"
      }
    }
  ) {
    id
    title
    conditions {
      title # it's custom market's name
      outcomes {
        title # it's selection's name
      }
    }
  }
}

Same for prematch bets:

fragment PrematchBet on Bet {
  selections {
    outcome {
      title # it's selection's name
      condition {
        title  # it's custom market's name
      }
    }
  }
}
 
  • title field in Condition entity is custom market's name
  • title field in Outcome entity is selection's name in custom market
ℹ️

For sports markets this fields will be null.

Title field usage

Make sure you use the title field in your market generating function.

import { getMarketName, getSelectionName } from '@azuro-org/dictionaries'
 
conditions.forEach((condition) => {
  const customMarketName = condition.title
 
  condition.outcomes.forEach((outcome) => {
    const customSelectionName = outcome.title
 
    // If customMarketName has a value, then use it as marketName; otherwise, use the getMarketName function.
    const marketName = customMarketName || getMarketName({ outcomeId: outcome.outcomeId })
 
    // If customSelectionName has a value, then use it as selectionName; otherwise, use the getSelectionName function.
    const selectionName = customSelectionName || getSelectionName({ outcomeId: outcome.outcomeId, withPoint: true })
  })
})