Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Introduction

This document describes technologies available for customers wishing to integrate with Multibet API directly. It explains the overall architecture, integration points and requirements.

Table of Contents

Conceptual Diagram

API Domain Names

Environment

Base URL

Notes

Production

https://multibet.api.geniussports.com/v2/

Production environment

UAT

https://uat.multibet.api.geniussports.com/v2/

User Acceptance Testing. Limited capacity.

Production Swagger

https://multibet.api.geniussports.com/api-docs/index.html#/

UAT Swagger

https://uat.multibet.api.geniussports.com/api-docs/index.html#/

Authentication

All calls to the API must be authenticated and provide an API key. Each request must include the following headers:

Header

Description

Example Value

Authorization

An OAuth Access Token

Bearer eyJhbGciOiJSUzI1N.iIsInR5cCI6IkpXVCIsImtpExLd2FJNUpLZX.pjWCJ2

x-api-key

The API key provided to you

awefawefawefaewg43qgaregvasva

Getting an access token

To obtain an Access Token, you must make a client_credentials POST request to the Genius Sports Authentication server https://uat.auth.geniussports.com/oauth/token with the following request body:

{
  "grant_type" : "client_credentials",
  "audience": "https://api.geniussports.com",
  "client_id": <client-id>,
  "client_secret": <client_secret>
}

Your <client-id> and <client-secret> will be provided to you during the onboarding process.

Example token request:

curl --request POST \
--url https://uat.auth.geniussports.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"<client-id>","client_secret":"<client-secret>","audience":"https://api.geniussports.com","grant_type":"client_credentials"}'

Example token response:

{
  "access_token": "<access-token>",
  "token_type": "Bearer"
}

Getting an API key

Your <api-key> will be provided to you during the onboarding process.

Calling the API

Once you have an <access-token> and your <api-key> you can pass these as headers to the API:

curl --request GET \
  --url https://multibet.api.geniussports.com/v2/sports/10/fixtures/1/results?legs=TotalGoals_Over_3.5 \
  --header 'authorization: Bearer <access-token> \'
  --header 'x-api-key: <api-key>'

Rate Limiting

All calls to the API are rate limited. A 429 Too Many Requests error will be returned from the API in cases where you are exceeding the rate limit. Rate limits are determined on an individual basis.

Resources

Genius Sports provides four pull API endpoints:

  • Fixtures - Returns fixtures that are available to be used in Multibet

  • Markets-types - Provides a list of markets and selections that are available to bet upon

  • Prices - The price of a particular multibet

  • Results - The result of a particular multibet

Fixtures

Returns list of fixtures that are available to be used in Multibet. FixtureId is required to call the remaining three endpoints: Markets-types, Prices, Results

API Domain Names

Environment

Base URL

Notes

Production

https://coverage.api.geniussports.com/api/

Production environment

UAT

https://uat.coverage.api.geniussports.com/api/

User Acceptance Testing. Limited capacity.

Authentication

You should go through all steps in “Getting an access token” section and authenticate using the Coverage API <api-key>

Getting an API key

Your <api-key> for using Coverage API will be provided to you during the onboarding process.

Calling the API

Once you have an <access-token> and your <api-key> you can pass these as headers to the API:

curl --request GET \
  --url https://coverage.api.geniussports.com/api/MultibetPreMatchCoverage/event/{fixtureId} \
  --header 'Authorization: Bearer <access-token> \'
  --header 'x-api-key: <api-key>'

Fixtures Resources

Multibet Pre-Match coverage by sport and date range

Returns data about a particular fixture that will show this fixture is available for use in Multibet Pre-Match.
Path

GET MultibetPreMatchCoverage/range/sport/{sportId}/from/{from}/to/{to}

{sportId} should be replaced by the relevant Genius Sports ids. Only fixtures starting after this date {from} and only fixtures starting before this {to} will be returned. Format: yyyy-MM-dd E.g. 2023-07-15

Example: https://coverage.api.geniussports.com/api/MultibetPreMatchCoverage/range/sport/10/from/2023-07-13/to/2023-07-15

