Skip to content

About

Run Python notebooks for sports odds research. Match fixtures, check closing odds, and test data quality in Jupyter or Colab. Start offline with fictional rows or analyze an authorized local season CSV.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ParlayAPI notebooks: private sports-data research in Python

Five self-contained notebooks for learning the analysis code before connecting an account. Open a notebook in Colab and choose Run all: the default offline mode runs the local mathematical examples without API calls or key prompts. Illustrative calculations are not current market observations.

Notebook Topic Run in Colab
01 Quickstart Nested event data, a DataFrame, and an optional private CSV Open
02 No-vig and EV Existing proportional and additive examples and their test cases Open
03 Line movement Optional polling and a movement chart Open
04 Closing line value Local grading examples and an optional account archive request Open
05 Parlay pricing Existing independent-price math and correlation caveats Open

Explore the sports data field guides for short exercises in report writing, quote freshness, request budgets, World Cup results and broadcast rehearsal.

Explore Serie A results and test a soccer moneyline feed. Choose a matchday, inspect missing scores, then decide which of three fictional markets can be compared.

Diagnose your first API response with eight offline cases and a runnable Python notebook.

Focused recipes

Replay 50 fictional baseball fixtures in your scheduling tests. Two games have the same teams and date. A postponed game gets a new date under its original ID. Download the JSON or generate new opponents locally.

Explore World Cup scores across five tournaments. Query 360 men's World Cup matches from 2010 through 2026 in your browser or download CSV and SQLite. Separate the regulation score, the cumulative score after extra time and the penalty shoot-out result.

Choose a next check after an API response: rehearse twelve invented authentication, access, rate-limit and transport cases with explicit attempt and wait budgets. The Python command makes no requests and keeps useful output unverified.

Find closing odds for one football match. Match a fixture by division, date and teams, then check all three closing outcomes. Start with the offline exercise or load an authorized local season CSV.

Check a sports data assistant’s answer in the browser. Compare a failed request with a complete empty result, then grade another case with the downloadable workshop.

Troubleshoot an API integration with 25 fictional setup problems and a downloadable Node.js runner. Watch a 32-second stream recovery example, then reproduce its three decisions with a teammate.

Budget several API jobs: an offline CSV-to-JSON command and self-contained notebook for mixed request costs, unknown rates, shared readers and windows crossing midnight. Start with the invented example, then retain your own assumptions privately.

Plan and check a small API evaluation: a worked polling window, portable requirements brief and exact field-check examples, with free browser tools and JSON downloads. No key or live request is needed for the teaching exercise.

CSV identifier integrity: preserve leading zeros and long IDs, distinguish missing observations from empty text, and run an offline example with literal expected output.

UFC method-of-victory coverage: a standard-library Python client that checks FanDuel, DraftKings and Novig in one private request. Start with the synthetic demo, then use your own key to see counts and observation ages. KO/TKO and KO/TKO/DQ stay distinct.

Experimental Dify coverage tool: run a fictional example through the Dify SDK, then develop a private own-key coverage diagnostic. Local SDK tests only; Dify installation and Marketplace publication remain unverified.

Private Prefect coverage flow: a synthetic-first, one-shot UFC diagnostic with aggregate-only task results, no caching and an explicit own-key live option. Tested with the local Prefect runtime.

Private Mastra moneyline check: a two-step workflow that refuses incomplete soccer outcome sets before private analysis. Start with fictional presence metadata, then optionally make one own-key request. Tested with the local Mastra runtime.

PydanticAI sport metadata report: typed event-count observations that preserve missing and unknown data, with a validated agent tool and an explicit public MCP metadata option. No API or model calls by default.

Hamilton odds comparability dataflow: run the existing fictional comparison rules as an explicit Python dataflow. Missing outcomes, ambiguous matches, different settlement rules and stale source timestamps remain visible in the result. No account or network access is needed.

Scope a client integration

