rtrive / f1-telegram-fantasy-bot

2 stars 0 forks source link

Get leaderboard of a single GP #14

Closed kin0992 closed 2 years ago

kin0992 commented 2 years ago

After a GP has been completed, there should be a command to get fantasy leaderboard related to the GP

kin0992 commented 2 years ago

After a first analysis, we should get the league information from GET https://fantasy-api.formula1.com/f1/2022/leagues/<league-id>?v=1 and we should extract from the response the max value within the previous_game_period_ids array. Notice that the behavior is unknown when the race weekend has started.

Once you get that value (a number), you can get the leaderboard for that GP making the following request: GET https://fantasy-api.formula1.com/f1/2022/leaderboards/leagues?v=1&game_period_id=<game-period>&league_id=<league-id>