ElectroBets fixture

Read the ElectroBets sports, regions, leagues, events and live scores through the aggregator, for a sportsbook page that you build yourself.

Before you start

These routes give the ElectroBets fixture data to your server: sports, regions, leagues, events and live scores. Use them when you build your own sportsbook page in place of the ElectroBets iframe.

Sign each request as on the other /v1 routes; the authentication page explains the steps. When no ElectroBets game is enabled for you, each route answers 404 with the code NOT_FOUND.

The aggregator keeps the ElectroBets credentials and calls ElectroBets for you, so your request has no ElectroBets key. Each list answer is an object with an items list.

Sports

This route gives the sports that ElectroBets offers.

Request

GET /v1/providers/electrobets/fixture/sports

Response

{
  "items": [
    {
      "id": 131506,
      "name": "American Football"
    },
    {
      "id": 6046,
      "name": "Football"
    }
  ]
}

Regions

This route gives the regions of one sport. Use the sport id 0 to get the regions of every sport.

Request

GET /v1/providers/electrobets/fixture/sports/6046/regions

Response

{
  "items": [
    {
      "id": 166,
      "name": "Albania"
    },
    {
      "id": 248,
      "name": "International"
    }
  ]
}

Leagues

This route gives the leagues of one sport in one region. Each league also gives the names of its sport and its region.

Request

GET /v1/providers/electrobets/fixture/sports/6046/regions/248/leagues

Response

{
  "items": [
    {
      "id": 38737,
      "name": "Copa America",
      "sport_id": 6046,
      "sport_name": "Football",
      "region_id": 248,
      "region_name": "International"
    },
    {
      "id": 31004,
      "name": "2026 FIFA World Cup Qualifications",
      "sport_id": 6046,
      "sport_name": "Football",
      "region_id": 248,
      "region_name": "International"
    }
  ]
}

Events

This route gives the events of one league. Use the league id 0 to get the events of every league in the region.

Each event has these fields:

  • competitors is a JSON text with the two sides of the event; parse it before you show it.
  • status is the ElectroBets event status as a number.
  • starts_at is the start date and time as ElectroBets sends it.
  • live_score is the live score as a JSON text, or null before the event starts.

Request

GET /v1/providers/electrobets/fixture/sports/6046/regions/248/leagues/38737/events

Response

{
  "items": [
    {
      "id": 11907112,
      "name": "Colombia vs Paraguay",
      "sport_id": 6046,
      "sport_name": "Football",
      "region_id": 248,
      "region_name": "International",
      "league_id": 38737,
      "league_name": "Copa America",
      "competitors": "[{\"Id\":10309,\"Name\":\"Paraguay\",\"Position\":2,\"IsActive\":null,\"ExtraData\":null,\"Result\":0},{\"Id\":79018,\"Name\":\"Colombia\",\"Position\":1,\"IsActive\":null,\"ExtraData\":null,\"Result\":0}]",
      "status": 1,
      "starts_at": "2024-06-24T22:00:00",
      "live_score": null
    }
  ]
}

One event

This route gives one event by its id. When ElectroBets does not know the event, the route answers 502.

Request

GET /v1/providers/electrobets/fixture/events/8601147

Response

{
  "id": 8601147,
  "name": "Brazil vs Argentina",
  "sport_id": 6046,
  "sport_name": "Football",
  "region_id": 248,
  "region_name": "International",
  "league_id": 31004,
  "league_name": "2026 FIFA World Cup Qualifications",
  "competitors": "[{\"Id\":10309,\"Name\":\"Paraguay\",\"Position\":2,\"IsActive\":null,\"ExtraData\":null,\"Result\":0},{\"Id\":79018,\"Name\":\"Colombia\",\"Position\":1,\"IsActive\":null,\"ExtraData\":null,\"Result\":0}]",
  "status": 1,
  "starts_at": "2024-06-24T22:00:00",
  "live_score": "{\"Scoreboard\":{\"Status\":3,\"CurrentPeriod\":100,\"Time\":\"900\",\"Results\":[{\"Position\":\"1\",\"Value\":\"10\"},{\"Position\":\"2\",\"Value\":\"27\"}]}}"
}

Live scores

This route gives the live scores of up to 100 events. Send the event ids in event_ids. The answer lists the scores in event id order; an event without a live score is not in the answer.

Request

POST /v1/providers/electrobets/fixture/scores

Request body

{
  "event_ids": [
    8601147,
    11907112
  ]
}

Response

{
  "items": [
    {
      "event_id": 8601147,
      "score": "{\"Scoreboard\":{\"Status\":3,\"CurrentPeriod\":100,\"Time\":\"900\",\"Results\":[{\"Position\":\"1\",\"Value\":\"10\"},{\"Position\":\"2\",\"Value\":\"27\"}]}}"
    }
  ]
}

Errors

The routes answer with these errors:

  • 400 with MALFORMED_REQUEST: an id is not a whole number, or the scores body is not a list of 1 to 100 event ids.
  • 401 with UNAUTHORIZED: the request is not signed correctly.
  • 404 with NOT_FOUND: no ElectroBets game is enabled for you, or the path is unknown.
  • 502 with INTERNAL_ERROR: ElectroBets refused the call, sent an answer that the aggregator cannot read, or is not set up yet.

The errors page explains the error body.

SDK sample

The SDK has one method for each route in client.electrobets.fixture: sports, regions, leagues, events, event and scores. Each method returns the answer of its route, and an error answer is a typed SDK error; the SDK API guide shows how to set up the SDK. The sample reads the first league of the first sport and region, then the live scores of its events.

fixture.ts

import type { AggregatorClient } from '@asteriks-aggregator/sdk/api'

// Reads the first league of the first sport and region, then the live scores of its events.
export async function firstLeagueScores(client: AggregatorClient) {
  const fixture = client.electrobets.fixture
  const [sport] = (await fixture.sports()).items
  if (sport === undefined) return undefined
  const [region] = (await fixture.regions({ sportId: sport.id })).items
  if (region === undefined) return undefined
  const [league] = (await fixture.leagues({ sportId: sport.id, regionId: region.id })).items
  if (league === undefined) return undefined
  const { items: events } = await fixture.events({ sportId: sport.id, regionId: region.id, leagueId: league.id })
  const [first] = events
  if (first === undefined) return undefined
  const event = await fixture.event({ eventId: first.id })
  // The scores route takes up to 100 event ids in one call.
  const { items: scores } = await fixture.scores({ event_ids: events.slice(0, 100).map((entry) => entry.id) })
  return { league: league.name, firstEvent: event.name, startsAt: event.starts_at, scores }
}

Not in these routes

You cannot place a bet through these routes. The ElectroBets ticket submit waits for answers from ElectroBets, so the API has no route and the SDK has no method for it. To take a bet, open the ElectroBets iframe as the sportsbook page explains.

Was this page helpful?