That will return a list of the team's current roster players in the body.
/getNFLTeamRoster
- Call this with either required param teamID or teamAbv. Valid values for teamID and teamAbv can be found from the "Get Teams" endpoint.
- Optional Parameters:
- archiveDate - This must be a date in format YYYYMMDD.
- Historical rosters are saved on a daily basis as of 20230505 and moving forward.
- If archiveDate is chosen, you will receive only a list of players who were on that roster as of that date. No other information is provided with archiveDate
- getStats - This can only be "true". If it is anything else, it will be ignored.
- This is a map of stats for each individual player.
- Including stats is an option as it will add a small amount of latency.
- Stats are for current season only.
- Rosters are updated every hour.
- Players included in roster are the players who are currently on active roster. Depending on official league status, sometimes suspended players will fall off.
- Elements included in each player's metadata vary, but elements guaranteed to be included are:
- Please see the example on the rapidapi.com UI (link below) for a full response, which includes the other fields that will be retrieved for each player's information.
- Many customers use the results from this endpoint to connect each player's ID across websites like espn, roto, fantasypros, yahoo, etc.
- Users also use this data to know who is currently on the roster, to plan out their DFS plays for the day.
A complete example of this call can be found on the rapidapi main UI for this api:
https://rapidapi.com/tank01/api/tank01-nfl-live-in-game-real-time-statistics-nfl/
Glossary:
- Team abbreviations and Team IDs can be found from /getNFLTeams endpoint
- List of all playerIDs can be found with /getNFLPlayerList
Parameters:
One of the below is REQUIRED. If the endpoint is called with neither then you will get an empty map in return
Optional parameters
- archiveDate - must be in format YYYYMMDD
- statsToGet - needs to be "true" in order to retrieve stats.
Error Handling:
Errors are handled by returning an empty "body" map, an "error" key at the same level as the “body” map, and a statusCode of 200.
Possible Error Messages:
- "Need a valid teamID or teamAbv. Try the get NFL Teams call to find correct attributes." – this means the API could not find either a teamID or teamAbv from your call.
- “Roster not found. Date needs to be in format YYYYMMDD and historical rosters only go as far back as 20230505” – this means that you tried to grab an archived roster that doesn't exist. This could be due to bad teamID, teamAbv, or a roster archive date prior to 5/5/2023.
Other Helpful Tips:
- If statsToGet is anything other than "true", it will be ignored.
- If both teamAbv and teamID are provided, the system will try to resolve teamAbv first, and then teamID. If teamAbv is not valid, then it will look at teamID.
- The "roster" element will normally return a list of maps. One map per player. However, if you are asking for an archive date, then the "roster" element will return a list of strings that refer to a playerID.
- Calling with a valid archiveDate will also return an element of "rosterArchiveDate" within the body.
This endpoint, when called without an archiveDate, will retrieve a map in this format:
- statusCode
- body
- teamAbv - teamAbv refers to the team that you specified in the request.
- roster - this is a list of map items
- numbered list map item for each player – there will be many of these
- teamID
- teamAbv
- playerID
- {many other player attributes}
This endpoint, when called WITH an archiveDate, will retrieve a map in this format:
- statusCode
- body
- teamAbv - teamAbv refers to the team that you specified in the request.
- roster - this is a list of string items
- {playerID} – there will be many of these, string format. no other player info given here