Getting Started¶
Installation¶
Install oddsblaze using uv:
Or with pip:
Configuration¶
You need an API key from oddsblaze.com.
Price formats: american (default), decimal, fractional, probability, malaysian, indonesian, hong_kong
You can also override price format per-request:
from oddsblaze import OddsblazeClient, PriceFormat
client = OddsblazeClient()
odds = client.get_odds("draftkings", "nfl", price=PriceFormat.DECIMAL)
Basic Usage¶
from oddsblaze import OddsblazeClient
client = OddsblazeClient()
# Get NFL odds from DraftKings
odds = client.get_odds("draftkings", "nfl")
for event in odds.events:
print(f"{event.teams.away.name} @ {event.teams.home.name}")
for odd in event.odds:
print(f" {odd.name}: {odd.price}")
Error Handling¶
The SDK raises specific exceptions for API errors:
from oddsblaze import (
OddsblazeClient,
OddsblazeError,
AuthenticationError,
InvalidMarketError,
EventNotFoundError,
PlayerNotFoundError,
)
client = OddsblazeClient()
try:
result = client.grade_bet("invalid-id")
except EventNotFoundError:
print("Event not found")
except OddsblazeError as e:
print(f"API error: {e.message}")