Skip to main content
Use the official libraries to call Odds-API.io in a few lines. Every SDK covers the full v3 REST API, including golf outrights, closing lines, odds summaries, settlement and bookmaker id mappings, and keeps the server’s own error messages.

Official packages

Every package needs an API key from a paid plan. Get one at odds-api.io/pricing and set it as the ODDS_API_KEY environment variable:

Node.js SDK

TypeScript-first client with an OddsWebSocket helper. ESM and CommonJS, Node.js 18+.

Python SDK

Sync and async clients, typed responses, pandas and WebSocket extras. Python 3.8+.

R package

Every function returns a tidy data frame. On CRAN as oddsapiio.

Command-line tool

odds-api in your terminal: events, odds, value bets and arbitrage, as tables or JSON.

MCP Server

33 tools for Claude, Cursor, VS Code and other MCP clients.

Node.js / TypeScript

What’s in 1.5.1
  • A method for every public v3 endpoint: events, odds, odds summary (getOddsSummary, getOddsSummaryMulti), movements, value bets, arbitrage, dropping odds, historical events and odds, closing lines (getClosingLines, iterateClosingLines), settlement (getSettlements, gradeBets), golf outrights (getOutrights, getOutrightOdds, getOutrightResults), participants, markets (getMarkets) and bookmaker id mappings (getMappings, iterateMappings)
  • OddsWebSocket: real-time odds, scores and status, reconnecting from the last seq
  • Async iterators for paginated endpoints and pollUpdatedOdds for /odds/updated
  • Typed errors that keep the server’s message: ForbiddenError (with isAddOnRequired), RateLimitError (with retryAfter), NotFoundError and more, plus optional retries with backoff

Quick start

CommonJS works the same way: const { OddsAPIClient } = require('odds-api-io');. Comma-separated parameters accept a string or an array.

Node.js SDK on GitHub

Full method table, WebSocket helper, examples and migration notes.

Python

What’s in 1.2.0
  • Full v3 coverage: get_outrights, get_outright_odds, get_outright_results, get_closing_lines / iter_closing_lines, get_odds_summary, historical events and odds, get_settlements, grade_bets and get_mappings
  • Sync OddsAPIClient and async AsyncOddsAPIClient with the same methods
  • [pandas] extra: DataFrames for events, odds, closing lines and outright odds
  • [ws] extra: odds_api.ws.OddsStream, an async iterator that reconnects and resumes from the last sequence number
  • Typed errors that keep the server’s message, including AddOnRequiredError and RateLimitError (with retry_after), and optional retries (max_retries)

Quick start

Async client

Python SDK on GitHub

Full method reference, notebooks and examples.

R

What’s in 0.2.0
  • Every function returns a tidy data frame, one row per price line
  • Odds, multi-event odds, oa_odds_updated(), movements and oa_odds_summary()
  • Value bets, arbitrage and dropping odds
  • Historical events and odds, plus oa_closing_lines() for a whole season in one sweep
  • Settlement and grading (oa_settlements(), oa_grade())
  • Golf outrights (oa_outrights(), oa_outright_odds(), oa_outright_results()) and id mappings (oa_mappings())

R package on GitHub

Function reference and examples.

Golf outrights

Outrights are a paid add-on: PGA Tour, DP World Tour, LIV Golf and the majors. A key without the add-on gets a 403 whose message links to the billing page; the SDKs raise it as ForbiddenError (isAddOnRequired) in Node.js and AddOnRequiredError in Python. See the Outrights guide for the markets.

Closing lines

Closing lines for every settled event across up to 10 leagues, up to 366 days per request (paid plans). The SDK iterators page through the results for you. See the Historical guide for the fields.

Command-line tool

odds-api-cli puts the API in your terminal. It is built on the Node.js SDK.
Commands: sports, bookmakers, events, odds, value-bets and arbitrage. Add --json for the raw response. See the CLI guide for every option and sample output.

MCP Server (AI tools)

Use Odds-API.io from Claude, Cursor, VS Code and other MCP clients. Version 1.8.1 has 33 tools covering every public v3 REST endpoint, including list_outrights, get_outright_odds, get_outright_results, get_closing_lines, get_odds_summary, search_historical_events, get_mappings and get_usage. Every odds tool takes a markets filter, and the package ships an agent guide (SKILL.md) with call order, caching and quota handling. The MCP server page has setup for every client and example prompts.

Claude Code

Claude Desktop, Cursor and VS Code

Add to claude_desktop_config.json (~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows) or .cursor/mcp.json:
VS Code uses the same block under "servers" in .vscode/mcp.json.

Docker

The server is also listed in the MCP registry as io.github.odds-api-io/odds-api-mcp-server.

MCP server on GitHub

Full tool list, prompts and resources.

Error handling

Every SDK keeps the server’s own error message, which often says exactly what to fix.

WebSocket

Both SDKs ship a WebSocket client that tracks seq and resumes after a drop. Take a REST snapshot with includeSeq=true, then stream from that point. See the WebSocket guide for message types.
Need an SDK in another language? Let us know at hello@odds-api.io