Sync Players

Lions roster and player data

Sync Players

Fetches the Detroit Lions current roster. Powers the Roster page and player detail pages.

API Endpoint

GET https://api.lionschedule.me/api/v1/football/teams/8/roster/

Fallback: GET https://api.lionschedule.me/api/v1/football/players/?team_id=8

No season parameter -- always returns the current roster.

What It Does

  1. Marks all existing Lions players as on_roster=False
  2. Fetches current roster from the API
  3. Creates or updates Player records, setting on_roster=True for active players
  4. Players no longer on the roster remain in the database but with on_roster=False

Data Stored

Player: player_id, full_name, first_name, last_name, jersey, position_name, position_abbreviation, height, weight, age, college, headshot_url, status, on_roster, experience_display

Response Structure

{
  "players": [
    {
      "player_id": 4426515,
      "full_name": "Jared Goff",
      "jersey": "16",
      "position_abbreviation": "QB",
      "height": "6'4\"",
      "weight": 217,
      "age": 29,
      "college": "California",
      "headshot_url": "https://a.espncdn.com/..."
    }
  ]
}

Schedule

Run daily or on-demand. Roster changes are infrequent outside of roster cut periods.

Management Command

python manage.py sync_players --triggered-by manual

Dependencies

Requires sync_core to have run first (needs Lions Team record).