API Reference

Complete REST API documentation for integrating the SportsBet Pro sportsbook platform. Place bets, manage sessions, fetch live odds, and embed widgets programmatically.

https://your-domain.com/api/provider

Authentication

API Key Authentication

All API requests must include your client_key parameter. For authenticated endpoints, pass the session token obtained from the provider session endpoint. Generate API keys from the Client Portal under Developer → API Keys.

Example// Include client key in every request GET /api/provider/session?client=your_client_key&token=user_session_token

Base URL

All API endpoints are relative to your deployment domain. Replace your-domain.com with your actual server address.

Endpoints

POST /api/provider/place-bet

Place a new bet with one or more selections. Returns a booking confirmation with a unique booking code.

Request Body

ParameterTypeRequiredDescription
clientstringRequiredYour client key
tokenstringOptionalSession token for authenticated users
currencystringRequiredCurrency code (e.g., USD, EUR, TND)
stakenumberRequiredBet stake amount
total_oddsnumberRequiredCombined odds for all selections
selectionsarrayRequiredArray of selection objects
selections[].event_idintegerRequiredEvent identifier
selections[].marketstringRequiredMarket type (e.g., match_winner)
selections[].outcomestringRequiredOutcome key (e.g., home, draw, away)
selections[].oddsnumberRequiredOdds value for this selection

Example Request

JSON{ "client": "your_client_key", "currency": "USD", "stake": 50.00, "total_odds": 2.45, "selections": [ { "event_id": 142, "market": "match_winner", "outcome": "home", "odds": 2.45 } ] }

Example Response

200 OK{ "success": true, "booking": { "booking_code": "BOOK-A1B2C3D4", "client": "your_client_key", "currency": "USD", "stake": 50.00, "total_odds": 2.45, "potential_win": 122.50, "selections": 1, "created_at": "2026-04-08T15:30:00Z" } }
GET /api/provider/session

Validate a user session token and retrieve the user's balance and authentication status.

Query Parameters

ParameterTypeRequiredDescription
clientstringRequiredYour client key
tokenstringRequiredSession token to validate

Example Response (Authenticated)

200 OK{ "authenticated": true, "user": { "id": "user_12345", "name": "John Doe" }, "balance": 1250.00, "currency": "USD" }

Example Response (Guest)

200 OK{ "authenticated": false, "user": null, "balance": 0, "currency": "USD" }
GET /api/provider/my-bets

Retrieve the bet history for a specific user. Returns recent bookings with status, stake, and payout.

Query Parameters

ParameterTypeRequiredDescription
clientstringRequiredYour client key
tokenstringRequiredUser session token

Example Response

200 OK{ "bets": [ { "booking_code": "BOOK-A1B2C3D4", "stake": 50.00, "total_odds": 2.45, "potential_win": 122.50, "status": "booked", "selections": [ /* ... */ ], "placed_at": "2026-04-08T15:30:00Z" } ] }
GET /widget/sportsbook/odds-feed

Retrieve the current odds feed with all sports, leagues, events, and markets. Used for live odds updates.

Query Parameters

ParameterTypeRequiredDescription
clientstringRequiredYour client key
sportstringOptionalFilter by sport key (e.g., football)

Response Format

Returns an array of sports, each containing leagues and events with current odds values.

GET /widget/sportsbook

Embed the sportsbook widget as an iframe. The widget renders a complete betting interface themed to your brand.

Query Parameters

ParameterTypeRequiredDescription
clientstringRequiredYour client key
tokenstringOptionalSession token for authenticated users
sportstringOptionalDefault sport (default: football)

Embed Code

HTML<!-- Embed sportsbook widget --> <iframe src="https://your-domain.com/widget/sportsbook?client=YOUR_KEY" width="100%" height="800" frameborder="0" allow="clipboard-write" ></iframe>

Webhooks

Configure a webhook URL in your client settings to receive real-time event notifications. All webhook payloads are POST requests with JSON body.

Events

EventDescription
BOOKING_CREATEDFired when a new bet is placed
BOOKING_SETTLEDFired when a booking is settled (won/lost/void)

Webhook Payload

POST{ "event": "BOOKING_CREATED", "timestamp": "2026-04-08T15:30:00Z", "data": { "booking_code": "BOOK-A1B2C3D4", "client_key": "your_client_key", "stake": 50.00, "status": "booked" } }

Error Handling

All errors return a consistent JSON structure with an error message and appropriate HTTP status code.

Error Response{ "success": false, "error": "Validation failed", "errors": { "stake": ["The stake field is required."] } }

HTTP Status Codes

CodeMeaning
200Success
400Bad Request — invalid parameters
401Unauthorized — invalid API key or session
404Resource not found
422Validation error
429Rate limit exceeded
500Internal server error

Rate Limits

API requests are rate-limited to ensure fair usage and platform stability.

EndpointLimit
POST /place-bet10 requests per second
GET /session60 requests per minute
GET /odds-feed30 requests per minute

Ready to Integrate?

Get your API key and start building in minutes.