โšฝ
API 3.0
OddsCoreFootball APIAPI 2 (Deprecated)WidgetsContact
Football API 3.0
Football API 3.0
  • Welcome
    • ๐Ÿ›ฌWelcome
    • ๐Ÿ™‹โ€โ™‚๏ธGetting Started
    • ๐Ÿค“What can you do with Sportmonks' data?
    • ๐Ÿ†•Differences between API 2 and API 3
      • API Changes
      • Syntax and filters
      • New endpoints and data features
    • ๐Ÿ”Authentication
    • ๐Ÿ‘ถMaking your first request
    • ๐Ÿ”งBest Practices
  • API coach (BETA)
  • Changelog
    • ๐Ÿ“„Changelog
    • ๐Ÿ“Changelog (BETA)
  • API
    • ๐Ÿ’กRequest options
      • Includes
        • Nested includes
      • Selecting fields
      • Filtering
      • Selecting and filtering
      • Ordering and sorting
    • ๐Ÿ”คSyntax
    • โ™พ๏ธRate limit
    • ๐Ÿ‘€Meta description
    • ๐Ÿ“”Error codes
      • Include Exceptions
      • Filtering and Complexity Exceptions
      • Other Exceptions
    • ๐Ÿ“šCode libraries
    • Translations (beta)
    • Demo response files
    • Data corrections
    • API 2.0 (Deprecated)
  • Endpoints and Entities
    • Endpoints
      • ๐Ÿ“กLivescores
        • GET Inplay Livescores
        • GET All Livescores
        • GET Latest Updated Livescores
      • ๐Ÿฅ…Fixtures
        • GET All Fixtures
        • GET Fixture by ID
        • GET Fixtures by Multiple IDs
        • GET Fixtures by Date
        • GET Fixtures by Date Range
        • GET Fixtures by Date Range for Team
        • GET Fixtures by Head To Head
        • GET Fixtures by Search by Name
        • GET Upcoming Fixtures by Market ID
        • GET Upcoming Fixtures by TV Station ID
        • GET Past Fixtures by TV Station ID
        • GET Latest Updated Fixtures
      • ๐Ÿ›ฐ๏ธStates
        • GET All States
        • GET State by ID
      • โŒจ๏ธTypes
        • GET All Types
        • GET Type by ID
        • GET Type by Entity
      • ๐Ÿ†Leagues
        • GET All Leagues
        • GET League by ID
        • GET Leagues by Live
        • GET Leagues by Fixture Date
        • GET Leagues by Country ID
        • GET Leagues Search by Name
        • GET All Leagues by Team ID
        • GET Current Leagues by Team ID
      • ๐Ÿ—“๏ธSeasons
        • GET All Seasons
        • GET Seasons by ID
        • GET Seasons by Team ID
        • GET Seasons by Search by Name
      • ๐Ÿ“ŠStatistics
        • GET Season Statistics by Participant
        • GET Stage Statistics by ID
        • GET Round Statistics by ID
      • ๐Ÿ“…Schedules
        • GET Schedules by Season ID
        • GET Schedules by Team ID
        • GET Schedules by Season ID and Team ID
      • ๐ŸชœStages
        • GET All Stages
        • GET Stage by ID
        • GET Stages by Season ID
        • GET Stages by Search by Name
      • ๐Ÿ”‚Rounds
        • GET All Rounds
        • GET Round by ID
        • GET Rounds by Season ID
        • GET Rounds by Search by Name
      • ๐Ÿ”ขStandings
        • GET All Standings
        • GET Standings by Season ID
        • GET Standings by Round ID
        • GET Standing Correction by Season ID
        • Get Live Standings by League ID
      • ๐Ÿฅ‡Topscorers
        • GET Topscorers by Season ID
        • GET Topscorers by Stage ID
      • ๐ŸƒTeams
        • GET All Teams
        • GET Team by ID
        • GET Teams by Country ID
        • GET Teams by Season ID
        • GET Teams by Search by Name
      • ๐Ÿง‘Players
        • GET All Players
        • GET Player by ID
        • GET Players by Country ID
        • GET Players by Search by Name
        • GET Last Updated Players
      • ๐Ÿง‘โ€๐ŸฆฑTeam Squads
        • GET Team Squad by Team ID
        • GET Extended Team Squad by Team ID
        • GET Team Squad by Team and Season ID
      • ๐Ÿ‘จโ€๐ŸซCoaches
        • GET All Coaches
        • GET Coach by ID
        • GET Coaches by Country ID
        • GET Coaches Search by Name
        • GET Last Updated Coaches
      • ๐Ÿ•ด๏ธReferees
        • GET All Referees
        • GET Referee by ID
        • GET Referees by Country ID
        • GET Referees by Season ID
        • GET Referees Search by Name
      • โ†”๏ธTransfers
        • GET All Transfers
        • GET Transfer by ID
        • GET Latest Transfers
        • GET Transfers Between Date Range
        • GET Transfers by Team ID
        • GET Transfers by Player ID
      • ๐ŸŸ๏ธVenues
        • GET All Venues
        • GET Venue by ID
        • GET Venues by Season ID
        • GET Venues by Search by Name
      • ๐Ÿ“บTV Stations
        • GET All TV Stations
        • GET TV Station by ID
        • GET TV Stations by Fixture ID
      • ๐Ÿ”ฎExpected (xG)
        • GET Expected by Team
        • GET Expected by Player
      • ๐Ÿ”ญPredictions
        • GET Probabilities
        • GET Predictability by League ID
        • GET Probabilities by Fixture ID
        • GET Value Bets
        • GET Value Bets by Fixture ID
      • ๐Ÿง™Standard Odds Feed
        • ๐Ÿ‘“Pre-match Odds
          • GET All Odds
          • Get Odds by Fixture ID
          • GET Odds by Fixture ID and Bookmaker ID
          • GET Odds by Fixture ID and Market ID
          • GET Last Updated Odds
        • ๐Ÿง Inplay Odds
          • GET All Inplay Odds
          • GET Inplay Odds by Fixture ID
          • GET Inplay Odds by Fixture ID and Bookmaker ID
          • GET Inplay Odds by Fixture ID and Market ID
          • GET Last Updated Inplay Odds
      • ๐Ÿง™โ€โ™‚๏ธPremium Odds Feed
        • ๐Ÿ•ถ๏ธPremium Pre-match Odds
          • GET All Premium Odds
          • Get Premium Odds by Fixture ID
          • GET Premium Odds by Fixture ID and Bookmaker ID
          • GET Premium Odds by Fixture ID and Market ID
          • GET Updated Premium Odds Between Time Range
          • GET Updated Historical Odds Between Time Range
          • GET All Historical Odds
      • ๐Ÿ›’Markets
        • GET All Markets
        • GET All Premium Markets
        • GET Market by ID
        • GET Market by Search
      • ๐Ÿ“‘Bookmakers
        • GET All Bookmakers
        • GET All Premium Bookmakers
        • GET Bookmaker by ID
        • GET Bookmaker by Search
        • GET Bookmaker by Fixture ID
      • ๐Ÿ“ฐNews
        • GET Pre-Match News
        • GET Pre-Match News by Season ID
        • GET Pre-Match News for Upcoming Fixtures
        • GET Post-Match News
        • GET Post-Match News by Season ID
      • โš”๏ธRivals
        • GET All Rivals
        • GET Rivals by Team ID
      • ๐ŸŽ™๏ธCommentaries
        • GET All Commentaries
        • GET Commentaries by Fixture ID
    • Entities
      • ๐Ÿฅ…Fixture
      • ๐Ÿ†League, Season, Schedule, Stage and Round
      • ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘Team, Player, Squad, Coach and Referee
      • ๐Ÿ”ขStatistic
      • ๐Ÿ”ฎExpected
      • ๐Ÿฅ‡Standing and Topscorer
      • ๐Ÿ”ญOdd and Prediction
      • Other
  • Tutorials and Guides
    • Tutorials
      • Introduction
        • Make your first request
        • Set your time zone
        • Pagination
      • Enrich your response
        • Nested includes
          • Syntax and relations
      • Includes
        • Events
        • States
        • Periods
        • Scores
        • Participants
        • Lineups
        • ballCoordinates
        • Pressure Index
        • Tips and tricks
      • Filter and select fields
        • Selecting fields
        • Filtering
        • Selecting and filtering
      • Leagues and seasons
        • Leagues
        • Seasons
      • Season schedule
        • Schedules
        • Stages
        • Rounds
      • Livescores and fixtures
        • Livescores
        • Fixtures
      • Lineups and formations
      • Statistics
        • Statistics types
        • Season statistics
        • Fixture statistics
        • Team statistics
        • Players statistics
      • Teams, players, coaches and referees
        • Teams
        • Players
        • Coaches
        • Referees
      • Standings
        • Season standings
        • Topscorer standings
      • Odds and predictions
        • Bookmakers
        • Markets
        • Pre-match odds
        • Live(Inplay) odds
        • hasOdds
        • Predictions
          • Probabilities
          • Value Bet
      • Expected
        • Endpoints
        • Includes
        • Coverage
      • News
        • Pre-match News
        • Post-match News
      • Placeholders
      • Timezone parameters on different endpoints
    • Guides
      • How-to use components
      • How-to use the Football API with Postman
      • How-to use the Football API tester
      • How-to use the Football API ID finder
      • How-to build a livescore website
      • How-to use the Predictions API
      • How-to build a match page
      • How-to build a custom plan
      • How-to build a match page with odds
      • How-to use xG data
      • How-to build a news website
      • How-to build a fantasy game guide
      • How-to use the new Champions League data
      • How-to build your World Cup application
      • How-to build a team page
      • How-to keep your database in SYNC
      • How-to use team mode in MySportmonks
    • Programming languages
      • A developers guide: Unleashing the power of the football API with JSON
      • A developers guide: Unleashing the power of the football API with PHP
      • A developers guide: Unleashing the power of the football API with Python
  • Definitions
    • ๐Ÿ“”Response Codes
    • ๐Ÿ›ฐ๏ธStates
    • โŒจ๏ธTypes
      • Lineups, positions and formations
      • Events
      • Statistics
        • Coach statistics
        • Referee statistics
        • Stage statistics
        • Season statistics
        • Fixture statistics
        • Team statistics
        • Player statistics
      • Expected
      • Leagues and stages
      • Standings
      • Transfers
      • Highlights
      • Weather and pitch
  • FAQ
    • API 3.0
    • Odds
    • Integration
    • Sportmonks
  • Quicklinks
    • Postman
    • ID Finder
    • Sportmonks
    • MySportmonks
    • Football widgets
    • Plans and Pricing
    • Data features
    • FAQ
