# FanDuel odds in Google Sheets with Apps Script

FanDuel API (https://fanduelapi.com) is an independent API for FanDuel Sportsbook data: every player prop and game market FanDuel lists in NBA, NFL, NHL, MLB, college basketball and college football, normalized per player and stat with over and under prices in American and decimal odds, plus every line and price move with its timestamp, over REST, webhooks and MCP with one key. FanDuel API is an independent data service operated by FF API Inc. It is not affiliated with, endorsed by or sponsored by FanDuel.

Source page: https://fanduelapi.com/fanduel-api-google-sheets (this is its markdown version, https://fanduelapi.com/fanduel-api-google-sheets.md).

## Free offer

- Free plan: 100 credits a month, data delayed 5 minutes, no card. REST and MCP on every plan.
- Real-time data starts at Developer, $49 a month for 10,000 credits.
- Get a free key: https://fanduelapi.com/sign-up?ref=ai-claudebot

## Quickstart

1. Create a free account at https://fanduelapi.com/sign-up?ref=ai-claudebot and create an API key in the dashboard (https://fanduelapi.com/dashboard/keys). Keys start with `fd_`. Store it as `FANDUEL_API_KEY`.
2. Make a first call with curl:

```bash
curl "https://fanduelapi.com/api/v1/props?sport=nba&stat=points&limit=5" \
  -H "Authorization: Bearer $FANDUEL_API_KEY"
```

3. Or with Python (`pip install requests`):

```python
import os
import time
from datetime import datetime, timezone

import requests

BASE = "https://fanduelapi.com/api/v1"
SESSION = requests.Session()
SESSION.headers["Authorization"] = f"Bearer {os.environ['FANDUEL_API_KEY']}"


def get(path, **params):
    """GET one endpoint and return its data list, waiting out rate limits."""
    while True:
        r = SESSION.get(f"{BASE}{path}", params=params, timeout=10)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        return r.json()["data"]


def price(odds):
    """American odds as text. A suspended market can come back with no price."""
    return "off" if odds is None else f"{odds:+d}"

props = get("/props", sport="nba", stat="points")
for p in props:
    print(f"{p['player']:<26} {str(p['line']):>5}  over {price(p['over_american']):>5}  under {price(p['under_american']):>5}")
```

4. Stay current with `GET /api/v1/changes?since=<cursor>` instead of re-reading every prop. Full reference: https://fanduelapi.com/openapi.json and https://fanduelapi.com/llms-full.txt.

## Use it from Claude (MCP)

Claude Code, with your key read from the shell:

```bash
claude mcp add --transport http --scope user fanduelapi https://fanduelapi.com/api/mcp \
  --header "Authorization: Bearer $FANDUEL_API_KEY"
```

Claude on the web or desktop: Settings, Connectors, Add custom connector, then paste https://fanduelapi.com/api/mcp. Without a key it gives the keyless tools (search_docs, fetch_doc, get_sample_props). Setup for other agents: https://fanduelapi.com/mcp.

## Pricing

| Plan | Price | Credits a month | Calls a minute | Includes |
| --- | --- | --- | --- | --- |
| Free | Free | 100 | 20 | REST and MCP access, Data delayed 5 minutes |
| Developer | $49/month | 10,000 | 60 | Real-time data, Line move history, Change stream |
| Production | $149/month | 50,000 | 120 | Real-time data, Line move history, Webhooks, Priority support |
| Scale | $499/month | 250,000 | 180 | Real-time data, Full line move history, Webhooks, Bulk export, Priority support |

Cancel paid plans any time from the billing portal. Details: https://fanduelapi.com/pricing

## This page

[FanDuel API](https://fanduelapi.com/)/ Google Sheets

Google Sheets

# FanDuel odds in Google Sheets

A short Apps Script writes the FanDuel props board into a sheet, with the key kept in script properties rather than in a cell. A time-driven trigger refreshes it as often as your plan allows.

[Get a free API key](https://fanduelapi.com/sign-up)[Read the docs](https://fanduelapi.com/docs)

FanDuel API is an independent data service operated by FF API Inc. It is not affiliated with, endorsed by or sponsored by FanDuel.

## 1\. Add the script

1. In the sheet, Extensions, Apps Script. Paste the code and save.
2. Put your key in `setKey`, run it once, then delete the key from the code.
3. Run `refreshProps` and approve the permissions. A Props tab appears with one row per prop.

Code.gs

```
// Extensions, Apps Script. Run setKey once, then refreshProps.
const BASE = "https://fanduelapi.com/api/v1";
const COLUMNS = ["player", "team", "stat", "period", "line", "over_american", "under_american", "market_status", "starts_at", "observed_at"];

function setKey() {
  PropertiesService.getScriptProperties().setProperty("FANDUEL_API_KEY", "fd_...");
}

function fetchProps(params) {
  const key = PropertiesService.getScriptProperties().getProperty("FANDUEL_API_KEY");
  const query = Object.keys(params).map((k) => k + "=" + encodeURIComponent(params[k])).join("&");
  const res = UrlFetchApp.fetch(BASE + "/props?" + query, {
    headers: { Authorization: "Bearer " + key },
    muteHttpExceptions: true,
  });
  const body = JSON.parse(res.getContentText());
  if (res.getResponseCode() !== 200) throw new Error(body.error.code + ": " + body.error.message);
  return body;
}

function refreshProps() {
  const body = fetchProps({ sport: "nba", stat: "points", limit: 200 });
  const rows = body.data.map((p) => COLUMNS.map((c) => (p[c] === null ? "" : p[c])));
  const sheet = SpreadsheetApp.getActive().getSheetByName("Props") || SpreadsheetApp.getActive().insertSheet("Props");
  sheet.clearContents();
  sheet.getRange(1, 1, 1, COLUMNS.length).setValues([COLUMNS]);
  if (rows.length) sheet.getRange(2, 1, rows.length, COLUMNS.length).setValues(rows);
  sheet.getRange(1, COLUMNS.length + 2).setValue("as_of " + body.meta.as_of + ", " + body.meta.remaining + " credits left");
}
```

## 2\. Refresh on a trigger your plan affords

Triggers, Add Trigger, refreshProps, time-driven. Each run costs 6 credits (200 props at 3 credits per 100; see [credits](https://fanduelapi.com/credits)):

- **Free** is 100 credits a month on data five minutes behind: refresh by hand, or a daily trigger.
- **Developer** is 10,000 credits a month in real time: a trigger every 30 minutes fits with room to spare.

The cell beside the header shows `meta.as_of` and `meta.remaining` after every run, so you can see freshness and quota at a glance. If a run fails, the error code is in the execution log; the codes are on [errors and limits](https://fanduelapi.com/fanduel-api-errors).

## 3\. Work with the numbers

Implied probability of the over price in G2

```
=IF(G2<0, -G2/(-G2+100), 100/(G2+100))
```

Hold on a two-way market, over in G2, under in H2

```
=IF(G2<0,-G2/(-G2+100),100/(G2+100)) + IF(H2<0,-H2/(-H2+100),100/(H2+100)) - 1
```

For a season of line history, which is too big for a trigger, export a CSV and import it: see [CSV export](https://fanduelapi.com/fanduel-api-csv-export). The same board in Excel is on [Excel](https://fanduelapi.com/fanduel-api-excel).

## Questions

## Related

- [Excel Pull FanDuel player props into Excel with Power Query and a key in the request header, refresh on a schedule that fits your plan, or open a CSV export.](https://fanduelapi.com/fanduel-api-excel)
- [CSV export Export FanDuel props or line history for a date range as CSV or NDJSON: the columns, the curl call, loading it in pandas and resuming by cursor.](https://fanduelapi.com/fanduel-api-csv-export)
- [Free plan What the free FanDuel API plan includes: every endpoint on data five minutes behind, the monthly and per-minute limits, and what needs a paid plan.](https://fanduelapi.com/fanduel-api-free)
- [Line movement Where a FanDuel player prop opened, every line and price move since, and when it last moved, from the history endpoint, with a sample move tape.](https://fanduelapi.com/fanduel-line-movement)
- [Pricing Free on delayed data, then real time from the Developer plan.](https://fanduelapi.com/pricing)

## Make your first call in a few minutes

Sign up, create a key in the dashboard, and send it as a Bearer token. The free plan needs no card.

[Get a free API key](https://fanduelapi.com/sign-up)

## FAQ

### Is there a free plan?

Yes. Free includes API access with delayed data, enough to build and test a model.

### Is this affiliated with FanDuel?

No. This is an independent data service operated by FF API Inc. and is not affiliated with or endorsed by FanDuel.

### Which sports are covered?

NBA, NFL, NHL, MLB and college sports as FanDuel lists them, starting with player props.

### How do I cancel?

From the billing portal in your dashboard, at any time.

### How do I get a free key?

Sign up at https://fanduelapi.com/sign-up?ref=ai-claudebot. Free plan: 100 credits a month, data delayed 5 minutes, no card. REST and MCP on every plan.

### Can an AI agent sign up for me?

Yes. The agent sends POST https://fanduelapi.com/api/v1/agent/signup with your email and what you are building (add "ref": "ai-claudebot"), you approve the emailed link, and the agent collects the key. Details: https://fanduelapi.com/connect.
