# DraftKings DFS Scraper (`codingfrontend/draftkings-scraper`) Actor

Scrape DraftKings DFS contests and player salaries by sport. Get contest metadata and optional player details in a flat row.

- **URL**: https://apify.com/codingfrontend/draftkings-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does DraftKings DFS Scraper do?

**DraftKings DFS Scraper** reads public [DraftKings](https://www.draftkings.com/lobby) lobby or contest responses and extracts contest metadata plus optional public player salary rows. It does not sign in, enter contests, access private contest data, solve CAPTCHAs, or bypass geofencing or other access controls.

### Why use DraftKings DFS Scraper?

Use it to build a public daily-fantasy contest feed, compare entry fees and prize pools, archive public lobby snapshots, or collect salary-cap player information when the requested response exposes it. The Actor accepts multiple public sources, deduplicates contest/player IDs, follows a small bounded page-number budget, preserves page provenance, and stores run metrics separately in the `OUTPUT` key-value record. Apify adds API access, scheduling, monitoring, run history, and integrations.

### How to scrape DraftKings data

1. Open the Actor and choose **Start**.
2. Leave `startUrls` at its default to request the public lobby, or add public `draftkings.com` URLs.
3. Choose whether player rows are included and set `maxItems` and `maxPages`.
4. Run the Actor and inspect the dataset and `OUTPUT` summary.

The `maxItems` limit is global across all source URLs and pages. Source URLs are deduplicated before requests. `urls` and `maxResults` remain supported compatibility aliases. Non-default alias values that conflict are rejected.

### What data can it extract?

| Record | Fields |
| --- | --- |
| Contest | `contest_id`, `contest_name`, `sport`, `game_type`, `entry_fee`, `currency`, `prize_pool`, public entry counts, times, and business `contest_status` |
| Player | `player_id`, `player_name`, position, team, opponent, salary, average points, injury status, and game start time |
| Provenance | `source_url`, `sourceDomain`, `provenance`, `page_url`, `page_num`, `position_index`, and `scraped_at` |
| Diagnostics | Exact `recordType`, `diagnosticType`, `url`, `error`, `errorCode`, and `scrapedAt` row when enabled |

### Input

See the input tab for the complete configuration. `startUrls` accepts request-list objects such as `{"url":"https://www.draftkings.com/lobby"}`. Supported hosts are `draftkings.com` and its subdomains. `sport` is a label fallback when the public payload does not provide a sport; it is not a claim that a hidden or private sport API was queried. `includePlayers` and `includeDiagnostics` default to `true`; `maxItems` defaults to `100`; and `maxPages` defaults to `1`.

Developer options are bounded: `timeoutMs` 1,000–120,000 (default 30,000), `requestDelayMs` 0–5,000 (default 0), and `maxRequestRetries` 0–2 (default 1). `proxyConfiguration` is accepted for compatibility only; direct public HTTP is used and the summary reports `proxyUsed: false`. `fixtureFile` and `fixtureJson` are explicit local QA inputs and never silently replace a failed live request.

#### Example inputs

Default public lobby:

```json
{"startUrls":[{"url":"https://www.draftkings.com/lobby"}],"maxItems":10,"maxPages":1}
```

Contest-only filtered output:

```json
{"sport":"NFL","includePlayers":false,"maxItems":25,"maxPages":2}
```

Multiple sources and developer controls:

```json
{"startUrls":[{"url":"https://www.draftkings.com/lobby"},{"url":"https://www.draftkings.com/dfs"}],"maxItems":50,"maxPages":2,"requestDelayMs":250,"maxRequestRetries":1,"timeoutMs":30000}
```

Fixture-backed QA:

```json
{"fixtureFile":"test/fixtures/draftkings-pages.json","maxItems":4,"maxPages":2,"includePlayers":true,"includeDiagnostics":true}
```

### Output

Normal contest and player records retain the legacy business field names, use `contest_status` for the source's contest status, and include source identity/provenance without generic discriminators, transport labels, extraction labels, or request/debug wrappers. A minimal diagnostic example is:

```json
{"recordType":"diagnostic","diagnosticType":"REQUEST_FAILED","url":"https://www.draftkings.com/lobby","error":"The public DraftKings request failed.","errorCode":"REQUEST_FAILED","scrapedAt":"2026-09-09T12:00:00.000Z"}
```

A shortened contest row is:

```json
{"contest_id":"contest-example-123","contest_name":"Example Sunday Tournament","sport":"NFL","game_type":"Tournament","entry_fee":5,"currency":"USD","prize_pool":100000,"contest_status":"OPEN","source_url":"https://www.draftkings.com/lobby","sourceDomain":"www.draftkings.com","provenance":"official_draftkings_public_contest_or_player_page","page_num":1,"scraped_at":"2026-09-09T12:00:00.000Z"}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

`OUTPUT` is a key-value summary with status, normal/diagnostic counts, contest/player counts, candidate and duplicate counts, pages, failed-request evidence, fixture mode, and proxy configuration. It is operational metadata and is not mixed into dataset rows.

### How much will it cost to scrape DraftKings?

Cost depends on the number of source URLs and pages, request delays, retries, and runtime. Start with one public lobby URL, `maxPages: 1`, and a small `maxItems` value. Increasing page limits or using multiple sources increases requests. The Actor uses direct HTTP and does not add proxy costs.

### Tips and access limitations

DraftKings pages can be dynamic, jurisdiction-sensitive, or unavailable outside supported regions. An HTTP error, challenge/CAPTCHA page, login wall, DNS failure, malformed payload, or empty response becomes a bounded diagnostic; it is never reported as successful contest data. The Actor does not automate login, contest entry, payment, or access-control bypass. A fixture run proves parser and output behavior only, not current live availability.

### FAQ, support, and responsible use

If a run contains only diagnostics, inspect the source URL, `errorCode`, and `OUTPUT` record. Report reproducible issues in the Actor's Issues tab with a run ID. DraftKings is not affiliated with this Actor. Follow DraftKings terms, robots guidance, rate limits, jurisdiction rules, privacy obligations, and applicable law. Do not use extracted data to enter contests or make gambling decisions automatically.

Our Actors do not extract private user data; they process public source responses only. Public sports and player information can still be subject to terms and regulation, so use it responsibly and consult qualified legal counsel when unsure.

### Local validation

```bash
npm ci
apify validate-schema
apify run --purge --input-file ./test/inputs/default.json
npm test
npm run lint
npm run validate
npm run check
```

# Actor input Schema

## `startUrls` (type: `array`):

Public DraftKings lobby or contest/API URLs. Custom URLs override the default lobby source.

## `urls` (type: `array`):

Compatibility alias for startUrls. Conflicting non-default values are rejected.

## `sport` (type: `string`):

Optional sport label used when the public payload does not provide one.

## `includePlayers` (type: `boolean`):

Emit public player salary rows found in the response.

## `includeDiagnostics` (type: `boolean`):

Emit minimal diagnostic rows for blocked, failed, invalid, or empty public responses.

## `maxItems` (type: `integer`):

Global maximum number of contest and player rows across all source URLs and pages.

## `maxResults` (type: `integer`):

Compatibility alias for maxItems.

## `maxPages` (type: `integer`):

Bounded page-number traversal for public lobby/API URLs; defaults to one request.

## `timeoutMs` (type: `integer`):

Maximum time allowed for each public request.

## `requestDelayMs` (type: `integer`):

Delay before each direct public request.

## `maxRequestRetries` (type: `integer`):

Bounded retries for transient errors; access boundaries are not retried.

## `userAgent` (type: `string`):

Optional transparent HTTP user-agent.

## `proxyConfiguration` (type: `object`):

Accepted for compatibility but not wired to transport; the Actor uses direct public requests.

## `fixtureFile` (type: `string`):

Optional explicit local QA fixture inside this Actor directory. It is never a silent live fallback.

## `fixtureJson` (type: `object`):

Optional explicit local QA payload object. Use fixtureFile or fixtureJson, not both.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.draftkings.com/lobby"
    }
  ],
  "urls": [],
  "sport": "NFL",
  "includePlayers": true,
  "includeDiagnostics": true,
  "maxItems": 100,
  "maxPages": 1,
  "timeoutMs": 30000,
  "requestDelayMs": 0,
  "maxRequestRetries": 1
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/draftkings-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/draftkings-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call codingfrontend/draftkings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/draftkings-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/iiRlb5XmFtxmPAVud/builds/8tmE1NlXqhCwcY1o2/openapi.json
