Using RevShare API

Prerequisites

  • An API key and relevant Account ID - to authorise the request

Requesting an API key

Contact your Genius CSM to obtain an API key from the Genius IT team.

Uploading data

Method: POST

Queues a valid set of data for upload in the RevShare database. Once the upload is accepted and response 200 is received, the upload will be queued for full validation by the solution. Final validation information can be received by submitting the GET request shown below.

API Endpoints

https://uat.revshare.api.geniussports.com/api/uploads/json

https://production.revshare.api.geniussports.com/api/uploads/json

Mandatory query parameters

Parameter

Description

Value type

Parameter

Description

Value type

uploaded_by

Email address of the uploading client’s contact

string <email>

Example:uploaded_by=test.revshare.customer1@geniussports.com

account_id

Account ID of the client

number

Example: account_id=1000004

start_date

Start date of the uploaded data

string^\d\d\d\d-\d\d-\d\d$ (YYYY-MM-DD)

Example: start_date=2022-09-01

end_date

End date of the uploaded data

string^\d\d\d\d-\d\d-\d\d$ (YYYY-MM-DD)

Example: end_date=2022-09-30

provided_for

RevShare or NFL upload

string

Enum: revshare nfl

template

Account or Brand level NFL or Inplay (RevShare) upload

string

Enum: nfl_account nfl_brand inplay_account inplay_brand

reference

 

Automated upload reference number or identifier.

string

Example: reference=API-Upload-Oct-22

This reference appears on emails sent to the admin contact of the client

token

Client's Authentication Token

string

Example: token=6cfc21c0-7e5b-11ed-a1eb-0242ac121112

 

JSON body expected

You should preferably submit the JSON body with 1000 fixtures per request. A bigger amount of fixtures may cause the API to respond slower than expected. Calls with more than 5000 fixtures may not succeed.

Each fixture must be placed in a separate JSON object. You can expand the fields below to see a full list of properties that must be submitted per fixture.

Please note that the JSON object keys must be lowercase!

{ 'fixture_id': '9249617', 'fixture_name': 'Philadelphia Eagles v Washington Commanders', 'fixture_date': '15.11.22 0:00', 'country': 'USA', 'state': 'KS', 'bet_type_level_1': 'Final Score', 'bet_type_level_2': 'Moneyline', 'total_stake': '9897', 'gross_gaming_revenue': '8626', 'inplay_gross_gaming_revenue': '1915', 'number_of_bets': '56', 'unique_bettors': '9', 'pre_game_percent_of_stake': '0.45', 'in_game_percent_of_stake': '0.55', 'pre_game_percent_of_bets': '0.23', 'in_game_percent_of_bets': '0.77', 'online_percent_of_stake': '0.65', 'land_based_percent_of_stake': '0.35', 'median_bet_size': '282.03', 'average_bet_size': '154.03' }
{ 'brand': 'brand_name', 'brand_id': '100123', 'fixture_id': '9249617', 'fixture_name': 'Philadelphia Eagles v Washington Commanders', 'fixture_date': '15.11.22 0:00', 'country': 'USA', 'state': 'KS', 'bet_type_level_1': 'Final Score', 'bet_type_level_2': 'Moneyline', 'total_stake': '9897', 'gross_gaming_revenue': '8626', 'inplay_gross_gaming_revenue': '1915', 'number_of_bets': '56', 'unique_bettors': '9', 'pre_game_percent_of_stake': '0.45', 'in_game_percent_of_stake': '0.55', 'pre_game_percent_of_bets': '0.23', 'in_game_percent_of_bets': '0.77', 'online_percent_of_stake': '0.65', 'land_based_percent_of_stake': '0.35', 'median_bet_size': '282.03', 'average_bet_size': '154.03' }
{ 'sport': 'Basketball', 'sport_id': '4', 'competition': 'FIBA EuroBasket', 'competition_id': '1484', 'fixture_name': 'Ukraine v Italy', 'fixture_id': '8057468', 'fixture_date': '5.09.22 0:00', 'currency': 'GBP', 'gross_gaming_revenue': '17086', 'number_of_bets': '70', 'total_stake': '31302', 'winnings': '0', 'bets_declared_void': '1', 'chargebacks': '2', 'gambling_taxes': '1370', 'net_gaming_revenue': '8718' }

Response

The API returns a 200 response when the upload passes first-level validation (full validation is done later by the solution). In case the upload is successful, a JSON body is also returned in the request that also specifies the Upload ID. The Upload ID can later on be used to validate if the upload has any errors.

Email Notifications

The API does not send notifications to the RevShare InPlay or NFL contact in case the data uploaded has no errors. In case of errors, the API will notify the RevShare contact that there was an error. The errors will be sent via email for each chunk of data that is loaded. Genius is looking to change this behaviour to one email per upload.

Example Python Function to upload data

The example below uses Python to upload API data. What it does in short:

  1. Ingests a CSV, lowercases all keys and converts it to JSON objects

  2. Submits the data to the API via the upload_revshare_data function which users the requests module. The function takes care of splitting the list of JSON objects to chunks of 1000 (if more than 1000).

  3. The function returns, via print statements, the response of the API

Getting the status of an upload

Method: GET

Returns the status of an upload that was done via the request above. Returns rich error information for smaller numbers of errors.

API Endpoints

Mandatory query parameters

Parameter

Description

Value type

Parameter

Description

Value type

token

Client's Authentication Token

string

Example: token=6cfc21c0-7e5b-11ed-a1eb-0242ac121112

Path parameters

Parameter

Description

Value type

Parameter

Description

Value type

{upload_uuid}

The upload_uuid that is returned by the POST/upload request. (See example responses above)

string <uuid>

Example: https://uat.revshare.api.geniussports.com/api/uploads/5xxxxxx3-8xx9-4xx6-8xx4-exxxxxxxxx17

Response

The response will return the upload_uuid, upload_ref and status of the upload. Errors will be summarised per error type in the response.

 

Downloading Usage

Method: GET

Returns a full set of usage data from the Genius Sports systems for the specific customer account. All data is returned in B2B upload format (Brands included).

API Endpoints

Mandatory query parameters

Parameter

Description

Value type

Parameter

Description

Value type

year

The year for the requested usage data

string

Example: 2023

month

 

The month for the requested usage data

string

Example: 2

limit

A limit for the result size. Defaults to 1000. Requesting more than a few thousand rows is not advised as the responses will get slower.

integer

Example: 1000

token

Client's Authentication Token

string

Example: token=6cfc21c0-7e5b-11ed-a1eb-0242ac121112

Path parameters

Parameter

Description

Value type

Parameter

Description

Value type

{account_id}

The Account ID of the customer

string

Example: 121121

Response

The API returns a 200 response when the usage data was successfully generated. The usage data is passed as a JSON in the body of the response. A “next” link is returned as part of the response that can be followed for the next page of results if multiple pages or results need to be served.

NB: usage_gameweek is only returned for NFL fixtures.