Sport

Table of Contents

Sport

What is Sport? The sport entity defines the specific rules which can be applied on Competition/Season/Round/Fixture/Competitor and all other entities which are associated with the sport. Sports cannot be proposed from the API, however, they can be requested from the Fixtures API v2 on endpoint /v2/sports.

When to use

The Sport entity is used to define the specific rules which can be applied to the other sport-related entities and so that the Fixtures API v2 client can take only the entities related to the selected sport.

How to use

The Sport entity can be used by getting the GSS Id of the sport from the Fixtures API v2 on endpoint /v2/sports. And then set the needed GSS Id to the request which is going to be made for Proposing data. Most of the entities set the GSS Sport Id automatically based on the entities to which it is associated. E.g. when you want to create a Season the GSS Sport Id is automatically taken from the Competition to which the Season is associated. Whereas for Competition you must set the GSS Sport Id explicitly.

Example workflow

GET GSS Sports from Fixtures API v2

curl --location --request GET 'https://ci.fixtures.api.geniussports.com/v2/sports' \ --header 'x-api-key: <<api_key>>' \ --header 'Content-Type: application/json' \ --header 'Authorization: <<id_token>>' \ --data-raw ''

The successful response would be with status code 200 and JSON data in the format:

{ "page": 0, "pageSize": 0, "totalItems": 0, "items": [ { "id": 0, // GSS Sport Id "name": "string", // GSS Sport Name" "allowsDoubles": true, // Whether Doubles can be created for the specific sport "allowsPlayers": true, // Whether Players can be created for the specific sport "maxNumberOfCompetitorsInFixture": 0, // The maximum number of competitors which can take part in a fixture for the specific sport (if available) "createdOn": "2022-06-27T07:11:20.183Z", // When was the Sport created in GSS "modifiedOn": "2022-06-27T07:11:20.183Z", // When was the Sport last modified in GSS "updatesCount": 0 // How many modifications were made to the Sport in GSS } ], "self": "string", "previous": "string", "next": "string", "first": "string", "last": "string" }

Data Points

Field

Type

Description

Field

Type

Description

id

int64|unsigned

The numeric identifier of the Sport in GSS

name

string

The name of the Sport

allowsPlayers

boolean

Whether Players can be created for the specific sport

allowsDoubles

boolean

Whether Doubles can be created for the specific sport

maxNumberOfCompetitorsInFixture

int32|unsigned

The maximum number of competitors which can take part in a fixture for the specific sport. The minimum is 2. The maximum depends on this number. The maximum is inclusive e.g. number of competitors <= maxNumberOfCompetitorsInFixture.

When maxNumberOfCompetitorsInFixture is set to null this means that there is no upper limit of the number of competitors which can take part in the fixtures for the specific sport.

createdOn

timestamp

The timestamp when the data entity was created

modifiedOn

timestamp

The timestamp when the data entity was modified

updatesCount

int32|unsigned

The amount of times the data entity was updated