Draft Kings, NFL, Scraping, Uncategorized

Scraping Draft Kings Contests

There used to be working code out there to scrape sites such as Draft Kings. At least, back before Draft Kings changed it’s terms of use to specifically forbid automated scraping of it’s content.

Here, I’m sharing how you can automatically download contest data from Draft Kings.

How to do it

Draft Kings protects it’s content behind a login-wall so we have to:

  • create a program that logs into draft kings
  • click the appropriate links to get to the contests.

Without further ado, here is the code. We use Selenium to automate our chrome browser and we store our login credentials in a config.py file (create your own).

  1. Open Chrome
  2. Sign InSign in to Draft Kings
  3. Open NFL Live Contests
  4. Open NFL Live Contests and Sort by Prize PoolExtract contest ids and informationExtract Contest ID's and information
  5. Download contest data

Download Contest CSV's

That’s it! For the NFL, I’d recommend you run this every Sunday around 9:30 EST since all the lineups will be published for the major Sunday only contests.

Legality

The US has taken the position that scraping public data is fine so long as you don’t scrape at a disruptive rate. That being said, Draft Kings data is a gray area. They encourage you to download it and don’t really restrict the use but say you can’t use automated scrapers in their terms of service.

Personally, I find this ridiculous because Draft Kings seems to intentionally make their contest csv a pain to parse for your basic excel user by using some wonky space delimited format for their players. Even worse, DFS operators provide their contest info to sites like SuperLobby but not to the average player. And if these DFS operators want to continue using the argument that DFS is a game of skill they need to demonstrate that they make it easy for people, not sharks, to use the data.

If I were you, I’d make my scraping look as human as possible so they can’t prove you scraped to get it. I have a basic example on how to do that here.

Coming Soon

During the regular season, I’ll be publishing weekly recaps that use market basket analysis to understand ownership and stacks beyond basic ownership percentages.

Leave a Reply

Your email address will not be published. Required fields are marked *