OSopensport.dev
Documentation

Opensport

A provider-agnostic, agent-friendly open-source framework for sports data, odds, and position management.

What is Opensport?

Opensport gives AI agents and developers a complete toolkit for interacting with sports markets. It ships in Python (for strategy logic and modelling) and TypeScript (for API layers and real-time feeds), with the same concepts and structure across both.

The framework is built around four clean layers, each an abstract base class you can swap independently:

  • Core models: Event, Market, OddsSnapshot, BetIntent, Position
  • Provider: fetches events and odds from any data source
  • Executor: places positions, simulated or live
  • Agent: your strategy logic, wired to provider + executor

Key capabilities

CapabilityHow
get_events()Pull upcoming or live events, filtered by sport, competition, or status
find_events(team=)Search events by team or player name (case-insensitive substring)
event.summary()Compact one-line string for any event, ready for LLM context windows
get_odds()Fetch a full OddsSnapshot: all markets, all outcomes, implied probs
get_value_bets()Scan all events and return positive-EV outcomes sorted by edge
place(intent)Execute a BetIntent against the Simulator or a live exchange
settle_event()Bulk-settle all positions on an event by outcome label
agent.run()Full evaluate loop: fetch, analyse, place, repeat

Supported sports

Opensport is sport-agnostic. The Event.sport field is a free-form string, so any sport works out of the box. Standard slugs used throughout the codebase: soccer, nfl, nba, nhl, tennis, cricket, mma, horse_racing, rugby_union.

Supported market types

A comprehensive set of MarketType slugs covers most use cases out of the box, including winner/moneyline, point spread, Asian handicap, totals/over-under, BTTS, correct score, player props (points, rebounds, passing yards, touchdowns), and race markets (win, place, each-way). A CUSTOM slug is available for provider-specific markets.

Next steps

The fastest path to your first position is the Quickstart guide. If you want to understand the full system design before diving in, read the Architecture overview.