When you're working with our APIs and want to make full use of our services, one of the most important tasks is to find the IDs of matches, teams or leagues to get specific information. These unique IDs are essential for accessing sports data and will make your development projects easier. In this tutorial, we'll explain the steps you need to take to find these IDs using the API-SPORTS dashboard.
Once you’ve logged in, follow the steps below.
Find leagues IDs
Navigate to the Apis
section on the left.
Then, select the API of your choice.
A dropdown menu will appear when you click on the API of your choice. Find the section labeled Ids
and click on it. Right after, another dropdown menu will appear, choose the section Leagues
.
Once you've clicked on Leagues
, all available leagues will be displayed on the right side.
Use the search bar at the top right to find the league by name. Here for example, Champions League, you can add the year for more detailed research.
Once you've found the league you're looking for, you'll find two columns on the left:
- V2, each competition has one ID per season.
- V3 competitions keep the same ID for all seasons. The way to differentiate them is to use the Season
parameter.
Find teams IDs
Similar to the leagues, go to the Ids
section in the dropdown menu. Then click on Teams
.
A list of countries will be displayed. Select the country of the team you are looking for and click on Show Teams
.
Once you've selected the country, you'll find all the teams available, along with their IDs. You can also use the search bar in the top right-hand corner to make your task easier.
Find IDs with Live Demo
For your ease of use, you can also search for IDs directly on the Live Demo
, using the endpoints and parameters available on our dashboard. You can enter specific parameters to refine your search and get the IDs you need. Here's how to proceed.
Access the Teams
endpoint to find team IDs using parameters such as country/league/season.
Access the Leagues
endpoint to find league IDs using parameters such as country/season.
This allows you to view results immediately and retrieve the required information quickly and efficiently.
Find fixtures IDs
To find the ID of a specific match, you need to know certain details about the match. For example, the date of the match, the teams involved or the league in which the match is played. To do this, use the Fixtures
endpoint with the necessary parameters.
For example, here we have a match that took place on 2024-05-08 between Real Madrid and Bayern Munich, you'll find the match ID in the code results on the right side.
Find players IDs
Once in the Live Demo
section, as in previous tutorials, select the players
endpoint. This endpoint is designed to retrieve players information, including their IDs.
To obtain player IDs by league/team for a specific season, fill in the required parameters:
- league: the ID of the league for which you wish to obtain the players.
- team: the ID of the specific team if you want to filter by team.
- season: the year of the season for which you're looking for players.
Example of parameters:
- league: 2 (UEFA Champions League)
- team: 85 (Paris Saint-Germain)
- season: 2023
These parameters will allow the API to return player-specific information for the selected league, team and season.
After filling in the parameters, Call
the request to see the results. The API will return a list of players with their details, including their unique identifiers.
Note that it is possible that a player has statistics for 2 teams in the same season in case of transfers.
Now, to find a team's current players, go to the Live Demo
section, select the players/squads
endpoint.
This endpoint returns a team's current players if you use the team
parameter. However, if you use the player
parameter, it will return the teams with which the player is associated.
For example:
- team: 33 ( Manchester United)
- player: 742 (R.Varane)
Now that you know how to find match, players, team and league IDs, you're well equipped to move forward with your projects. Using the dashboard greatly simplifies the task of retrieving the necessary information. Don't hesitate to read the documentation, which can help you better understand the endpoints and parameters for all your needs.
Good luck with your projects!