Use the Sports Data Project Brief to agree on required books and markets, model a polling workload, and export a private client scope with acceptance checks. It does not collect API keys or call the API. Requirements and workload assumptions are not proof of priced coverage or a subscription quote.

Choose API access explicitly

Watch the five-minute Python walkthrough to see the public request and the private-account rehearsal.

In the DataFrame quickstart, Run all compares four fictional prices for the Comets–Owls game and shows the leading bookmaker for each team. To see a public board, change the first setting to MODE = "demo" and rerun. The example requests NBA moneylines. If that board is empty, set SPORT = "icehockey_nhl" or another supported sport in the same cell.

The configuration cell has three modes:

  • offline: the default. No network requests, account prompts, polling, or CSV export.
  • demo: a limited anonymous sample. Environment keys are ignored. The odds demo returns at most five US moneyline events, with a shared limit of 60 requests per hour per IP. Availability varies; an empty response does not explain missing data.
  • account: requests within your own account allowance. A hidden runtime prompt asks for your key when the first account request is made. Never paste a key into a code cell. Existing environment keys do not change the selected mode.

Use a private notebook copy before selecting account. Each reader supplies their own account and key. Current endpoint access, source coverage and allowances are described in the API docs and pricing. A free account does not promise every event, source, or market.

Additional actions have separate switches, all off by default: RUN_EXTRA_API_CHECKS, RUN_POLLING, and SAVE_PRIVATE_CSV. The line-movement lesson only polls after RUN_POLLING is enabled in a live mode. The quickstart writes an optional CSV to a private temporary file outside the repository. Its processed_at marks local flattening time; bookmaker_last_update and market_last_update preserve source fields separately, including missing values. These fields do not establish freshness. The request code uses the fixed HTTPS API origin, does not follow redirects, bounds response size and time, and does not retry automatically.

Keep keys and results out of shared code

Published notebooks have empty outputs and execution counts. Colab's output omission setting is enabled as an additional precaution. Other notebook hosts may handle this differently; it is not access control or a guarantee that a modified notebook cannot save output.

Keep executed account notebooks and CSVs private. Clear every output before sharing code or saving a notebook to GitHub. Do not upload API responses, keys, or private bet logs. Finish by restarting the runtime; the final cell also drops the notebook's stored key reference. Changing modes alone does not erase outputs from earlier cells.

The MIT license covers software. API access does not grant public redisplay or redistribution rights. Data use follows the applicable terms and any written agreement. These defaults do not amend existing customer contracts.

Local use and checks

python -m pip install -r requirements.txt
jupyter lab

Run the offline tests after installing the dependencies:

MPLBACKEND=Agg python -m unittest -v test_notebook_privacy.py

The tests execute every default notebook cell with network and key prompts blocked, then separately exercise explicit anonymous and account requests with mocked responses and a fake key. They do not contact ParlayAPI.

For the maintained one-request Python command and response validation, see the parlay-api SDK. The notebooks retain their existing educational analysis methods; those methods are assumptions and examples, not trading recommendations or profit forecasts.

Odds Reality Check

Try the twelve-case evidence challenge: test whether a betting-data claim is supported, contradicted, or still unknown. Play in the browser or use the local scorer. Fictional records, explained answers and no account or model calls required. This educational challenge is not a commercial-model ranking or a production certification.

Challenge media brief · ParlayAPI media kit and editorial contact.

Interactive synthetic lab

Run the basketball scoring lab. A fictional scorer changes a three to a two. Compare the two finals, switch the overtime rule and see which player-points reports change.

Read A valid schema can still describe the wrong comparison, a practical article on semantic matching, source timestamps and preserving unresolved candidates, with fictional examples and runnable code.

The odds comparability lab is a version-pinned lesson. Its synthetic cases explore comparison rules and polling budgets without API data or keys. Open the version-pinned lesson in marimo.

About

Run Python notebooks for sports odds research. Match fixtures, check closing odds, and test data quality in Jupyter or Colab. Start offline with fictional rows or analyze an authorized local season CSV.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages