Leagues
This endpoint allows you to retrieve the leagues and the cups.
Multi-language: This feature allows the user to manually change the language of the API response by adding value to the
lang
attribute. Example:lang=en
.
Pagination: The endpoint uses an offset and limit system. Specify the offset and limit parameters to fetch the desired range of results. The maximum and default number of results per request is 50.
Update Period: The endpoint is updated several times a day.
Recommended Calls: Limit calls to 1 every day.
You can get the image of the league by calling the following url: https://images.sportdevs.com/{hash_image}.png
Use Cases
Get leagueshttps://snooker.sportdevs.com/leagues
Search the leagues by the name
https://snooker.sportdevs.com/leagues?name=like.*Championship*
Get leagues based on the idhttps://snooker.sportdevs.com/leagues?id=eq.{id}
Get leagues from a specific class_idhttps://snooker.sportdevs.com/leagues?class_id=eq.{class_id}
Query Parameters
- id integer
Default value:
eq.2858
The id of the league
- class_id integer
Default value:
eq.409
The id of the class
- offset string
Default value:
0
Limiting and Pagination
- limit string
Default value:
50
Limiting and Pagination
- lang string
Default value:
en
Multi-language
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema array
- id integer
The id of the league
Note: This is a Primary Key.
- name text
The name of the league
- importance integer
The importance level of the league
- current_champion_team_id integer
The id of the team that hold the title
- current_champion_team_name text
The name of the team that hold the title
- current_champion_team_hash_image character varying
Possible values:
<= 64 characters
The name image of the team that hold the title
- current_champion_team_num_titles integer
The number of the title that the team is holding
- teams_most_titles jsonb
The ids of the teams with the most titles
- most_titles integer
The number of the most titles accomplished by one team
- primary_color character varying
Possible values:
<= 7 characters
The primary color of the league
- secondary_color character varying
Possible values:
<= 7 characters
The secondary color of the league
- start_league timestamp with time zone
The date of starting the league
- end_league timestamp with time zone
The date of ending the league
- hash_image character varying
Possible values:
<= 64 characters
The name of the image
- class_id integer
The id of the class
Note: This is a Foreign Key to
classes.id
. - class_name text
The name of the class
- class_hash_image character varying
Possible values:
<= 64 characters
The name image of the class
[
{
"id": 2858,
"name": "Championship League",
"importance": 0,
"current_champion_team_id": 1807,
"current_champion_team_name": "Murphy S.",
"current_champion_team_hash_image": "5be940b53147a109b2ca09465b0a213bd7ee1e2fa5ee0b285c875c17a84e3959",
"current_champion_team_num_titles": 0,
"teams_most_titles": [
{
"team_id": 1942,
"team_name": "Higgins J.",
"team_hash_image": "59c4f98164fef7c92ae4c5b04f28920468155d69f48b7053feef623f06bb45bf"
}
],
"most_titles": 4,
"primary_color": "#f21921",
"secondary_color": "#5559fb",
"start_league": "2023-06-26T00:00:00+00:00",
"end_league": "2023-07-22T00:00:00+00:00",
"hash_image": "0eb59c5d0ada8f229894bca9b011227acea77ffcb2144cbcac64c37ae920f59c",
"class_id": 409,
"class_name": "International",
"class_hash_image": "71137e572fd62d4b890a587e3162175eeb218729090039f4a2b3268b50baebbd"
}
]