LogoLogo
Cricket APISportMonksContactFootball API
  • Welcome
  • Getting Started
    • Getting started
    • All endpoints
    • Enriching your response
  • Our API
    • Introduction to our API
    • Continents
      • GET All Continents
      • GET Continent by ID
    • Countries
      • GET All Countries
      • GET Country by ID
    • Leagues
      • GET All Leagues
      • GET League by ID
    • Seasons
      • GET All Seasons
      • GET Season by ID
    • Fixtures
      • GET All Fixtures
      • GET Fixture by ID
    • Livescores
      • GET All Livescores
    • Teams
      • GET All Teams
      • GET Team by ID
      • GET Squad by Team and Season ID
    • Players
      • GET All Players
      • GET Player by ID
    • Officials
      • GET All Officials
      • GET Official by ID
    • Venues
      • GET All Venues
      • GET Venue by ID
    • Positions
      • GET All Positions
      • GET Position by ID
    • Stages
      • GET All Stages
      • GET Stage by ID
    • Team Rankings
      • GET Global Team Rankings
    • Standings
      • GET Standings by Season ID
      • GET Standings by Stage ID
    • Scores
      • GET All Scores
      • GET Score by ID
  • Relationships
    • Scoreboards
    • Official/Umpries
    • Results
  • API References
  • API Reference Guide
  • API Rate limit
  • Statuses and definitions
  • Demo response files
  • Events
  • Statistics
  • General
  • SportMonks
  • Plans & Pricing
  • FAQ
  • Contact
  • Changelog
    • Changelog
Powered by GitBook
On this page
  • Your first request
  • Build the request

Was this helpful?

  1. Our API

Introduction to our API

PreviousEnriching your responseNextContinents

Last updated 3 years ago

Was this helpful?

Before you are able to call our API you need a SportMonks account.

To make our first request, we’ll need a way to get authenticated first. Cricket API 2.0 utilizes API tokens for the authentication of requests. You can obtain and manage your API tokens in .

For the sake of simplicity, we’ll be working with an API token from the free plan. The free plan only has the Twenty20 International (league id: 3), CSA T20 Challenge (league id: 10) and the Big Bash League (league id: 5) included.

Example API token: [HdoiD312ND….]

The API token is only meant for your eyes and, as such, should be stored away safely.

Our tokens have no expiration date and will remain valid until you manually delete it yourself.

Cricket API 2.0 utilizes response codes to indicate successful and failed API requests. When making a request, a code response will always be returned. See below for a short list of possible code responses:

Code number

Description

200

Successful request and data was returned

400

Part of the request is malformed; the exact reason can be found in the response

401

Request is not authenticated

403

Unauthorized request to access data from an ineligible plan

404

This recond is not found. It could be that the data you're trying to access is deleted due to rescheduling.

429

You have reached the response rate limit of your plan

500

Internal error with our servers

With our token in hand, we can finally make the first request!

We recommend you use Postman for convenience. Every endpoint has an example request ready to be requested by you. Hit the button below to import our Cricket API collection.

Your first request

Now that all prerequisites have been fulfilled, we’re ready to send our first request to the API!

Build the request

The request consists of the following components:

  • The base URL

  • A path parameter, in this example, we use [leagues]

  • A query string parameter, this is optional, so we leave this out for now

  • And finally, your API token

https://cricket.sportmonks.com/api/v2.0/

An example of a correctly authenticated request would be:

https://cricket.sportmonks.com/api/v2.0/leagues?api_token={API_TOKEN}
{
    "data": [
        {
            "resource": "leagues",
            "id": 3,
            "season_id": 312,
            "country_id": 99474,
            "name": "Twenty20 International",
            "code": "T20I",
            "image_path": "https://cdn.sportmonks.com/images/cricket/leagues/3/3.png",
            "type": "phase",
            "updated_at": "2020-03-09T15:32:38.000000Z"
        },
        {
            "resource": "leagues",
            "id": 5,
            "season_id": 525,
            "country_id": 98,
            "name": "Big Bash League",
            "code": "BBL",
            "image_path": "https://cdn.sportmonks.com/images/cricket/leagues/5/5.png",
            "type": "league",
            "updated_at": "2020-07-15T09:34:23.000000Z"
        },
        {
            "resource": "leagues",
            "id": 10,
            "season_id": 648,
            "country_id": 146,
            "name": "CSA T20 Challenge",
            "code": "T20C",
            "image_path": "https://cdn.sportmonks.com/images/cricket/leagues/10/10.png",
            "type": "league",
            "updated_at": "2020-10-20T08:41:32.000000Z"
        }
    ]
}

This request will return all of the leagues eligible for our free plan, which are the Twenty20 International (league id: 3), CSA T20 Challenge (league id: 10) and the Big Bash League (league id: 5)

Register now.
Mysportmonks
Run in Postman