Response Body

[
    {
        "betgeniusFixtureId": 123456,
        "sourceFixtureId": "123456",
        "source": "GeniusSportsMultibetPreMatch",
        "sportId": 10,
        "available": true,
        "coverageType": 4
    },
    {
        "betgeniusFixtureId": 1234567,
        "sourceFixtureId": "1234567",
        "source": "GeniusSportsMultibetPreMatch",
        "sportId": 10,
        "available": false,
        "coverageType": 4
    },
    {
        "betgeniusFixtureId": 12345678,
        "sourceFixtureId": "12345678",
        "source": "GeniusSportsMultibetPreMatch",
        "sportId": 10,
        "available": true,
        "coverageType": 4
    }
]

Multibet Pre-Match coverage by fixture

Returns data about a particular fixture that will show this fixture is available for use in Multibet Pre-Match.
Path

GET MultibetPreMatchCoverage/event/{fixtureId}

{fixtureId} should be replaced by the relevant Genius Sports ids.

Example: https://coverage.api.geniussports.com/api/MultibetPreMatchCoverage/event/123456

Response Body

[
    {
        "betgeniusFixtureId": 123456,
        "sourceFixtureId": "123456",
        "source": "GeniusSportsMultibetPreMatch",
        "sportId": 10,
        "available": true,
        "coverageType": 4
    }
]

Multibet In-Play coverage by sport and date range

Returns data about a particular fixture that will show this fixture is available for use in Multibet In-Play.
Path

GET MultibetInPlayCoverage/range/sport/{sportId}/from/{from}/to/{to}

{sportId} should be replaced by the relevant Genius Sports ids. Only fixtures starting after this date {from} and only fixtures starting before this {to} will be returned. Format: yyyy-MM-dd E.g. 2023-07-15

Example: https://coverage.api.geniussports.com/api/MultibetInPlayCoverage/range/sport/10/from/2023-07-13/to/2023-07-15

Response Body

[
    {
        "betgeniusFixtureId": 123456,
        "sourceFixtureId": "123456",
        "source": "GeniusSportsMultibetInPlay",
        "sportId": 10,
        "available": true,
        "coverageType": 4
    },
    {
        "betgeniusFixtureId": 1234567,
        "sourceFixtureId": "1234567",
        "source": "GeniusSportsMultibetInPlay",
        "sportId": 10,
        "available": false,
        "coverageType": 4
    },
    {
        "betgeniusFixtureId": 12345678,
        "sourceFixtureId": "12345678",
        "source": "GeniusSportsMultibetInPlay",
        "sportId": 10,
        "available": true,
        "coverageType": 4
    }
]

Multibet In-Play coverage by fixture

Returns data about a particular fixture that will show this fixture is available for use in Multibet In-Play.
Path

GET MultibetInPlayCoverage/event/{fixtureId}

{fixtureId} should be replaced by the relevant Genius Sports ids.

Example: https://coverage.api.geniussports.com/api/MultibetInPlayCoverage/event/123456

Response Body

[
    {
        "betgeniusFixtureId": 123456,
        "sourceFixtureId": "123456",
        "source": "GeniusSportsMultibetInPlay",
        "sportId": 10,
        "available": true,
        "coverageType": 3
    }
]

Market-types

Returns a list of available markets to bet upon for a particular fixture. The available markets is sport specific and will also be affected by the current state of the fixture and what bets are already included in the multibet. For instance it wouldn’t be possible to bet upon a first quarter market during the second quarter of a fixture.

Path

GET sports/{sportId}/fixtures/{fixtureId}/market-types?legs={legs}

{sportId} and {fixtureId} should be replaced by the relevant Genius Sports ids.

Example: https://multibet.api.geniussports.com/v2/sports/10/fixtures/123456/market-types?legs=WinMatchRegularTime_Home,HalfTimeTotalGoals_Over_2.5

Request URL Parameters

Parameter

Encoding

Required

Description

legs

Leg Ids separated by “,”

See: https://geniussports.atlassian.net/wiki/spaces/BID/pages/4284252757/Multibet+API#Leg-Id

