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¶
- Marks all existing Lions players as
on_roster=False - Fetches current roster from the API
- Creates or updates
Playerrecords, settingon_roster=Truefor active players - 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).