Analyzing Contest Results and Rankings
dk_get_leaderboard()
Get player leaderboard information for a particular contest
The dk_get_leaderboard()
function retrieves comprehensive information about the participants and their performance in a specific DraftKings contest. This includes:
- A list of all entries in the contest
- Fantasy points scored by each entry
- User information associated with each entry
- Current rank of each entry
- Winnings (if any) for each entry
This data allows for in-depth analysis of contest results, participant performance, and payout distributions. It’s particularly useful for understanding successful strategies, identifying top users, and gaining insights into contest dynamics.
dk_get_leaderboard(contest_key = 133645678)
#> # A tibble: 215 × 21
#> draft_group_id contest_key entry_key lineup_id user_name user_key
#> <int> <chr> <chr> <int> <chr> <chr>
#> 1 75284 133645678 3412356478 -1 GenoMike21 642864
#> 2 75284 133645678 3416201807 -1 carlitosway9 1334845
#> 3 75284 133645678 3416313295 -1 KidRaider3 5752908
#> 4 75284 133645678 3416410911 -1 carlosking89 8636059
#> 5 75284 133645678 3416034618 -1 sjamo35 8672865
#> 6 75284 133645678 3416642033 -1 Jace2013 11763756
#> 7 75284 133645678 3416680035 -1 Bucknutz00 417423
#> 8 75284 133645678 3415573084 -1 JWolff33 13692689
#> 9 75284 133645678 3416580244 -1 eracnrobert 2374855
#> 10 75284 133645678 3415480406 -1 Maria2199 3405766
#> # ℹ 205 more rows
#> # ℹ 15 more variables: user_entry_count <int>, user_entry_index <int>,
#> # time_remaining <int>, time_remaining_unit <chr>, max_time_remaining <int>,
#> # time_remaining_opponent <int>, rank <int>, fantasy_points <dbl>,
#> # fantasy_points_opponent <dbl>, user_name_opponent <chr>,
#> # number_tickets_won <int>, tickets_value <int>, winning_value <int>,
#> # winnings <list>, scoring_precision <int>
Note: Some functions such as
dk_get_leaderboard()
anddk_get_entries()
require authentication via DraftKings session cookies. These can be provided either by setting theDK_IV
andDK_JWE
environment variables, or by passing them directly to the functions using theiv
andjwe
arguments.
dk_get_entries()
Get entries for a contest
Retrieve detailed information about specific entry rosters in a contest, including:
- The complete drafted roster for each entry
- Detailed statistics for every player in an entry’s roster
- Fantasy points earned for each statistical category
- Performance breakdowns and scoring details
- Any late swap or substitution information
- Entry metadata such as entry fees, potential winnings, and current ranking
This function provides a deep dive into the composition and performance of individual contest entries, allowing for analysis of roster strategies and player contributions.
dk_get_entries(draft_group_id = 80584, entry_keys = c(3618408508, 3618897002))
#> # A tibble: 76 × 29
#> contest_key entry_key user_key draft_group_id lineup_id first_name last_name
#> <chr> <chr> <chr> <int> <int> <chr> <chr>
#> 1 140039397 3618408508 11222656 80584 -1 Cole Beasley
#> 2 140039397 3618408508 11222656 80584 -1 Cole Beasley
#> 3 140039397 3618408508 11222656 80584 -1 Cole Beasley
#> 4 140039397 3618408508 11222656 80584 -1 Cole Beasley
#> 5 140039397 3618408508 11222656 80584 -1 Cole Beasley
#> 6 140039397 3618408508 11222656 80584 -1 Gabe Davis
#> 7 140039397 3618408508 11222656 80584 -1 Gabe Davis
#> 8 140039397 3618408508 11222656 80584 -1 Gabe Davis
#> 9 140039397 3618408508 11222656 80584 -1 Gabe Davis
#> 10 140039397 3618408508 11222656 80584 -1 Gabe Davis
#> # ℹ 66 more rows
#> # ℹ 22 more variables: short_name <chr>, display_name <chr>,
#> # roster_position_id <int>, roster_position <chr>,
#> # roster_position_sort_order <int>, e_tag <chr>, percent_drafted <dbl>,
#> # draftable_id <int>, score <dbl>, stats_description <chr>,
#> # time_remaining_unit <chr>, time_remaining <int>, max_time_remaining <int>,
#> # percent_drafted_cp <chr>, player_deep_link <chr>, …
Note: An entry key is a numeric (or character) key that corresponds to a specific entry in a specific contest. See output from
dk_get_leaderboard()
.