💻 Environment/Context
- Team Id
- API
- Players
- Teams
In order for you to get the API key, the Settings > Can view API permission should be enabled on your account.
If you're unable to follow any of the steps below, kindly reach out to your admin or refer to the Account Type Permissions Overview article for more information.
❓ Issue/Question
- How do I get a player's team_id using the ScorePlay public API?
👌 Resolution/Answer
- Every request needs your organization's API key sent in the
X-ScorePlay-Api-Keyheader, and the base URL ishttps://media.scoreplay.io/v1.- See How to obtain a player's player_id and company_id via API? to know how to enable API key visibility on your account.
- Get the player's team_id(s):
-
GEThttps://media.scoreplay.io/v1/players/{id} - Using the player_id (
ID) from the player search step. Unlike the list endpoint, this one also populates the player'sTeamsarray; each entry is a team object with its ownID, this is the team_id you need. - If the player is linked to more than one team entry (e.g., one per season), make sure to pick the team_id for the correct season.
-
- Alternative: look up a team directly by name instead:
-
GEThttps://media.scoreplay.io/v1/teams - Returns all teams for your company (each with its own
IDandcompany_id).
-