Powered by GitBook
On this page
  • What does the filter do?
  • How to apply the filter?
  • What if I want the opposite result?
  • Why would I use the hasOdds filter?
  • Make the requests and evaluate the response

Was this helpful?

  1. Tutorials and Guides
  2. Tutorials
  3. Odds and predictions

hasOdds

In this tutorial, weโ€™re going to discuss the HasOdds filter. A field called has_odds has been implemented on Fixture entities, marking whether a Fixture has odds available in our database.

What does the filter do?

The filter does exactly what you think it does. It shows if the fixture has odds.

It can be applied to all fixture entities.

How to apply the filter?

You can apply the filter as follows:

&filters=havingOdds

What if I want the opposite result?

You can also switch the value of the boolean to check for fixtures that donโ€™t have odds. Use &filters=havingOdds:false to get the exact opposite result. The fixtures without odds will be included in the response you receive from our API.

Why would I use the hasOdds filter?

You can separate the fixtures that do and donโ€™t have odds. You donโ€™t have to create your own filter and keep refreshing. You can now use one (or two) requests to separate the fixtures and get the ones you need.

Make the requests and evaluate the response

So you can filter both ways. You can find all fixtures with odds, or you can find all fixtures without odds. Letโ€™s look at an example of how to do this exactly.

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN

