Skip to contents

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:

  1. A list of all entries in the contest
  2. Fantasy points scored by each entry
  3. User information associated with each entry
  4. Current rank of each entry
  5. 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() and dk_get_entries() require authentication via DraftKings session cookies. These can be provided either by setting the DK_IV and DK_JWE environment variables, or by passing them directly to the functions using the iv and jwe arguments.

dk_get_entries()

Get entries for a contest

Retrieve detailed information about specific entry rosters in a contest, including:

  1. The complete drafted roster for each entry
  2. Detailed statistics for every player in an entry’s roster
  3. Fantasy points earned for each statistical category
  4. Performance breakdowns and scoring details
  5. Any late swap or substitution information
  6. 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().