No

The ids of any bets that are already included in the multibet.

By providing this information the get-market-types method is able to exclude incompatible markets from the response. E.g. if the user has already selected to bet that the home team will win the match we can exclude the option to add a bet on the away team winning to the multibet.

If this parameter is omitted then all available markets will be returned.

 

Response Body

Field

Type

Nullable

Description

markets

Market[]

See: https://geniussports.atlassian.net/wiki/spaces/BID/pages/4284252757/Multibet+API#Market

No

Array of markets available to bet upon

{
    "markets": [
        {
            "marketType": "Win Match Regular Time",
            "selections": [
                {
                    "id": "WinMatchRegularTime_Home",
                    "name": "Home"
                },
                {
                    "id": "WinMatchRegularTime_Draw",
                    "name": "Draw"
                },
                {
                    "id": "WinMatchRegularTime_Away",
                    "name": "Away"
                }
            ]
        },
        {
            "marketType": "Half Time Total Goals",
            "handicap": {
                "minimum": 1,
                "maximum": 20,
                "step": 1,
                "default": 1
            },
            "selections": [
                {
                    "id": "HalfTimeTotalGoals_Over_{HANDICAP}",
                    "name": "Over"
                },
                {
                    "id": "HalfTimeTotalGoals_Under_{HANDICAP}",
                    "name": "Under"
                }
            ]
        }
    ]
}

Prices

Returns the price of the selected multibet.

Path

GET sports/{sportId}/fixtures/{fixtureId}/prices

Example: https://multibet.api.geniussports.com/v2/sports/10/fixtures/123456/prices?legs=WinMatchRegularTime_Home,HalfTimeTotalGoals_Over_2.5

{sportId} and {fixtureId} should be replaced by the relevant Genius Sports ids.

Request URL Parameters

Parameter

Encoding

Required

Description

legs

Leg Ids separated by “,”

See: https://geniussports.atlassian.net/wiki/spaces/BID/pages/4284252757/Multibet+API#Leg-Id

Yes

The ids of the bet legs that are included in the multibet. The array must contain a minimum of one leg, maximum 50 legs and the legs must be unique.

 

Response Body

Field

Type

Nullable

Description

decimalPrice

decimal

No

Decimal price for the multibet. Calculated from the probability of the bet winning with a margin applied.

probability

decimal

No

Probability of the multibet winning.

suspended

bool

No

Indicates that betting is currently suspended on one or more of the legs within the bet and it shouldn’t be accepted. Suspensions are generally short-term and relate to a temporary match situation such as a high risk of a score happening that could significantly affect probabilities.

{
    "decimalPrice": 1.66,
    "probability": 0.5656463943226999,
    "suspended": false
}

Results

Path

GET sports/{sportId}/fixtures/{fixtureId}/results

{sportId} and {fixtureId} should be replaced by the relevant Genius Sports ids.

Example: https://multibet.api.geniussports.com/v2/sports/10/fixtures/123456/results?legs=WinMatchRegularTime_Home,HalfTimeTotalGoals_Over_2.5

Request URL Parameters

Parameter

Encoding

Required

Description

legs

Leg Ids separated by “,”

See: https://geniussports.atlassian.net/wiki/spaces/BID/pages/4284252757/Multibet+API#Leg-Id

Yes

The ids of the bet legs that are included in the multibet. The array must contain a minimum of one leg, maximum 50 legs and the legs must be unique.

 

Response Body

Field

Type

Nullable

Description

result

x-extensible-enum

See https://geniussports.atlassian.net/wiki/spaces/BID/pages/4284252757/Multibet+API#Result

No

Overall result of the multibet.

legResults

LegResult[]

See https://geniussports.atlassian.net/wiki/spaces/BID/pages/4284252757/Multibet+API#LegResult

No

Result of each individual leg within the multibet. Minimum length one, maximum length 50, unique entries.

{
    "result": "lose",
    "legResults": [
        {
            "leg": "MatchResult_Home",
            "legResult": "win"
        },
        {
            "leg": "TotalGoals_Over_20.5",
            "legResult": "lose"
        }
    ]
}

 