Now we are simply adding &filters=havingOdds, and we will receive all live fixtures with odds.

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN&filters=havingOdds
[
    {
      "id": 18784100,
      "sport_id": 1,
      "league_id": 393,
      "season_id": 21151,
      "stage_id": 77461810,
      "group_id": null,
      "aggregate_id": null,
      "round_id": 300619,
      "state_id": 1,
      "venue_id": 271664,
      "name": "Maqtaaral vs Astana",
      "starting_at": "2023-05-10 12:00:00",
      "result_info": null,
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "has_odds": true,
      "starting_at_timestamp": 1683720000
    },
    {
      "id": 18804175,
      "sport_id": 1,
      "league_id": 396,
      "season_id": 21288,
      "stage_id": 77462384,
      "group_id": null,
      "aggregate_id": null,
      "round_id": 302940,
      "state_id": 1,
      "venue_id": 7467,
      "name": "Arys vs Sport Academy Kairat",
      "starting_at": "2023-05-10 12:00:00",
      "result_info": null,
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "has_odds": true,
      "starting_at_timestamp": 1683720000
    },
    {
      "id": 18825943,
      "sport_id": 1,
      "league_id": 1422,
      "season_id": 19970,
      "stage_id": 77462770,
      "group_id": 248829,
      "aggregate_id": null,
      "round_id": 305750,
      "state_id": 3,
      "venue_id": 2690,
      "name": "Stuttgart U19 vs Hamburger SV U19",
      "starting_at": "2023-05-10 11:00:00",
      "result_info": null,
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "has_odds": true,
      "starting_at_timestamp": 1683716400

Letโ€™s find out about the opposite. The request is done at exactly the same time, but the response shows different matches.

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN&filters=havingOdds:false
{
    "data": [
        {
            "id": 18806840,
            "sport_id": 1,
            "league_id": 1953,
            "season_id": 21290,
            "stage_id": 77462393,
            "group_id": null,
            "aggregate_id": null,
            "round_id": 303231,
            "state_id": 1,
            "venue_id": 145072,
            "name": "West NTC W vs Murdoch Uni Melville W",
            "starting_at": "2023-05-10 12:00:00",
            "result_info": null,
            "leg": "1/1",
            "details": null,
            "length": 90,
            "placeholder": false,
            "has_odds": false,
            "starting_at_timestamp": 1683720000
        },
        {
            "id": 18804793,
            "sport_id": 1,
            "league_id": 848,
            "season_id": 20373,
            "stage_id": 77459481,
            "group_id": null,
            "aggregate_id": null,
            "round_id": null,
            "state_id": 1,
            "venue_id": null,
            "name": "Police vs Sofapaka",
            "starting_at": "2023-05-10 12:00:00",
            "result_info": null,
            "leg": "1/1",
            "details": null,
            "length": 90,
            "placeholder": false,
            "has_odds": false,
            "starting_at_timestamp": 1683720000
        },
        {
            "id": 18601096,
            "sport_id": 1,
            "league_id": 178,
            "season_id": 20115,
            "stage_id": 77458867,
            "group_id": null,
            "aggregate_id": null,
            "round_id": 282013,
            "state_id": 1,
            "venue_id": 339164,
            "name": "BKMA II vs Gandzasar",
            "starting_at": "2023-05-10 12:00:00",
            "result_info": null,
            "leg": "1/1",
            "details": null,
            "length": 90,
            "placeholder": false,
            "has_odds": false,
            "starting_at_timestamp": 1683720000
        },
```

PreviousLive(Inplay) oddsNextPredictions

Last updated 7 months ago

Was this helpful?