Skip to content

Get tournament

GET
/v1/tournaments/{tournament_id}
Server

Gets a single tournament

Authorizations

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

Parameters

Path Parameters

tournament_id*

XS2event ID of the Tournament

Typestring
Required

Responses

OK
application/json
JSON
{
"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
}

Samples

cURL
curl -X GET \
'https://api.xs2event.com/v1/tournaments/{tournament_id}' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://api.xs2event.com/v1/tournaments/{tournament_id}', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?php
$url = 'https://api.xs2event.com/v1/tournaments/{tournament_id}';
$method = 'GET';
$headers = [
    'Content-Type' => 'application/json',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
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/{tournament_id}'

headers = {
    'Content-Type': 'application/json'
}

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