ParlayAPI Field Guides

Your first sports odds request in Python

Leer la guía y ejecutar el cuaderno en español.

Follow the quickstart notebook in Colab from a fictional two-row example to one public NBA request. The recording shows the counts returned on December 1, 2026. The private-account chapter uses a fixture.

Watch on the ParlayAPI YouTube channel.

Chapters

Open the public NBA response or read the free-plan guide. When you are ready to test your own scope, create a private API key.

Read a first CSV by bookmaker

Open the fictional NBA report. North supplied both team prices. South supplied the Owls price but has no Foxes price or market time in this file. Each bookmaker has its own row so you can see exactly which comparison is supported.

To make the same report from your local NBA export, download the Python reader. Extract it beside your CSV and run:

python3 report.py odds.csv > nba-report.html

Open the HTML in your browser. A header-only file gives an empty report. Check the original export’s diagnostics for skipped observations.

Transcript

Run the notebook offline

Open the quickstart

Open the notebook linked below the player. In Colab, use your own private copy before you enter account credentials or keep any results. Leave the first configuration cell in offline mode and run the cells in order. This lets you check the table layout before making a request.

Read the practice rows

These teams, this book and both American prices are fictional. Each outcome gets its own row, and both rows refer to the same practice event. The notebook keeps the practice table separate from the DataFrame used for API observations. In offline mode that second table has zero rows.

Keep the full quote identity

When you flatten nested odds, carry the event and bookmaker into every market and outcome row. Otherwise, prices from different fixtures can appear comparable. A spread or total also needs its point. The two-way moneyline practice example has no threshold. Preserve the fields that were actually supplied.

Make one public request

Select the NBA demo

Set the configuration to demo and select the NBA. Rerun the configuration cell, then the fetch cell. Polling and extra checks stay off. This uses the limited public preview. A more complete account integration can vary by sport, fixture, bookmaker, market, plan and observation time.

Read the HTTP result

The fetch cell made one public request on December 1, 2026. It checked the response status and the selected sport before using the events. The public route caps each response at five events. If you run the notebook later, your event count and listed quotes can change.

Count what the sample returned

Run the flattening cell on the response. Count rows separately from distinct book keys because the same bookmaker can contribute several outcomes across multiple events. These are totals for the recorded sample. An outcome row may have a missing price. Inspect a row before treating it as a usable quote.

Read the response

Keep the clocks separate

Read a market’s timestamp together with its bookmaker and event. Some responses provide a market clock, a book clock, both or neither. The notebook generates processed_at locally while flattening. A recent processing time gives you no evidence that an old price has changed.

Inspect a usable moneyline

For a price comparison, select moneyline rows with an identified event, bookmaker and outcome. This example uses the Comets row from the fictional input. A missing or invalid American price stays out of the comparison. Keep the original response for your private investigation if the result differs from what you expected.

Compare within the same group

The notebook compares matching outcome names within each event. Its illustrative outlier screen drops prices far above the group median in decimal units. That screen does not establish availability, execution or freshness. Inspect the source and available timestamps before using a comparison in a product.

Set up a private request

Choose one account scope

Use a private notebook copy. First check the current plan and route cost, then choose the sport and market you intend to evaluate. The first request in the revised notebook asks for one market. The account examples in this film use a test transport and a dummy credential.

Enter the key at runtime

The notebook prompts only when the selected account request needs the key. Supply your own key privately at runtime. Keep it out of cells, URLs and shared outputs. The fixture captured one fixed-host request. In your own run, starting this cell can use account credits. Response handling uses a timeout and disables redirects.

Read the private rehearsal

The test transport supplies the same fictional event so you can inspect the private request path without exposing customer data or using a real account. A real evaluation can return different data or no rows. Keep an explicit record of your sport, market, requested scope and observation time.

Interpret and save

Distinguish empty from refused

Both fixture runs leave the observation table empty. Only the successful HTTP 200 response establishes that the requested sample returned zero events. A 403 means access was refused. Check the account’s entitlement or remaining allowance before you decide whether another request is appropriate.

Keep the export private

CSV export is off by default. Enable it separately in a private copy after you have inspected the rows and confirmed which fields the report needs. The export cell writes a temporary file when there are observations to save. Keep private account output out of published notebooks and source control.

Run the same exercise

Start with the fictional example, run one public request and explain one row in your own words. Check which source clock you can actually see. If the sample fits your project, the linked documentation and account setup let you evaluate one deliberate private request. Save its scope and result for your team.

If the first call leaves a blank result, identify the failed request or missing selection with eight offline cases.

When your team returns to the project, compare the original brief with this week’s requirements and record whether the intended reader accepted the report.