Match Query

Match Query

Get introduced to GraphQL Match Query, the most improved method of tech solution with just a single endpoint for all that you need to know about a match.
Cricket API Image

Request structure

Here is what you need to successfully make a Match Query

v5.core.graphql.matchwithscore

Match with Score
Get access to the information on the overall score of a match and get the support to display the scores of batting and bowling teams of many other matches simultaneously on screens using the following query.
Get access to the information on the overall score of a match and get the support to display the scores of batting and bowling teams of many other matches simultaneously on screens using the following query.
icon copy
CURL
query { match(key: "auseng_2021_test_02") { key name venue { name } metricGroup format startAt teams { a { name } b { name } } players { player { name } score { batting { score { runs balls } } bowling { score { balls wickets } } } } } }
query {
  match(key: "auseng_2021_test_02") {
    key
    name
    venue {
      name
    }
    metricGroup
    format
    startAt
    teams {
      a {
        name
      }
      b {
        name
      }
    }
    players {
      player {
        name
      }
      score {
        batting {
          score {
            runs
            balls
          }
        }
        bowling {
          score {
            balls
            wickets
          }
        }
      }
    }
  }
}
icon copy

v5.core.graphql.match.playerscore

Match With Player Score
Use the below-mentioned query to get the information about the player scores and start building a scorecard for the match.
Use the below-mentioned query to get the information about the player scores and start building a scorecard for the match.
icon copy
CURL
query { match(key: "auseng_2021_test_02") { key name venue { name } metricGroup format startAt play { dayNumber result { winner { name } resultType msg } live { battingTeam { name } bowlingTeam { name } score { title } } } } }
query {
  match(key: "auseng_2021_test_02") {
    key
    name
    venue {
      name
    }
    metricGroup
    format
    startAt
    play {
      dayNumber
      result {
        winner {
          name
        }
        resultType
        msg
      }
      live {
        battingTeam {
          name
        }
        bowlingTeam {
          name
        }
        score {
          title
        }
      }
    }
  }
}
icon copy

v5.core.graphql.match.minimalinfo

Minimal Match Info
The following query contains Minimal Match Information like name, venue and start date which ultimately supports building dashboards like a match calendar.
The following query contains Minimal Match Information like name, venue and start date which ultimately supports building dashboards like a match calendar.
icon copy
CURL
query { match(key: "auseng_2021_test_02") { key name venue { name } metricGroup format startAt association { key name } startAt status squad { a { keeper { name } captain { name } players { name } } b { keeper { name } captain { name } players { name } } } } }
query {
  match(key: "auseng_2021_test_02") {
    key
    name
    venue {
      name
    }
    metricGroup
    format
    startAt
    association {
      key
      name
    }
    startAt
    status
    squad {
      a {
        keeper {
          name
        }
        captain {
          name
        }
      	players {
          name
        }
      }
      b {
        keeper {
          name
        }
        captain {
          name
        }
        players {
          name
        }
      }
    }
  }
}
icon copy

HTTP Status

Possible status code you may receive in response to your request.

Cache

A cache object accompanies every API response. It comes with a set of recommended values to help you properly cache the data and handle the cache internally.

When you try to cache the responses on say MemCached, Redis or any other cache server, you will usually require a Key and an expire time.

cache.key

Our recommendations on what Key or ID you should use while you cache a response of this API.

cache.expires

Our recommendations on how long you can cache a particular response.

An interesting thing to note here is that the recommended expire time is not going to be the same under all situations. Our intelligent caching mechanism dynamically decides the best expire time analysing various parameters.

The cache object also provides you with a max_age and the ETag values, which lets you implement the ETag HTTP caching mechanism. To implement HTTP Caching with this API, refer here.

cache.max_age

Our recommended period of time up to which you can consider the data to be fresh. It gives you a heads up on when you should be checking for updates in the data.

cache.etag

Etag is an identifier for a specific version of a response. To know more, refer here.

The time period specified in max_age will be lesser than that in the expires object. To sum it up, the cache.expires object tells you how long you can cache the data while the cache.max_age object tells you when you should check for updates.

Test