Skip to content

Repository files navigation

DraftKings NFL API Data Viewer

This Python GUI application retrieves and displays NFL futures data from the DraftKings API. It is designed to help users easily extract and organize betting market information, such as Regular Season Wins, Awards, Player Props, and more.


How to Run

There are three ways to use this application, depending on your preference.

Option 1: Standalone Program (Recommended for Windows)

For most users, the easiest method is to use the pre-built .exe file. No Python installation is needed.

  1. Go to the Releases page on GitHub.
  2. Download the DK_API_Scraper_vX.X.X.exe file from the latest release.
  3. Run the downloaded file.

Option 2: Running from Source (with run.bat for Windows)

This option is for users who download the source code and want a simple way to run it on Windows without using the command line.

  1. Make sure you have Python installed on your system.
  2. Download or clone the project repository.
  3. Install the required dependencies by opening a terminal or command prompt in the project folder and running:
    pip install -r requirements.txt
  4. Once dependencies are installed, simply double-click the run.bat file to start the application.

Option 3: Running from Source (Manual)

This method works for all operating systems (Windows, macOS, Linux) and is the standard way to run a Python application from source.

  1. Ensure you have Python installed.
  2. Download or clone the project repository.
  3. It is highly recommended to create and activate a virtual environment:
    # For Windows
    python -m venv venv
    venv\Scripts\activate
    
    # For macOS/Linux
    python3 -m venv venv
    source venv/bin/activate
  4. Install the required dependencies:
    pip install -r requirements.txt
  5. Run the application from your terminal:
    python dk_api_gui_explorer.py

Features

  • Graphical User Interface (GUI) using Tkinter
  • Supports multiple market categories including:
    • Wins
    • Futures
    • Awards
    • Player Futures
    • Rookie Watch
    • Stat Leaders
    • Playoffs
    • Division Specials
    • Team Specials
    • Game-Specific Props
  • Data parsing and pivoting for Over/Under markets, including player props
  • Accurate main-line detection — the primary line comes from DraftKings' own main flag rather than being guessed from the odds, so alternate lines are never mistaken for the real one
  • Export to CSV / Excel, plus raw JSON export of the last API response
  • Built-in ID reference for league, category, and subcategory IDs
  • Live ID lookup (Tools > List Live Sub-Categories) for when the bundled reference goes stale
  • Built-in auto-updater — the packaged build checks GitHub Releases on start, verifies the SHA-256 of any download against the published release, then replaces itself and restarts
  • Designed to work with the DraftKings NFL League ID (88808)

Dependencies

  • tkinter (included with most Python installations)
  • pandas
  • curl_cffi

Explorer Tab

explorer

  1. Input Fields:
    • League ID (e.g., 88808 for NFL)
    • Category ID (e.g., 1286)
    • Sub-Category ID (e.g., 13354)
  2. Click “Grab Data” to retrieve market data from DraftKings.
  3. The data will be displayed in the log window.
  4. Click “Save Results” to export the latest data to a CSV file.

ID Reference Tab

id_reference

  • Browse through categories and subcategories with corresponding IDs.
  • Click any ID entry to auto-populate the Viewer tab’s input fields.

Updates

The .exe build keeps itself current:

  • On launch it quietly asks GitHub for the newest release. If you are up to date, or GitHub is unreachable, nothing is shown.
  • When a newer version exists you are shown the release notes and asked whether to install it.
  • The download is checked against the SHA-256 digest GitHub publishes for the release asset. A mismatch aborts the update — a file that fails verification is never written to disk, let alone run.
  • The running program is renamed aside, the new build takes its place, and the app restarts. The old executable is deleted on the next launch.

Set "check_updates_on_startup": false in config.json to disable the automatic check; Help > Check for Updates... always works regardless.

Running from source, the updater only tells you a new version exists and links to the releases page — it will never overwrite your working copy. Use git pull.

Upgrading from v0.1.1 or earlier: those builds predate the updater, so this one has to be downloaded manually. Updates after that are automatic.

Keeping IDs Current

DraftKings rotates sub-category IDs between seasons, and a stale ID returns an empty result rather than an error. When that happens, use Tools > List Live Sub-Categories to print the IDs DraftKings is serving right now, and update id_reference.json from that listing.


Output Example

Example of parsed betting market data:

--- New Data Request ---
Fetching data from DraftKings...
  League ID: 88808, Category ID: 1286, Sub-Category ID: 13354
  Successfully fetched data feed.
  Parsed 320 betting selections.
--- Request Complete ---

Participant     Line  Over Odds  Under Odds
-------------  -----  ---------  ----------
BAL Ravens      11.5  +115       -140
MIA Dolphins     3.5  -150       +120
...

Note: DraftKings rotates its sub-category IDs between seasons, so the IDs in id_reference.json can go stale. If a request returns no selections, the IDs are the first thing to check — the subcategories array in any category response lists the current ones.


Notes

  • The app uses regex parsing to extract numeric IDs and betting labels (e.g., "Over", "Under") from titles.
  • Markets like "Regular Season Wins" are automatically pivoted into a readable format with Participant, Line, Over Odds, and Under Odds columns.
  • The application works for any DraftKings market with the correct combination of IDs.

ID Reference Format

The id_reference.json file contains league market categories and subcategories. Example:

[
  {
    "category_name": "WINS (Category ID: 1286)",
    "subcategories": [
      "Regular Season Wins (ID: 13354)",
      "Most Wins (ID: 13365)",
      "Fewest Wins (ID: 13367)"
    ]
  },
  {
    "category_name": "AWARDS (Category ID: 787)",
    "subcategories": [
      "MVP (ID: 13339)",
      "OPOY (ID: 13340)"
    ]
  }
]

The IDs are automatically extracted using regex when clicked, and populate the Viewer tab.


File Structure

draftkings_api_explorer/
│
├── .gitignore               # Specifies intentionally untracked files to ignore
├── config.json              # Configuration file for API endpoints
├── dk_api_gui_explorer.py   # The main application script with the GUI
├── id_reference.json        # Reference data for market categories and IDs
├── LICENSE                  # The MIT License for the project
├── README.md                # The project's documentation file
└── requirements.txt         # A list of the Python packages required

Coming Soon / To Do

  • Add support for retrieving data across multiple subcategory IDs
  • Optionally export the full alternate-line ladder alongside the main line

License

This project is open source under the MIT License.


Author

yzRobo

About

Python GUI application that retrieves and displays NFL data from the DraftKings API. It is designed to help users easily extract and organize betting market information, such as Regular Season Wins, Awards, Player Props, and more.

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages