Skip to content

Get tournaments

GET
/v1/tournaments
Server

Gets a list with tournaments.

Authorizations

api_key
TypeAPI Key (header: X-Api-Key)

Parameters

Query Parameters

sorting
Typestring
default
page_size

Number of items per page

Typeinteger
default50
page

Current page

Typeinteger
default1
region

iso country. For F1/Moto use "world"

Typestring
ExampleWORLD
date_start

date start

Typestring
Example2022-07-10
date_stop

date stop

Typestring
Example2023-12-30
sport_type

Enum: soccer, motorsport, tennis, rugby, darts, horseracing, boxing, other, motogp, formula1, cricket, basketball, combatsport, icehockey, nba, nfl, mlb, watersport, dtm, indycar, superbike, padel

Typestring
Exampleformula1
tournament_type

Enum: cup, league, oneoff

Typestring
Exampleleague
tournament_name

tournament name

Typestring
ExampleFormula 1
query

flexible search query for tournament names

Typestring
ExamplePremier League
season

Season, for example 2024 or 24/25 depending on sport type

Typestring
Example2023
tournament_id
Typestring
Example8a8bd5e3d98347e68cbe50d31953fcbb_trn

Responses

OK
application/json
JSON
{
"tournaments": [
{
"tournament_id": "8a8bd5e3d98347e68cbe50d31953fcbb_trn",
"official_name": "Formula 1",
"season": "2023",
"tournament_type": "string",
"region": "WORLD",
"sport_type": "string",
"date_start": "2022-07-10T00:00:00",
"date_stop": "2023-12-30T00:00:00",
"created": "2024-04-08T14:03:00",
"updated": "2024-04-08T14:03:00",
"slug": "formula-1-2023",
"number_events": 0
}
],
"pagination": {
"total_size": 1,
"page_size": 50,
"next_page": "string",
"previous_page": "string"
}
}

Samples

cURL
curl -X GET \
'https://api.xs2event.com/v1/tournaments?region=WORLD&date_start=2022-07-10&date_stop=2023-12-30&sport_type=formula1&tournament_type=league&tournament_name=Formula+1&query=Premier+League&season=2023&tournament_id=8a8bd5e3d98347e68cbe50d31953fcbb_trn' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.xs2event.com/v1/tournaments?region=WORLD&date_start=2022-07-10&date_stop=2023-12-30&sport_type=formula1&tournament_type=league&tournament_name=Formula+1&query=Premier+League&season=2023&tournament_id=8a8bd5e3d98347e68cbe50d31953fcbb_trn', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.xs2event.com/v1/tournaments';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];
$query = http_build_query([
    'region' => 'WORLD',
    'date_start' => '2022-07-10',
    'date_stop' => '2023-12-30',
    'sport_type' => 'formula1',
    'tournament_type' => 'league',
    'tournament_name' => 'Formula 1',
    'query' => 'Premier League',
    'season' => '2023',
    'tournament_id' => '8a8bd5e3d98347e68cbe50d31953fcbb_trn',
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
Python
import requests

url = 'https://api.xs2event.com/v1/tournaments'
params = {
    'region': 'WORLD',
    'date_start': '2022-07-10',
    'date_stop': '2023-12-30',
    'sport_type': 'formula1',
    'tournament_type': 'league',
    'tournament_name': 'Formula 1',
    'query': 'Premier League',
    'season': '2023',
    'tournament_id': '8a8bd5e3d98347e68cbe50d31953fcbb_trn'
}
headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, params=params, headers=headers)
print(response.json())