Skip to content
RealTimeBets

Streaming

GET /api/v1/stream?event={id}&type=micro

The stream is a server-sent events response. Every second it pushes one markets message with the event and its full market set. A connection lasts up to 60 seconds (set seconds lower if you like), then sends end; reconnect to continue. Each connection counts as one request.

event: markets
data: {"event":{"id":"rp-tennis-1-3932","score":{"home":0,"away":1},"clock":"4-6  3-2  15-0"},"markets":[...]}

event: end
data: {"reconnect":true}

In the browser

// Server-sent events need the key in a header, so proxy the stream through your backend.
const source = new EventSource('/your-proxy/rtb-stream?event=rp-tennis-1-3932');
source.addEventListener('markets', (e) => render(JSON.parse(e.data)));
source.addEventListener('end', () => source.close());

With curl

curl -N "https://realtimebets.com/api/v1/stream?event=rp-tennis-1-3932" \
  -H "Authorization: Bearer rtb_sk_your_key"