Skip to main content

DraftKings Python Client

Build Status codecov PyPI

Introduction

DraftKings does not have a public API with documentation.

However, one can identify network API calls to fetch data from DraftKings - data like NFL contests, or players available for a "Draft Group" (e.g. all NBA games starting at 7 PM EST tonight), along with relevant metadata.

As DraftKings makes no guarantees about it's public API, this client makes no guarantees that existing API methods will work consistently.

Install using PyPi

pip install draft_kings

API

Get Contests for a Sport

from draft_kings.data import Sport
from draft_kings.client import contests

contests(sport=Sport.NBA)

Get Available Players for a Draft Group

from draft_kings.client import available_players

available_players(draft_group_id=1)

Get Draft Group Details

from draft_kings.client import draft_group_details

draft_group_details(draft_group_id=1)

Get Countries

Get all country information that DraftKings uses to make country-specific requests

from draft_kings.client import countries

countries()

Get Regions

Get all region information for the specified country code that DraftKings uses to make region-specific requests

from draft_kings.client import regions

regions(country_code='US')

Get Draftables

Get all draftable players

from draft_kings.client import draftables

draftables(draft_group_id=1)

Metadata

Release files for draft-kings 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for draft-kings 2.0.2
File Size Uploaded Provenance Actions
draft_kings-2.0.2.macosx-10.15-x86_64.tar.gz 10.7 kB Without provenance Details for draft_kings-2.0.2.macosx-10.15-x86_64.tar.gz

Release files / draft_kings-2.0.2.macosx-10.15-x86_64.tar.gz

Download URL draft_kings-2.0.2.macosx-10.15-x86_64.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8f56ac9e6c89d148b605bc9c5fe0a7d133ea48a141347f881875c2b4c33c814a
BLAKE2b-256 checksum
How to use checksums
b3ca92bb44a09d61c47ba208d982d72489bacd9675aec34e78ecd89fc6062e62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

Security for draft-kings 2.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page