Type Definitions

Market

A market contains selections that can be bet upon that will correspond to legs within a multibet.

Field

Type

Required

Description

marketType

string

Yes

Name of the Market Type

handicap

Handicap

No

For Handicap and Over/Under markets specifies the range of valid values

index

Index

No

Used for index markets which are associated with a particular instance of an event that happens within the match. E.g. First Goalscorer, Second Goalscorer.

selections

Selection[]

Yes

The selections upon which a bet can be placed. Minimum length 1.

Handicap

Used for Handicap and Over/Under markets to specify the available lines that can be bet upon. Handicaps are taken from the perspective of the Home team.

Field

Type

Required

Description

minimum

decimal

Yes

Minimum supported value for the handicap

maximum

decimal

Yes

Maximum supported value for the handicap

step

decimal

Yes

Supported step interval. For instance an Over/Under market may be offered Over/Under 2.5, Over/Under 3.5 and Over/Under 4.5 in which case the step would be 1.0.

default

decimal

Yes

Provides an indication of a possible default choice to offer to a player wishing to bet upon the Market Type. If pricing data is available this would usually be the line with the selection probabilities closest to each other.

If a customer wishes to ensure that the most balanced market is always offered then they should request prices for all available lines using the get-price method.

Index

Index markets relate to betting on a particular instance of an event that can happen multiple times during a fixture, e.g. betting on which team will score the Next Goalscorer. In this example at the start of the match the Primary field of the index would start at 1 (for the First Goalscorer) and then increment to 2 for the Second Goalscorer etc.

Field

Type

Required

Description

primary

int

Yes

One-based index of the primary count, e.g. the number of the Goals in an Football game.

Selection

Field

Type

Required

Description

id

string

Yes

The id of the selection which will form part of the leg id. This may contain a parameter, such as the handicap line which will be encoded within parentheses {}, e.g. “Over_{HANDICAP)”

name

string

Yes

The name of the selection. This may contain a parameter, such as the handicap line which will be encoded within parentheses {}, e.g. “Over {HANDICAP)”

Leg Id

For simplicity and compactness we encode the id of legs as a string.

Rules

  • Characters are restricted to those that do not require URL encoding

  • No white space allowed

  • Pascal case notation is used for marketType and selection

  • Underscore “_” is used as a separator between the different fields within a leg and is guaranteed not to be used within fields

  • Hyphen is used for dividing range values

  • Comma “,” is used as a separator between leg ids in the URL and is guaranteed not to be used within fields

Examples

Leg

Leg Id Format

Example

Home team to win the match

{MarketType}_{Selection}

WinMatchRegularTime_Home

More than 2.5 goals to be scored in first half

{MarketType}_{Selection}_{Handicap}

HalfTimeTotalGoals_Over_2.5

Half time score 2-1

{MarketType}_{Range.Low}-{Range.High}

HalfTimeCorrectScore_2-1

Whenever an API method requires legs to be passed in by the caller the Leg Id should be used.

Result

Results are passed as extensible enums (x-extensible-enum) which are encoded as strings within the JSON.

Extensible Enum Value

Leg Result

Multibet Result

”unknown”

The leg result is expected however it is not currently known.

The multibet result is expected however it is not currently known.

“win”

This is a winning leg.

Each leg in the multibet is a win.

“lose”

This is a losing leg.

At least one leg in the multibet is a lose.

“void”

This leg is neither a win nor a lose.

There are no losing legs and at least one leg in the multibet is void.

Consumers should be written to accept other possible values in future to allow future enhancements to be made in a non-breaking manner. It is recommended that they log any value they don’t understand and take no action from that message.

LegResult

A leg result encapsulates the result for a single leg within a multibet.

 

HTTP Status Codes and Error Handing

HTTP Status Code

Reason

Method Applicability

Usages / Description

200

 

All

The API call succeeded with a normal response.

400

 

All

Bad Request. Malformed request received from the client.

