Skip to main content
GET
NFL game roster API with player X accounts
1 credit per request · All plans from $0.00012/credit · Direct MPP at USD 0.00015 per call · Supports guest paid reads

Read both rosters

Use GET /x/sports/{league}/games/{id}/roster for the players of both teams. Find the game ID with List football games.
  • rosters holds each team’s teamId & its playerIds, in X’s order.
  • players holds each player once, keyed by ID, with jersey, position, headshot & X account.
  • A player’s xUser also says whether the account is protected, can offer subscriptions & has a highlighted label.
Rosters carry no college, birth details or large photos, so those fields are null. The box score has them for players who recorded stats.

Path parameters

string
required
nfl, in any case. X has no college rosters, so ncaafb gets a free 400 unsupported_league. Another value gets a free 400 invalid_league.
string
required
Game ID, a number up to 19 digits, such as 2055084502741811200. List football games returns it as id. Another value gets a free 400 invalid_game_id.

Query parameters

string
Fields to keep in each row, comma-separated, such as id,text,author.username. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns 400 unknown_field with the valid names, before any read. The price stays the same.
string
Fields to drop from each row, comma-separated, such as entities,media. It takes the same names as fields. With fields, it drops from the kept fields.

Headers

string
Full account key. Sessions and OAuth also work.
string
Bearer xq_your_guest_key_here for paid_reads.

Response

200 OK

string
The game ID from your request.
string
Always nfl.
object[]
Each team’s roster, in X’s order.
string
The team, a key of teams.
string[]
The team’s players in X’s order, keys of players.
object
The 2 teams, keyed by team ID.
string
The team ID that games & players refer to.
string
The team’s full name, such as San Francisco 49ers.
string
The team’s short name.
string
The team’s abbreviation, such as SF.
string
Another ID X keeps for the team. College plays & drives name a side by it.
string
The school or place the team plays for. College schedules & a game’s audience send it.
object[]
The team’s colors. Each has r, g & b, from 0 to 255.
object
The team’s logo links. default is the one X shows. light & dark suit light or dark backgrounds.
string
The user ID of the team’s X account. Pass it to Get user.
object
The team’s wins, losses & ties this season. X sends it only in college football games.
object[]
The team’s recent games, newest first. Games without a kickoff time come last. Each has id, startsAt, venue, status, clock, quarter, home & away. home & away hold teamId & points. X sends them only with the teams of a college football game. The list is empty elsewhere.
object
Every rostered player, keyed by player ID.
string
The player ID that plays & stats refer to.
string
The player’s team, a key of teams.
string
The player’s full name.
string
The name play descriptions use, such as B.Purdy.
string
The jersey number, as text.
string
The position, such as QB or DE.
string
The college the player came from.
string
Where the player was born. X sends it only for NFL players.
string
The birth date, as YYYY-MM-DD.
object
Photo links in original, large, medium & small. Any of them can be null.
object
The player’s X account, with id, username & blueVerified. Null when the player has none. Rosters also fill protected, superFollowEligible & the highlighted labelType, such as BusinessLabel. Other answers send them as null.

400 Unsupported league

Send nfl as the league. A game ID that is not a number gets invalid_game_id. Both answers are free.

404 Game not found

X knows no NFL game with this ID. This answer is free.

401 Unauthenticated

Anonymous requests get WWW-Authenticate: Bearer and a guest wallet checkout action. This is not a Payment challenge.

402 Payment required

Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action.

502 X API unavailable

The read service returned an error. Retry after a short delay.