Get Fixture By Id

Introduction

The Fixtures endpoint provides information about Games in particular Leagues. There are always 2 teams involved in a Fixture. For many customers, Fixtures is the main endpoint for their app/website. Be aware your access is limited to Fixtures of Leagues, available in the Plan you are subscribed to.

Responses of the Fixture endpoint are highly customizable, because there are many Includes available to extend the response. Requests often start with the Includes localTeam and VisitorTeam. Events, Stats, Lineups, Comment, Trends etc. are often added as well.

Endpoint Details

Below you can find the details for this endpoint.

Key Value
Endpoint: https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__
Pagination: No
Includes:


Nested Includes: 10 - You can add a max of 10 levels of nested includes.
Parameters:
  • fields - Only return fields you are interested in. Simply add &fields[object]=id,name,code etc etc to your request url.
  • filter - Array of fields to filter on like: ?filter[name]=Indian Super League.
  • include - One or a comma separated list of relationships to include.
  • sort - One or comma separated list of fields to sort on.

Example Request

The following code snippets demonstrate how to get all fixtures available in this endpoint.

// Get your API tokens here: https://www.sportmonks.com/settings#/api
curl "https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN"
-H "Accept: application/json"
// Get your API tokens here: https://www.sportmonks.com/settings#/api
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN', [
    'headers' => ['Accept' => 'application/json']
]);
// Get your API tokens here: https://www.sportmonks.com/settings#/api
response = requests.get("https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN")

# Print the status code of the response.
print(response.status_code)
// Get your API tokens here: https://www.sportmonks.com/settings#/api
require 'faraday_middleware'

Faraday.new('https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN', headers: {'Accept' => 'application/json', 'Accept-Encoding' => 'gzip'}).get
// Get your API tokens here: https://www.sportmonks.com/settings#/api
URL url = new URL("https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
// Get your API tokens here: https://www.sportmonks.com/settings#/api
import { SportmonksApi } from 'sportmonks';
const sportmonks = new SportmonksApi(__YOUR_API_TOKEN__);
sportmonks.get("https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN",params).then( function(resp){
  //resp.data will contain your data
  //resp.meta will contain the meta informations
  console.log(resp);
});
// Get your API tokens here: https://www.sportmonks.com/settings#/api
package main

import (
    "fmt"
    "log"

    sm "github.com/BialkowskiSz/go-sportmonks"
)

func main() {
    sm.SetAPIToken("<YOUR_TOKEN_HERE>")
    g, err := sm.Get("https://cricket.sportmonks.com/api/v2.0/fixtures/__ID__?api_token=YOURTOKEN", "", 0, false)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(string(g))
}

Example Response

In the API Reference Guide the example responses of the fixtures endpoint are shown.

Test this Endpoint

With our In-Page API Tester you can directly test this Endpoint by clicking the blue button on the right ‘Open Test API’. By adding Includes, Parameters and Variables and clicking the blue button on the right below ‘Send API Request’, you can directly view the API Response. Your Requests and Responses are even stored in your personal API Tester Folder (only when you are logged-in). If you are not logged in the API Tester will use the Free Plan Leagues for your requests.

Questions?

We're always happy to help with code or other questions you might have! Search our documentation, contact support, or get in touch with our sales team.

This article was last updated on 2019-01-17 13:10:16
{{ api_response }}
# Variable Value Description
{{ variable.variable }} {{ variable.description }}
# Relationship Description Value
{{ parameter.parameter }} {{ parameter.description }}
# Relationship Description Extra
{{ relation.include }} {{ relation.description }}

{{ loginForm.errors.get('email') }}

{{ loginForm.errors.get('password') }}

Remember me?