Download OpenAPI specification:Download
Provides a simple way to push (or ingest) fixture and market data in Genius Sports OddsFeed Platform (OIS).
To access Ingestion API each request must provide two headers:
Authorization
header with an OAuth2 JSON web token (Bearer) issued by Auth0.x-api-key
with an API key secret of a key, registered with the API gateway in AWS. Authorization
header? As an Ingestion API client, I must be provided with Auth0 Client credentials (client_ID
and Client_secret
) by Genius Sports (OIS team) and obtain a valid token from the Auth0 token endpoint using the Machine-to-Machine (client credentials) flow. I must obtain a new token whenever needed (based on the token expiration).
Make a POST
request to the token endpoint: https://genius-sports.eu.auth0.com/oauth/token with the following payload:
{
"client_id": "YOUR_AUTH0_CLIENT_ID
",
"client_secret": "YOUR_AUTH0_CLIENT_SECRET
",
"audience": "https://api.geniussports.com",
"grant_type": "client_credentials"
}
You will receive a new token in the response access_token
field.
Curl example:
curl -X 'POST' https://genius-sports.eu.auth0.com/oauth/token -H 'Content-Type: application/json' -d '{"client_id":"YOUR_AUTH0_CLIENT_ID", "client_secret":"YOUR_AUTH0_CLIENT_SECRET", "audience":"https://api.geniussports.com", "grant_type":"client_credentials"}'
sportId
fixtures property?You can retrieve the ids and descriptions used for sports by Genius Sports via the coresponding Fixtures API sports call.
If you already know the valid name for the sport then you may use it as a filter to retrieve the specific sport id, or else you may retrieve all sports' ids and descriptions without filter.
Note You need to provide a distinct (different) x-api-key
provided to you specifically for accessing the Fixtures API.
After obdaining your x-api-key
and a valid JW token, you are ready to use the API.
Use this call to test connection:
curl https://oddsfeed.api.geniussports.com/ingestion/v1/health -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_JW_TOKEN'
In order to work with source fixtures and markets, you also need to provide a valid GS sourceId
(obdained by Genius Sports) in every call Url sourceId
query parameter.
There are three (3) operations supported for source fixture entries:
POST
: Use to ingest a source fixture. The fixture will be updated if already exists, inserted if new, then it will be propagated to OIS together with its source markets that might have been ingested before. GET
: Use to retrieve a previously ingested source fixture. DELETE
: Use to delete a previously ingested source fixture and change its OIS status to Unavailable
. The fixture source markets will be deleted as well and their OIS status will also change to Unavailable
. Curl examples:
POST
example: Use to ingest a source fixture that you provide in the request body; you should recieve code 201 (Created
) or 202 (Updated
), or data validation error if the fixture data provided are invalid, i.e. if sportId
is missing or invalid. curl -X 'POST' https://oddsfeed.api.geniussports.com/ingestion/v1/sources/YOUR_SOURCE_ID/fixtures/YOUR_SOURCE_FIXTURE_ID -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_ID_TOKEN' -d '{YOUR_FIXTURE_JSON_OBJECT}'
GET
example: Use to retrieve the previously ingested source fixture; you should recieve code 200 (OK
) and the source fixture in the response body. curl https://oddsfeed.api.geniussports.com/ingestion/v1/sources/YOUR_SOURCE_ID/fixtures/YOUR_SOURCE_FIXTURE_ID -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_ID_TOKEN'
DELETE
example: Use to delete the source fixture and its source markets and change their OIS status to Unavailable
; on success, you should recieve code 204 (NoContent
). curl -X 'DELETE' https://oddsfeed.api.geniussports.com/ingestion/v1/sources/YOUR_SOURCE_ID/fixtures/YOUR_SOURCE_FIXTURE_ID -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_ID_TOKEN'
There are three (3) operations supported for source market entries as well:
POST
: Use to ingest a source market. The market will be updated if already exists or inserted if new, then it will be propagated to OIS only if its corresponding fixture is already ingested. GET
: Use to retrieve a previously ingested source market. DELETE
: Use to delete a previously ingested source market, then change its OIS status to Unavailable
only if its corresponding fixture is already ingested. Curl examples:
POST
example: Use to ingest a source market that you provide in the request body; you should recieve code 201 (Created
) or 202 (Updated
), or data validation error if the market data provided are invalid, i.e. if selections
is missing or one or more selection price
is missing or inconsistent. curl -X 'POST' https://oddsfeed.api.geniussports.com/ingestion/v1/sources/YOUR_SOURCE_ID/markets/YOUR_SOURCE_MARKET_ID -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_ID_TOKEN' -d '{YOUR_MARKET_JSON_OBJECT}'
GET
example: Use to retrieve the previously ingested source market; you should recieve code 200 (OK
) and the source market in the response body. curl https://oddsfeed.api.geniussports.com/ingestion/v1/sources/YOUR_SOURCE_ID/markets/YOUR_SOURCE_MARKET_ID -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_ID_TOKEN'
DELETE
example: Use to delete the source market, and if its corresponding fixture is already ingested then change its OIS status to Unavailable
; on success, you should recieve code 204 (NoContent
). curl -X 'DELETE' https://oddsfeed.api.geniussports.com/ingestion/v1/sources/YOUR_SOURCE_ID/markets/YOUR_SOURCE_MARKET_ID -H 'Content-Type: application/json' -H 'x-api-key: YOUR_API_KEY' -H 'Authorization: Bearer YOUR_ID_TOKEN'
The data contract structures used for source fixture and market are fully described in the corresponding Swagger Models below, i.e. SourceFixtureRequest
model for the fixture and SourceMarketRequest
model for the market
sourceId required | string The identifier for this source |
sourceFixtureId required | string Unique identifier across the source |
{- "name": "string",
- "sportId": 1,
- "startTime": "2019-08-24T14:15:22Z",
- "hasInPlay": "Unspecified",
- "hasPreMatch": "Unspecified",
- "venue": {
- "id": "string",
- "name": "string"
}, - "competition": {
- "id": "string",
- "name": "string"
}, - "season": {
- "id": "string",
- "name": "string"
}, - "round": {
- "id": "string",
- "name": "string"
}, - "competitors": [
- {
- "id": "string",
- "name": "string",
- "isHome": true,
- "lineup": [
- {
- "id": "string",
- "name": "string"
}
]
}
], - "sourceId": "string",
- "id": "string"
}
sourceId required | string The identifier for this source |
sourceFixtureId required | string Unique identifier across the source |
A fixture is a sport event/game that takes place on a particular time and location
name required | string [ 1 .. 500 ] characters Source Fixture name (e.g. Barcelona vs Real Madrid; Roger Federer vs Rafael Nadal; etc.) |
sportId required | integer <int32> [ 1 .. 2147483647 ] The Genius Sports sport id. Available sports with their ids can be retrieved from Fixtures API Fixtures API sports |
startTime required | string <date-time> Source start date of the Fixture |
hasInPlay required | string (OptionalBoolean) Enum: "Unspecified" "Yes" "No" |
hasPreMatch required | string (OptionalBoolean) Enum: "Unspecified" "Yes" "No" |
object (Venue) A sports venue is a building, structure, or place in which a sporting fixture is held | |
object (Competition) A contest or sports game. The competition groups the past and present seasons together. A competition is unique and remains the same throughout its lifetime. A Competition represents a sporting competition such as: The Premier League, Italy Serie A, and so on. It is part of the fixture hierarchy.A competition generally contains multiple rounds, and fixtures.It could also contain seasons. | |
object (Season) A season represents a new edition of a competition with a certain time period over which games of that sport are played | |
object (Round) A round represents a group of fixtures within a Season | |
Array of objects (Competitor) |
{- "name": "string",
- "sportId": 1,
- "startTime": "2019-08-24T14:15:22Z",
- "hasInPlay": "Unspecified",
- "hasPreMatch": "Unspecified",
- "venue": {
- "id": "string",
- "name": "string"
}, - "competition": {
- "id": "string",
- "name": "string"
}, - "season": {
- "id": "string",
- "name": "string"
}, - "round": {
- "id": "string",
- "name": "string"
}, - "competitors": [
- {
- "id": "string",
- "name": "string",
- "isHome": true,
- "lineup": [
- {
- "id": "string",
- "name": "string"
}
]
}
]
}
{- "type": "string",
- "title": "string",
- "status": 0,
- "detail": "string",
- "instance": "string",
- "errors": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}, - "property1": { },
- "property2": { }
}
sourceId required | string The identifier for this source |
sourceFixtureId required | string Unique identifier across the source |
{- "type": "string",
- "title": "string",
- "status": 0,
- "detail": "string",
- "instance": "string",
- "errors": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}, - "property1": { },
- "property2": { }
}
sourceId required | string The identifier for this source |
sourceMarketId required | string Unique identifier across the source |
{- "sourceFixtureId": "string",
- "name": "string",
- "isSuspended": true,
- "isHandicap": true,
- "selections": [
- {
- "id": "string",
- "name": "string",
- "isSuspended": true,
- "handicap": 0.1,
- "price": {
- "decimal": 0.1,
- "fractional": {
- "numerator": 0,
- "denominator": 0
}, - "american": 0
}, - "range": {
- "min": 0.1,
- "max": 0.1
}
}
], - "inPlayStatus": "Unspecified",
- "marketIndex": {
- "primary": 0,
- "secondary": 0,
- "tertiary": 0
}, - "customData": [
- {
- "key": "string",
- "value": "string"
}
], - "sourceId": "string",
- "id": "string"
}
sourceId required | string The identifier for this source |
sourceMarketId required | string Unique identifier across the source |
A market is a fixture set of outcomes on which the player can make a bet.
sourceFixtureId required | string^[a-zA-Z0-9_-]{1,300}$ The source fixture unique identifier that this market applies to |
name required | string [ 1 .. 500 ] characters Source market name (e.g. Full Time Odd / Even; To Win Both Halves;) |
isSuspended | boolean Indicates a manual action by a Trader, where no more bets can be accepted from players |
isHandicap required | boolean Indicates whether the market is a handicap |
Array of objects (Selection) | |
inPlayStatus | string (InPlayStatus) Enum: "Unspecified" "PreMatch" "InPlay" Determines a market betting status related to whether the game has started. Pre-match betting means bookmakers offer ways to bet long before the fixture happens. In-play betting means that bookmakers offer ways to bet during a sporting fixture. Unspecified means that the source does not provide this information. |
object (MarketIndex) | |
Array of objects (CustomData) <= 10 items Custom metadata represented as key-value pairs associated with the market. |
{- "sourceFixtureId": "string",
- "name": "string",
- "isSuspended": true,
- "isHandicap": true,
- "selections": [
- {
- "id": "string",
- "name": "string",
- "isSuspended": true,
- "handicap": 0.1,
- "price": {
- "decimal": 0.1,
- "fractional": {
- "numerator": 0,
- "denominator": 0
}, - "american": 0
}, - "range": {
- "min": 0.1,
- "max": 0.1
}
}
], - "inPlayStatus": "Unspecified",
- "marketIndex": {
- "primary": 0,
- "secondary": 0,
- "tertiary": 0
}, - "customData": [
- {
- "key": "string",
- "value": "string"
}
]
}
{- "type": "string",
- "title": "string",
- "status": 0,
- "detail": "string",
- "instance": "string",
- "errors": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}, - "property1": { },
- "property2": { }
}
sourceId required | string The identifier for this source |
sourceMarketId required | string Unique identifier across the source |
{- "type": "string",
- "title": "string",
- "status": 0,
- "detail": "string",
- "instance": "string",
- "errors": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}, - "property1": { },
- "property2": { }
}
sourceId required | string The identifier for this source |
{- "type": "string",
- "title": "string",
- "status": 0,
- "detail": "string",
- "instance": "string",
- "errors": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}, - "property1": { },
- "property2": { }
}