💻 Environment/Context
- API
- Teams & players
In order for you to get the API key, the Settings > Can view API permission must 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 player_id and company_id using the ScorePlay public API, instead of looking them up manually in the platform?
- Is there ways of accessing a table of all our athletes and their access codes?
- The players request only returns around 100 players when there are a few hundred on the platform
👌 Resolution/Answer
-
Set up the request
- Send every request with your organization's API key in the
X-ScorePlay-Api-Keyheader - Use the base URL
https://media.scoreplay.io/v1
- Send every request with your organization's API key in the
-
Find one player
- Send
GEThttps://media.scoreplay.io/v1/players?query={player_name} - Example:
GEThttps://media.scoreplay.io/v1/players?query=bradleybarcola
- Send
-
Get the full list of players
- Send
GEThttps://media.scoreplay.io/v1/playerswithout thequeryparameter - The response returns 100 players per page by default
- Add the
pageparameter to get the next ones, e.g.?page=2, then?page=3, until the response comes back empty ([]) - To change how many players come back per page, add the
limitparameter, e.g.?limit=50&page=2
- Send
-
Read the IDs in the response
-
IDis the player_id -
company_idis the company_id
-
🔖 Notes
- The request needs the API key header, so it doesn't work when pasted into a browser address bar. Use an API tool such as Postman
- To get only the players of one team, add the
team_idparameter, e.g.?team_id=3623 - Full parameter list: developer.scoreplay.io
- How to generate App codes?
- How to obtain a player's team_id via API?
- How to generate deep invite links?