IncompatibleLegs

  • markets

  • prices

Incompatible legs. E.g. including WinMatchRegularTime_Home and WinMatchRegularTime_Away in the same multibet.

No legs

  • prices

  • results

 

Too many legs

All

 

Unsupported legs

All

 

ResultKnown

  • prices

The result of one or more legs within the multibet is already known.

401

 

All

Unauthorized. Authentication failed or the client isn’t authorised to access the API.

403

 

All

Forbidden AKA Unauthorized. The caller is not authorized to perform the action

404

 

All

Not Found. Unexpected path or no data is currently available for the fixture id requested.

405

 

All

Call to any API method with the wrong HTTP Method. E.g. POST rather than GET.

406

A call has been done referring a game that has finished

All

Call to any method on an already ended game

429

 

All

Too Many Requests. The client has exceeded the maximum number of requests allowed within a specified time period. The client should throttle back or request an increased quota.

500

 

All

Internal Server Error. General error code for an unexpected server-side error.

503

 

All

Service Unavailable. Usually indicates the service is down for maintenance.

Appendix A - End to End Example

This example demonstrates the flow of the Multibet API calls for an Football fixture 123456. For simplicity the amount of available markets is limited to two (Match Result and Half-time Total Goals).

1️⃣ User opens the widget. Initial call is made to get the list of the available markets.

GET sports/10/fixtures/123456/market-types

{
    "markets": [
        {
            "marketType": "Win Match Regular Time",
            "selections": [
                {
                    "id": "WinMatchRegularTime_Home",
                    "name": "Home"
                },
                {
                    "id": "WinMatchRegularTime_Draw",
                    "name": "Draw"
                },
                {
                    "id": "WinMatchRegularTime_Away",
                    "name": "Away"
                }
            ]
        },
        {
            "marketType": "Half Time Total Goals",
            "handicap": {
                "minimum": 1,
                "maximum": 20,
                "step": 1,
                "default": 1
            },
            "selections": [
                {
                    "id": "HalfTimeTotalGoals_Over_{HANDICAP}",
                    "name": "Over"
                },
                {
                    "id": "HalfTimeTotalGoals_Under_{HANDICAP}",
                    "name": "Under"
                }
            ]
        }
    ]
}

2️⃣ User adds a leg (Match Result - Home) to the bet. Call is made to get a price for the current bet.

GET sports/10/fixtures/123456/prices?legs=WinMatchRegularTime_Home

{
    "decimalPrice": 1.66,
    "probability": 0.5656463943226999,
    "suspended": false
}

3️⃣ User wants to add another leg. Call is made to get the list of the available markets. Match Result market will not be included in the response because it is already used in one of the legs.

GET sports/10/fixtures/123456/market-types?legs=WinMatchRegularTime_Home

{
    "markets": [
        {
            "marketType": "Half Time Total Goals",
            "handicap": {
                "minimum": 1,
                "maximum": 20,
                "step": 1,
                "default": 1
            },
            "selections": [
                {
                    "id": "HalfTimeTotalGoals_Over_{HANDICAP}",
                    "name": "Over"
                },
                {
                    "id": "HalfTimeTotalGoals_Under_{HANDICAP}",
                    "name": "Under"
                }
            ]
        }
    ]
}

4️⃣ User adds a second leg (Half-time Total Goals - Over 2.5) to the bet. Call is made to get a price for the current bet.

GET sports/10/fixtures/123456/prices?legs=WinMatchRegularTime_Home,HalfTimeTotalGoals_Over_2.5

{
    "decimalPrice": 1.77,
    "probability": 0.4656463943226999,
    "suspended": false
}

5️⃣ Result is requested for the bet.

GET sports/10/fixtures/123456/results?legs=WinMatchRegularTime_Home,HalfTimeTotalGoals_Over_2.5

{
    "result": "lose",
    "legResults": [
        {
            "leg": "MatchResult_Home",
            "legResult": "win"
        },
        {
            "leg": "HalfTimeTotalGoals_Over_2.5",
            "legResult": "lose"
        }
    ]
}

  • No labels