### PHP: Run quickstart.php Source: https://parlay-api.com/docs/sdks Runs the PHP quickstart example after saving it as quickstart.php. Requires the PARLAY_API_KEY environment variable to be set. ```bash php quickstart.php ``` -------------------------------- ### Ruby quickstart: fetch MLB odds with net/http Source: https://parlay-api.com/docs/sdks Ruby 3.0+ standalone HTTP reference using net/http and json. Save as quickstart.rb; no gem install needed. Requires the PARLAY_API_KEY environment variable, otherwise it raises an error. Makes a GET request to the baseball MLB odds endpoint and prints the first event as pretty JSON, or a message when no events match. ```ruby require 'net/http' require 'json' key = ENV.fetch('PARLAY_API_KEY') raise 'Set PARLAY_API_KEY first' if key.strip.empty? uri = URI('https://parlay-api.com/v1/sports/baseball_mlb/odds?regions=us&markets=h2h') request = Net::HTTP::Get.new(uri) request['X-API-Key'] = key response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, open_timeout: 10, read_timeout: 30) do |http| http.request(request) end unless response.is_a?(Net::HTTPSuccess) raise "HTTP #{response.code}: #{response.body}" end events = JSON.parse(response.body) raise 'Expected an event array' unless events.is_a?(Array) puts(events.empty? ? 'No events match this request right now.' : JSON.pretty_generate(events.first)) ``` ```bash ruby quickstart.rb ``` -------------------------------- ### GET /v1/event-markets/examples Source: https://parlay-api.com/docs/swagger Endpoint to get event market examples. ```APIDOC ## [GET] /v1/event-markets/examples ### Description Get event market examples. ### Method GET ### Endpoint /v1/event-markets/examples ``` -------------------------------- ### C#/.NET: Create console project Source: https://parlay-api.com/docs/sdks Creates a new .NET console project named parlay-quickstart and changes into its directory. Part of the C#/.NET setup before replacing Program.cs with the example. ```bash dotnet new console -o parlay-quickstart cd parlay-quickstart ``` -------------------------------- ### Run Rust example with cargo run Source: https://parlay-api.com/docs/sdks Builds and runs the Rust project after the main.rs example has been replaced. Executes the first-call example. ```bash cargo run ``` -------------------------------- ### Run quickstart.py Source: https://parlay-api.com/docs/sdks Run the quickstart.py example after saving the first call code. Executes the SDK example and prints the first event or a message if no events match. ```bash python quickstart.py ``` -------------------------------- ### Install websockets and run Python stream.py Source: https://parlay-api.com/docs/websocket/quickstart Install the 'websockets' package and run the Python WebSocket client. Set the PARLAY_API_KEY environment variable before running. ```bash pip install websockets # PARLAY_API_KEY=pk_live_xxxx python stream.py ``` -------------------------------- ### Java quickstart: fetch MLB odds with java.net.http Source: https://parlay-api.com/docs/sdks Java 17+ standalone HTTP reference using java.net.http. Save as Main.java; no JSON library required. Requires the PARLAY_API_KEY environment variable, otherwise throws an IllegalStateException. Sends a GET request to the baseball MLB odds endpoint and prints the JSON response, or a message when the response is an empty array. ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class Main { public static void main(String[] args) throws Exception { String key = System.getenv("PARLAY_API_KEY"); if (key == null || key.isBlank()) { throw new IllegalStateException("Set PARLAY_API_KEY first"); } var client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)).build(); var request = HttpRequest.newBuilder(URI.create( "https://parlay-api.com/v1/sports/baseball_mlb/odds?regions=us&markets=h2h")) .header("X-API-Key", key) .timeout(Duration.ofSeconds(30)).GET().build(); var response = client.send(request, HttpResponse.BodyHandlers.ofString()); if (response.statusCode() != 200) { throw new IllegalStateException("HTTP " + response.statusCode() + ": " + response.body()); } String json = response.body().trim(); System.out.println(json.matches("\\[\\s\\]*") ? "No events match this request right now." : json); } } ``` ```bash java Main.java ``` -------------------------------- ### Install ws and run Node.js stream.mjs Source: https://parlay-api.com/docs/websocket/quickstart Install the 'ws' package and run the Node.js WebSocket client. Set the PARLAY_API_KEY environment variable before running. ```bash npm install ws # save the snippet below as stream.mjs, then: # PARLAY_API_KEY=pk_live_xxxx node stream.mjs ``` -------------------------------- ### Fetch MLB odds with ParlayAPI (Python SDK, curl, JavaScript, raw Python) Source: https://parlay-api.com/docs Quick start examples for fetching MLB odds from ParlayAPI. The Python SDK example installs the package and creates a client with your API key. The curl, JavaScript, and raw Python examples call the REST endpoint directly with the X-API-Key header. All require a valid API key; the free tier provides 1,000 credits per month. ```python pip install parlay-api from parlay_api import ParlayAPI client = ParlayAPI(api_key="YOUR_KEY") odds = client.odds("baseball_mlb", regions="us") ``` ```bash curl "https://parlay-api.com/v1/sports/baseball_mlb/odds?regions=us" \ -H "X-API-Key: YOUR_KEY" ``` ```javascript const r = await fetch( "https://parlay-api.com/v1/sports/baseball_mlb/odds?regions=us", { headers: { "X-API-Key": "YOUR_KEY" } } ); const odds = await r.json(); ``` ```python import requests r = requests.get( "https://parlay-api.com/v1/sports/baseball_mlb/odds", headers={"X-API-Key": "YOUR_KEY"}, params={"regions": "us"}, ) odds = r.json() ``` -------------------------------- ### Install parlay-api Python SDK Source: https://parlay-api.com/docs/sdks Install the public Python SDK version 0.3.2. Requires Python 3.10+ and no runtime dependencies. ```bash python -m pip install parlay-api==0.3.2 ``` -------------------------------- ### Futures Response Example Source: https://parlay-api.com/docs/response-shapes Example of a season-long market selection record. Includes sport_key, season, market_key, selection, and price. Note the absence of commence_time and line because futures do not have a single kickoff or over/under. ```json [ { "sport_key": "basketball_nba", "season": "2025-26", "market_key": "nba_championship_winner", "market_label": "NBA Championship Winner", "selection": "Boston Celtics", "source": "draftkings", "source_title": "DraftKings", "price": +450, "implied_prob": 0.1818, "snapshot_time": "2026-05-01T18:55:30Z" } ] ``` -------------------------------- ### X-Provider-State header example Source: https://parlay-api.com/docs/websocket Shows the shape of the X-Provider-State header returned with every /v1/* response, including the WebSocket upgrade response. Use it to decide per-request whether to trust a source's rows, route around degraded sources, or weight aggregates by freshness. The full spec is at the Provider State docs; an untruncated payload is also available at GET /v1/meta/provider-state. ```http X-Provider-State: {"ts":1778739733,"src":{"pinnacle":{"age_s":1.2,"role":"primary"}, "fanduel":{"age_s":12.8,"role":"primary"}, "caesars":{"age_s":null,"role":"offline"}, ...}} ``` -------------------------------- ### Sports endpoint response example Source: https://parlay-api.com/docs Response for GET /v1/sports. Lists all sport keys with at least one event in the last 24 hours. The `...` indicates additional entries. ```json [ { "key": "baseball_mlb", "group": "Baseball", "title": "MLB", "description": "Major League Baseball", "active": true, "has_outrights": false }, ... ] ``` -------------------------------- ### GET / Source: https://parlay-api.com/docs/swagger Endpoint to retrieve the root page. ```APIDOC ## [GET] / ### Description Retrieve the root page. ### Method GET ### Endpoint / ``` -------------------------------- ### GET /v1/sports/{sport_key}/player-ratings with sample JSON response Source: https://parlay-api.com/docs Request the market-implied player ratings endpoint for table tennis with a 30-day window and a minimum of 3 matches. The response includes rating metadata, drop counts, and a ratings array; the example shows the JSON response structure with one sample player entry. ```json GET /v1/sports/table_tennis/player-ratings?window_days=30&min_matches=3&apiKey=... { "sport_key": "table_tennis", "rating_kind": "market_implied", "rating_basis": "pregame_closing_lines", "rating_method": "iterative_elo_from_devigged_pregame_closing_moneylines", "window_days": 30, "data_window_start": "2026-08-06T06:00:00Z", "data_window_end": "2026-09-05T02:05:00Z", "min_matches": 3, "total_rated_players": 1036, "matches_used": 8750, "matches_dropped_inplay_only": 17259, "matches_dropped_one_sided": 71, "matches_dropped_implied_total_out_of_range": 0, "matches_priced_by_multiple_books": 168, "implied_total_bounds": [0.98, 1.3], "source_matches": 8750, "ratings": [ {"player": "Andrew Baggaley", "rating": 1662.8, "matches": 9, "implied_win_rate": 0.7092, "last_match_at": "2026-08-21T14:35:00Z"}, ... ] } ``` -------------------------------- ### Events endpoint response example Source: https://parlay-api.com/docs Response for GET /v1/sports/{sport_key}/events. Events are deduped by `canonical_event_id` (an MD5 of sport + date + sorted team names) so matchups with different team naming conventions collapse into one event. The `...` indicates additional entries. ```json [ { "id": "8b1f3a2c0e9d4...", "canonical_event_id": "ee78855a3bdd1019", "sport_key": "baseball_mlb", "sport_title": "MLB", "commence_time": "2026-05-01T19:35:00Z", "home_team": "New York Yankees", "away_team": "Kansas City Royals" }, ... ] ``` -------------------------------- ### GET /v1/sports/{sport_key}/live Source: https://parlay-api.com/docs Currently in-progress games with grouped book quotes. Sub-10s freshness on our in-play collectors. ```APIDOC ## GET /v1/sports/{sport_key}/live ### Description Currently in-progress games with grouped book quotes. Sub-10s freshness on our in-play collectors. ### Method GET ### Endpoint /v1/sports/{sport_key}/live ``` -------------------------------- ### GET /v1/sports/{sport_key}/live/sse Source: https://parlay-api.com/docs Persistent SSE connection that pushes each state change within ~50ms of the event. Starter+ tier required. ```APIDOC ## GET /v1/sports/{sport_key}/live/sse ### Description Persistent SSE connection. Server pushes each state change (point won, game won, set closed, goal, foul, pitch outcome, period change) within ~50ms of the event. Starter+ tier required. Use the standard `EventSource` API. The connection charge covers the initial snapshot plus streaming. Reconnects are billed as new connections. ### Method GET ### Endpoint /v1/sports/{sport_key}/live/sse ### Request Example ```js // JS const es = new EventSource('https://parlay-api.com/v1/sports/tennis/live/sse?match_id=...&apiKey=...'); es.addEventListener('initial_state', e => console.log('snap', JSON.parse(e.data))); es.addEventListener('pbp_event', e => console.log('event', JSON.parse(e.data))); ``` ``` -------------------------------- ### GET /v1/keys Source: https://parlay-api.com/docs/swagger Endpoint to list API keys. ```APIDOC ## [GET] /v1/keys ### Description List API keys. ### Method GET ### Endpoint /v1/keys ``` -------------------------------- ### GET /live Source: https://parlay-api.com/docs/swagger Endpoint to retrieve the live page. ```APIDOC ## [GET] /live ### Description Retrieve the live page. ### Method GET ### Endpoint /live ``` -------------------------------- ### Event-markets search response highlights Source: https://parlay-api.com/docs Example response from the event-markets search endpoint. Shows the query, credits charged (0), source summary with counts and max volumes, a market entry with source, event title, outcome, and yes bid/ask prices, and a clusters array with a note that prices are source-native and not blended. The response is a discovery lead, not automatic arb proof; settlement rules must be compared before acting on cross-venue price gaps. ```json { "query": "AJ Brown next team", "credits_charged": 0, "source_summary": { "kalshi": {"count": 10, "max_volume": 283989.29}, "novig": {"count": 4, "max_volume": 9458.94} }, "markets": [ { "source": "kalshi", "event_title": "A.J. Brown's Next Team", "outcome": "New England", "prices": {"yes_bid": 0.79, "yes_ask": 0.81} } ], "clusters": [ { "cluster_key": "aj brown next team", "sources": ["kalshi", "novig"], "note": "Candidate text match only. Prices remain source-native and are not blended." } ] } ``` -------------------------------- ### GET /v1/sports/{sport_key}/live/points Source: https://parlay-api.com/docs Returns current state for one match or all in-play matches for the sport. Free tier OK. ```APIDOC ## GET /v1/sports/{sport_key}/live/points ### Description Returns current state for one match (with `match_id`) or all in-play matches for the sport (omit `match_id`). Free tier OK. ### Method GET ### Endpoint /v1/sports/{sport_key}/live/points ### Parameters #### Query Parameters - **match_id** (string) - Optional - Single match. Omit for all in-play. ``` -------------------------------- ### Python SDK usage with ParlayAPI client Source: https://parlay-api.com/docs Install with `pip install parlay-api`. The SDK is a near drop-in replacement for the-odds-api's official Python clients, adding extension methods and built-in devig math helpers. The `devig` and `edge` methods make no network call. ```python from parlay_api import ParlayAPI client = ParlayAPI(api_key="YOUR_KEY") # TOA-compatible methods sports = client.sports() events = client.events("baseball_mlb") odds = client.odds("baseball_mlb", regions="us", markets=["h2h", "spreads"]) historical = client.historical_odds("baseball_mlb", date="2024-10-15") # Extensions props = client.props("baseball_mlb", markets=["player_total_bases"]) arbs = client.arbitrage("baseball_mlb", limit=20) consensus = client.consensus("baseball_mlb") # Devig math (no network call) fair_over, fair_under = ParlayAPI.devig(over_price=-110, under_price=-110) edge_pct = ParlayAPI.edge(book_price=-105, fair_prob=fair_over) # WebSocket URL builder ws_url = client.websocket_url("baseball_mlb") ``` -------------------------------- ### Query odds for baseball_mlb with regions, markets, and bookmakers (Python and curl) Source: https://parlay-api.com/docs Shows the Python client and curl request for the same odds query. Both target baseball_mlb with regions=us, markets h2h/spreads/totals, and bookmakers draftkings/fanduel/pinnacle. The Python example uses the client.odds method with list arguments; the curl example passes comma-separated values and requires an X-API-Key header. ```python odds = client.odds( "baseball_mlb", regions="us", markets=["h2h", "spreads", "totals"], bookmakers=["draftkings", "fanduel", "pinnacle"], ) ``` ```bash curl "https://parlay-api.com/v1/sports/baseball_mlb/odds?regions=us&markets=h2h,spreads,totals&bookmakers=draftkings,fanduel,pinnacle" \ -H "X-API-Key: YOUR_KEY" ``` -------------------------------- ### GET /v1/sports/{sport_key}/live/period_markets Source: https://parlay-api.com/docs In-game spreads, totals, and h2h for sub-game periods. Includes alternate lines. Open to all tiers. ```APIDOC ## GET /v1/sports/{sport_key}/live/period_markets ### Description In-game spreads, totals, and h2h for sub-game periods: 1st half, 2nd half, quarters (NBA, WNBA, NFL, NCAAF), hockey periods (NHL), or first 5 / first 7 innings (MLB). Includes alternate lines: a single Q1 spread query for one NBA game returns ~8 to 10 alt lines. Open to all tiers (Free can run ~500 test calls; continuous high-frequency polling needs Pro or Business). Latency: 1 to 4 seconds (vs 30s+ on the-odds-api). ### Method GET ### Endpoint /v1/sports/{sport_key}/live/period_markets ### Parameters #### Query Parameters - **period** (string) - Optional - FT, 1H, 2H, Q1, Q2, Q3, Q4, OT, P1, P2, P3, F5, F7, or 'all' - **match_id** (string) - Optional - Single match - **source** (string) - Optional - Source book - **market** (string) - Optional - spread, total, h2h ### Request Example ``` GET /v1/sports/basketball_nba/live/period_markets?period=Q1&market=spread&apiKey=... ``` ### Response Example ```json { "sport_key": "basketball_nba", "period": "Q1", "market": "spread", "count": 18, "results": [ {"source":"pinnacle", "home_team":"Oklahoma City Thunder", "away_team":"Los Angeles Lakers", "period_key":"Q1", "market":"spread", "side":"home", "line":-3.5, "price":-144, "age_seconds":1, ...}, {"source":"pinnacle", "side":"away", "line":3.5, "price":120, ...}, ...alt lines from -2.5 through -6.0... ] } ``` ``` -------------------------------- ### GET /v1/sports/{sport_key}/live/period_markets/sources Source: https://parlay-api.com/docs Returns which books have which periods active right now (last 10 min). Useful for client-side discovery. ```APIDOC ## GET /v1/sports/{sport_key}/live/period_markets/sources ### Description Returns which books have which periods active right now (last 10 min). Useful for client-side discovery. ### Method GET ### Endpoint /v1/sports/{sport_key}/live/period_markets/sources ``` -------------------------------- ### Stream odds updates with ParlayAPI Source: https://parlay-api.com/docs Python example using ParlayAPI and websockets to stream odds updates. Requires a valid API key and the parlay_api package. ```python from parlay_api import ParlayAPI import asyncio, json import websockets async def stream(): client = ParlayAPI(api_key="YOUR_KEY") url = client.websocket_url("baseball_mlb") async with websockets.connect(url) as ws: async for raw in ws: frame = json.loads(raw) if frame["type"] == "odds_update": for row in frame["data"]: print(row["bookmaker"], row["player"], row["over_price"], row["under_price"]) asyncio.run(stream()) ``` -------------------------------- ### GET /v1/sports Source: https://parlay-api.com/docs List all sport keys with at least one event in the last 24 hours. ```APIDOC ## GET /v1/sports ### Description List all sport keys with at least one event in the last 24 hours. ### Method GET ### Endpoint /v1/sports ### Response #### Success Response (200) - **key** (string) - Sport key - **group** (string) - Sport group - **title** (string) - Sport title - **description** (string) - Sport description - **active** (boolean) - Whether the sport is active - **has_outrights** (boolean) - Whether the sport has outrights #### Response Example ``` [ { "key": "baseball_mlb", "group": "Baseball", "title": "MLB", "description": "Major League Baseball", "active": true, "has_outrights": false }, ... ] ``` ``` -------------------------------- ### GET /v1/sports/{sport_key}/live/period_markets Source: https://parlay-api.com/docs Retrieves period markets for live events, such as first half or first quarter markets. Use the `period` and `market` query parameters to specify the period and market. ```APIDOC ## GET /v1/sports/{sport_key}/live/period_markets ### Description Retrieves period markets for live events, such as first half or first quarter markets. Use the `period` and `market` query parameters to specify the period and market. ### Method GET ### Endpoint /v1/sports/{sport_key}/live/period_markets ### Parameters #### Path Parameters - **sport_key** (string) - Required - The sport key. #### Query Parameters - **period** (string) - Required - Period key, e.g., `1H` for first half. - **market** (string) - Required - Market key, e.g., `h2h`. - **regions** (comma-separated string) - Optional - Regions to include. - **bookmakers** (comma-separated string) - Optional - Bookmaker keys. - **oddsFormat** (enum) - Optional - `american` (default) or `decimal`. - **dateFormat** (enum) - Optional - `iso` (default) or `unix`. ### Request Example ``` curl "https://parlay-api.com/v1/sports/baseball_mlb/live/period_markets?period=1H&market=h2h®ions=us" \ -H "X-API-Key: YOUR_KEY" ``` ### Response #### Success Response (200) - **events** (array) - List of events with period markets. - **event.id** (string) - Event ID. - **event.bookmakers** (array) - List of bookmakers. - **bookmaker.markets** (array) - List of markets. - **market.key** (string) - Market key. - **market.outcomes** (array) - List of outcomes. #### Response Example ```json { "events": [ { "id": "event123", "bookmakers": [ { "key": "draftkings", "markets": [ { "key": "h2h_1st_half", "outcomes": [ { "name": "Team A", "price": -110 } ] } ] } ] } ] } ``` ### Error Handling - **400 Bad Request** - Invalid parameters. - **401 Unauthorized** - Missing or invalid API key. - **404 Not Found** - Sport key not found. - **429 Too Many Requests** - Rate limit exceeded. - **500 Internal Server Error** - Server error. ``` -------------------------------- ### GET /v1/sports/{sport_key}/events Source: https://parlay-api.com/docs List events for a sport. Deduped by canonical_event_id so the same matchup from books with different team naming conventions collapses into one event. ```APIDOC ## GET /v1/sports/{sport_key}/events ### Description List events for a sport. Deduped by `canonical_event_id` (an MD5 of sport + date + sorted team names) so the same matchup from books with different team naming conventions collapses into one event. ### Method GET ### Endpoint /v1/sports/{sport_key}/events ### Parameters #### Query Parameters - **commenceTimeFrom** (ISO 8601 string) - Optional - Filter to events starting after this time - **commenceTimeTo** (ISO 8601 string) - Optional - Filter to events ending before this time - **dateFormat** (enum) - Optional - `iso` (default) or `unix` ### Response #### Success Response (200) - **id** (string) - Event ID - **canonical_event_id** (string) - Canonical event ID - **sport_key** (string) - Sport key - **sport_title** (string) - Sport title - **commence_time** (string) - Event start time - **home_team** (string) - Home team name - **away_team** (string) - Away team name #### Response Example ``` [ { "id": "8b1f3a2c0e9d4...", "canonical_event_id": "ee78855a3bdd1019", "sport_key": "baseball_mlb", "sport_title": "MLB", "commence_time": "2026-05-01T19:35:00Z", "home_team": "New York Yankees", "away_team": "Kansas City Royals" }, ... ] ``` ``` -------------------------------- ### GET /v1/markets Source: https://parlay-api.com/docs Retrieves metadata about all catalogued markets, including the `served_by` field that indicates which endpoint serves each market. ```APIDOC ## GET /v1/markets ### Description Retrieves metadata about all catalogued markets, including the `served_by` field that indicates which endpoint serves each market. ### Method GET ### Endpoint /v1/markets ### Parameters None. ### Request Example ``` curl "https://parlay-api.com/v1/markets" \ -H "X-API-Key: YOUR_KEY" ``` ### Response #### Success Response (200) - **markets** (array) - List of markets. - **market.key** (string) - Market key. - **market.served_by** (string) - Endpoint that serves this market, e.g., `/v1/sports/{sport_key}/odds`. #### Response Example ```json { "markets": [ { "key": "h2h", "served_by": "/v1/sports/{sport_key}/odds" } ] } ``` ### Error Handling - **401 Unauthorized** - Missing or invalid API key. - **429 Too Many Requests** - Rate limit exceeded. - **500 Internal Server Error** - Server error. ``` -------------------------------- ### GET /v1/meta/regions Source: https://parlay-api.com/docs Retrieves metadata about regions, including the per-region book lists and book statuses. ```APIDOC ## GET /v1/meta/regions ### Description Retrieves metadata about regions, including the per-region book lists and book statuses. ### Method GET ### Endpoint /v1/meta/regions ### Parameters None. ### Request Example ``` curl "https://parlay-api.com/v1/meta/regions" \ -H "X-API-Key: YOUR_KEY" ``` ### Response #### Success Response (200) - **regions** (array) - List of regions. - **region.key** (string) - Region key. - **region.active_books** (array) - Books that have written prices in the last 24 hours. - **region.books** (array) - All books the region carries, including those with no current prices. - **book.key** (string) - Bookmaker key. - **book.status** (string) - Status: `active`, `paused`, `retired`, `not_yet_integrated`. - **book.last_write_age** (integer) - Age of the last price write in seconds. #### Response Example ```json { "regions": [ { "key": "us", "active_books": ["draftkings", "fanduel"], "books": [ { "key": "draftkings", "status": "active", "last_write_age": 120 } ] } ] } ``` ### Error Handling - **401 Unauthorized** - Missing or invalid API key. - **429 Too Many Requests** - Rate limit exceeded. - **500 Internal Server Error** - Server error. ``` -------------------------------- ### GET /v1/historical/sports/{sport_key}/period_markets Source: https://parlay-api.com/docs Retrieves historical period markets for a given sport. Similar to the live period markets endpoint but for historical data. ```APIDOC ## GET /v1/historical/sports/{sport_key}/period_markets ### Description Retrieves historical period markets for a given sport. Similar to the live period markets endpoint but for historical data. ### Method GET ### Endpoint /v1/historical/sports/{sport_key}/period_markets ### Parameters #### Path Parameters - **sport_key** (string) - Required - The sport key. #### Query Parameters - **period** (string) - Required - Period key, e.g., `1H` for first half. - **market** (string) - Required - Market key, e.g., `h2h`. - **regions** (comma-separated string) - Optional - Regions to include. - **bookmakers** (comma-separated string) - Optional - Bookmaker keys. - **oddsFormat** (enum) - Optional - `american` (default) or `decimal`. - **dateFormat** (enum) - Optional - `iso` (default) or `unix`. ### Request Example ``` curl "https://parlay-api.com/v1/historical/sports/baseball_mlb/period_markets?period=1H&market=h2h®ions=us" \ -H "X-API-Key: YOUR_KEY" ``` ### Response #### Success Response (200) - **events** (array) - List of events with period markets. - **event.id** (string) - Event ID. - **event.bookmakers** (array) - List of bookmakers. - **bookmaker.markets** (array) - List of markets. - **market.key** (string) - Market key. - **market.outcomes** (array) - List of outcomes. #### Response Example ```json { "events": [ { "id": "event123", "bookmakers": [ { "key": "draftkings", "markets": [ { "key": "h2h_1st_half", "outcomes": [ { "name": "Team A", "price": -110 } ] } ] } ] } ] } ``` ### Error Handling - **400 Bad Request** - Invalid parameters. - **401 Unauthorized** - Missing or invalid API key. - **404 Not Found** - Sport key not found. - **429 Too Many Requests** - Rate limit exceeded. - **500 Internal Server Error** - Server error. ``` -------------------------------- ### GET /v1/inplay/arbs Source: https://parlay-api.com/docs Cross-book arbs detected during live games. Updated every 5 seconds. Pairs with the WebSocket: subscribers receive `{"type":"arb_flagged"}` frames the moment a new arb is found. ```APIDOC ## GET /v1/inplay/arbs ### Description Cross-book arbs detected during live games. Updated every 5 seconds. Pairs with the WebSocket: subscribers receive `{"type":"arb_flagged"}` frames the moment a new arb is found. ### Method GET ### Endpoint /v1/inplay/arbs ### Response #### Success Response (200) - **type** (string) - The type of frame, e.g., "arb_flagged". #### Response Example { "type": "arb_flagged" } ``` -------------------------------- ### GET /v1/sports/{sport_key}/props Source: https://parlay-api.com/docs Retrieves prop markets for a given sport, such as team totals, btts, correct score, double chance, draw no bet, MMA specials, and horse racing keys. ```APIDOC ## GET /v1/sports/{sport_key}/props ### Description Retrieves prop markets for a given sport, such as team totals, btts, correct score, double chance, draw no bet, MMA specials, and horse racing keys. Use the `markets` query parameter to specify the prop keys. ### Method GET ### Endpoint /v1/sports/{sport_key}/props ### Parameters #### Path Parameters - **sport_key** (string) - Required - The sport key. #### Query Parameters - **markets** (comma-separated string) - Required - Prop market keys, e.g., `team_totals,btts`. - **regions** (comma-separated string) - Optional - Regions to include. - **bookmakers** (comma-separated string) - Optional - Bookmaker keys. - **oddsFormat** (enum) - Optional - `american` (default) or `decimal`. - **dateFormat** (enum) - Optional - `iso` (default) or `unix`. ### Request Example ``` curl "https://parlay-api.com/v1/sports/baseball_mlb/props?markets=team_totals,btts®ions=us" \ -H "X-API-Key: YOUR_KEY" ``` ### Response #### Success Response (200) - **events** (array) - List of events with prop markets. - **event.id** (string) - Event ID. - **event.bookmakers** (array) - List of bookmakers. - **bookmaker.markets** (array) - List of markets. - **market.key** (string) - Market key. - **market.outcomes** (array) - List of outcomes. #### Response Example ```json { "events": [ { "id": "event123", "bookmakers": [ { "key": "draftkings", "markets": [ { "key": "team_totals", "outcomes": [ { "name": "Over 8.5", "price": -110 } ] } ] } ] } ] } ``` ### Error Handling - **400 Bad Request** - Invalid parameters. - **401 Unauthorized** - Missing or invalid API key. - **404 Not Found** - Sport key not found. - **429 Too Many Requests** - Rate limit exceeded. - **500 Internal Server Error** - Server error. ``` -------------------------------- ### GET /v1/sports/{sport_key}/live/book_latency Source: https://parlay-api.com/docs Per-book lag relative to the primary PBP feed. Returns each book's effective latency in seconds. Pro+ tier. ```APIDOC ## GET /v1/sports/{sport_key}/live/book_latency ### Description Per-book lag relative to our primary PBP feed. Returns each book's effective latency in seconds. Pro+ tier. Use case: arb scanners check this every few seconds and flag matches where a specific book has stale lines (positive lag > 5s typically means an exploitable window). ### Method GET ### Endpoint /v1/sports/{sport_key}/live/book_latency ### Response Example ```json { "sport_key": "baseball_mlb", "results": [ {"match": "Yankees vs Rangers", "book": "fanduel", "lag_seconds": 7.8, ...}, {"match": "Yankees vs Rangers", "book": "draftkings","lag_seconds": 1.2, ...}, {"match": "Yankees vs Rangers", "book": "caesars", "lag_seconds": 4.0, ...} ] } ``` ``` -------------------------------- ### SSE heartbeat comment example Source: https://parlay-api.com/docs/websocket/sse This is an example SSE comment heartbeat sent every heartbeat_s seconds (default 5) to keep the connection alive. Comments start with ':' and are ignored by spec-compliant SSE parsers, so no client code is needed to handle them. ```text : heartbeat 1715587205 ``` -------------------------------- ### GET /v1/sse/hot/{sport_key} Source: https://parlay-api.com/docs This endpoint provides a Server-Sent Events (SSE) stream for real-time odds updates. It supports filtering by bookmakers, kinds, markets, and event ID, and includes an initial state frame followed by live updates with a configurable heartbeat. ```APIDOC ## GET /v1/sse/hot/{sport_key} ### Description EventSource-compatible HTTP stream for enterprise hot paths. It sends a connection frame, source freshness, initial state, then live updates with a 5-second heartbeat. ### Method GET ### Endpoint https://parlay-api.com/v1/sse/hot/{sport_key} ### Parameters #### Path Parameters - **sport_key** (string) - Required - The sport key, e.g., `baseball_mlb`. #### Query Parameters - **apiKey** (string) - Required - Your API key. - **bookmakers** (string) - Optional - Comma-separated list of bookmaker keys, e.g., `fanduel,pinnacle,caesars`. - **kinds** (string) - Optional - Comma-separated list of kinds, e.g., `game,prop`. - **markets** (string) - Optional - Comma-separated list of prop market keys, e.g., `player_points,player_rebounds`. - **event_id** (string) - Optional - Single event filter, e.g., `2026-05-07_Team_A_Team_B`. - **heartbeat_s** (integer) - Optional - Heartbeat interval in seconds, 1 to 30, default 5. - **limit** (integer) - Optional - Rows in the `initial_state` frame, 1 to 1000, default 500. - **max_age_s** (integer) - Optional - Drop `initial_state` rows older than this, 1 to 3600, default 600. ### Request Example ``` const es = new EventSource( "https://parlay-api.com/v1/sse/hot/baseball_mlb?apiKey=YOUR_KEY&bookmakers=fanduel,pinnacle&kinds=game&heartbeat_s=5" ); es.onmessage = (ev) => { const msg = JSON.parse(ev.data); if (msg.type === "odds_update") console.log(msg.data); }; ``` ### Response #### Success Response (200) - **type** (string) - The message type, e.g., `hot_feed_status`, `odds_update`. - **data** (object) - The message payload. #### Response Example ``` # Python quickstart import json, requests url = "https://parlay-api.com/v1/sse/hot/baseball_mlb" params = { "apiKey": "YOUR_KEY", "bookmakers": "fanduel,pinnacle", "kinds": "game", "heartbeat_s": 5, } with requests.get(url, params=params, stream=True, timeout=60) as r: r.raise_for_status() for line in r.iter_lines(decode_unicode=True): if line and line.startswith("data: "): msg = json.loads(line[6:]) if msg["type"] in ("hot_feed_status", "odds_update"): print(msg) ``` ``` -------------------------------- ### GET /v1/sports/{sport_key}/line-movement Source: https://parlay-api.com/docs Retrieves time-series price history for one event, grouped into a series per (source, player, market_key, line). Use it for CLV and steam detection. ```APIDOC ## GET /v1/sports/{sport_key}/line-movement ### Description Time-series price history for one event, grouped into a series per `(source, player, market_key, line)`. Use it for CLV and steam detection. ### Method GET ### Endpoint /v1/sports/{sport_key}/line-movement ### Parameters #### Path Parameters - **sport_key** (string) - Required - The sport key for the event. #### Query Parameters - **eventId** (string) - Required - Accepts the `canonical_event_id` or the `event_id` from a `/props`, `/odds` or `/events` row. `event_id` is an accepted alias. - **player** (string) - Optional - Partial-match player name. Strongly recommended: it is what keeps a busy event inside the row cap below. - **market** (string) - Optional - Market key, expanded to its synonym group. `market_key` is an accepted alias. - **bookmaker** (string) - Optional - Single book. `source` is an accepted alias. - **hours** (integer) - Optional - Lookback window, default 24. `window_minutes` (1-10080) is an accepted alias. ### Response #### Success Response (200) - **series** (array) - A series per `(source, player, market_key, line)`. Each series includes `matched_by`, `home_team`, `away_team`, `over_movement`, `over_price`, `under_price`, `opening_over`, `current_over`, and `line` fields as applicable. - **X-Line-Movement-Row-Cap** (header) - The row cap value. - **X-Line-Movement-Truncated** (header) - Set to `1` when the row cap bound. #### Response Example { "series": [ { "source": "string", "player": "string", "market_key": "string", "line": "number", "matched_by": "team" | "player", "home_team": "string", "away_team": "string", "over_movement": "number", "over_price": "number", "under_price": "number", "opening_over": "number", "current_over": "number" } ] } ``` -------------------------------- ### GET /v1/sports/{sport_key}/odds Source: https://parlay-api.com/docs Retrieves real-time odds for a given sport from 30+ sources in a single call. Supports regions parameter to filter odds by region. ```APIDOC ## [GET] /v1/sports/{sport_key}/odds ### Description Retrieves real-time odds for a given sport from 30+ sources in a single call. Supports regions parameter to filter odds by region. ### Method GET ### Endpoint https://parlay-api.com/v1/sports/{sport_key}/odds ### Parameters #### Path Parameters - **sport_key** (string) - Required - The sport key, e.g., baseball_mlb. #### Query Parameters - **regions** (string) - Optional - Comma-separated list of regions, e.g., us. ### Request Example ``` curl "https://parlay-api.com/v1/sports/baseball_mlb/odds?regions=us" \ -H "X-API-Key: YOUR_KEY" ``` ### Response #### Success Response (200) Returns odds data in JSON format. #### Response Example ```json { "odds": [] } ``` ``` -------------------------------- ### GET /v1/sports/{sport_key}/arbitrage Source: https://parlay-api.com/docs Two-leg arbitrage opportunities across books on the same prop, with optimal stake split and projected profit. DFS books excluded. Profit cap 15%. ```APIDOC ## GET /v1/sports/{sport_key}/arbitrage ### Description Two-leg arbs across books on the same prop, with optimal stake split and projected profit. DFS books excluded. Profit cap 15% (anything higher is almost certainly stale or mis-paired data). ### Method GET ### Endpoint /v1/sports/{sport_key}/arbitrage ### Parameters #### Query Parameters - **limit** (int) - Optional - Max arbs returned, default 50 - **min_profit_pct** (float) - Optional - Min profit threshold, default 0.5% ``` -------------------------------- ### Query period markets for Q1 spread Source: https://parlay-api.com/docs Query period markets for a specific period and market. The response includes a count and results with source, teams, period key, market, side, line, price, and age_seconds. The example shows a Q1 spread query for an NBA game returning 18 results with alt lines from -2.5 through -6.0. ```http GET /v1/sports/basketball_nba/live/period_markets?period=Q1&market=spread&apiKey=... { "sport_key": "basketball_nba", "period": "Q1", "market": "spread", "count": 18, "results": [ {"source":"pinnacle", "home_team":"Oklahoma City Thunder", "away_team":"Los Angeles Lakers", "period_key":"Q1", "market":"spread", "side":"home", "line":-3.5, "price":-144, "age_seconds":1, ...}, {"source":"pinnacle", "side":"away", "line":3.5, "price":120, ...}, ...alt lines from -2.5 through -6.0... ] } ```