Developer

Examples

Use-case recipes for building with the REST API and WebSocket stream. Copy a snippet, swap in your key, and run it.

Odds

Build a live event board

REST

Populate a schedule, let users open a match, then load the latest odds for their selected bookmaker set.

/sports/competitions/events/events/{id}/odds
curl "/api/v1/events?sport=football&bookmakers=bet365,unibet&limit=25" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"

Odds

Power a best-price betting slip

REST

Resolve the best current price for a market, period, line, and list of bookmakers before a user places a bet elsewhere.

/events/{id}/odds/best
curl "/api/v1/events/evt_123/odds/best?market=moneyline&period=full_time&bookmakers=bet365,unibet" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"

Streaming

Watch odds movement with WebSocket

WebSocket

Stream odds changes into a trading screen or worker without polling. REST + WebSocket plans allow one active socket per API key.

/ws/odds
import WebSocket from 'ws'

const ws = new WebSocket('wss://photonodds.com/api/v1/ws/odds?bookmakers=bet365,unibet', {
  headers: { 'X-API-Key': process.env.PHOTONODDS_API_KEY },
})

ws.on('message', (raw) => {
  const message = JSON.parse(raw.toString())
  if (message.type === 'odds_changes') console.log(message.cursor, message.data)
})

Odds

Trigger line-movement alerts

REST

Poll recent changes for watched books and compare each update with your last stored price.

/odds/changes
curl "/api/v1/odds/changes?market=moneyline&bookmakers=bet365&limit=100" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"

Odds

Backfill a model with odds history

REST

Replay how a selection moved before kickoff for model calibration, pricing research, or post-match review.

/events/{id}/odds/history
curl "/api/v1/events/evt_123/odds/history?bookmaker=bet365&market=moneyline&outcome=home&limit=200" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"

EV+

Rank EV+ opportunities

REST

Feed a value dashboard or alert queue filtered to the books and markets your users can actually act on.

/ev-plus
curl "/api/v1/ev-plus?sport=football&bookmaker=bet365&market=moneyline&limit=50" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"

Arbitrage

Monitor arbitrage windows

REST

Run a short-interval worker that stores cross-book opportunities with your own execution status.

/arbitrage
curl "/api/v1/arbitrage?bookmaker=bet365&limit=25" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"

Account

Inspect quota and bookmaker bindings

REST

Check the active tier, hourly cap, selected bookmakers, and reset availability before a job starts.

/me/bookmakers/reset
curl "/api/v1/me" \
  -H "X-API-Key: $PHOTONODDS_API_KEY"