SportsData API
Overview

SportsData API


Version: 2

The William Hill SportsData REST API is a collection of GET methods to provide William Hill product data such as sport, competition, event, market and selection data (including prices).
Summary
Method Name Description Resource
getClassesForSport Retrieves a list of classes for a given sport id. https://sandbox.whapi.com/v2/sportsdata/sports/{sportId}/classes/
getCompetition Retrieves a specific competition https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}
getCompetitionsForClass Retrieves a list of competitions for a given class id. https://sandbox.whapi.com/v2/sportsdata/classes/{classId}/competitions/
getCompetitionsForSport Retrieves a list of competitions for a given sport id. https://sandbox.whapi.com/v2/sportsdata/sports/{sportId}/competitions/
getEvent Retrieves a single event by ID. https://sandbox.whapi.com/v2/sportsdata/events/{eventId}
getEventCompetitors Retrieves competitors for a single event by ID. https://sandbox.whapi.com/v2/sportsdata/events/{eventId}/competitors
getEvents Retrieves a list of events for the provided IDs. https://sandbox.whapi.com/v2/sportsdata/events/
getEventsForClass Retrieves a list of events for a given class id. 'includeAllDescendants' parameter should be accompanied with 'date' filter or one of 'dateFrom' and 'dateTo' filters. https://sandbox.whapi.com/v2/sportsdata/classes/{classId}/events/
getEventsForCompetition Retrieves a list of events for a given competition id. 'headlineSummary' and includeAllDescendants parameters should be accompanied with 'date' filter or one of 'dateFrom' and 'dateTo' filters. https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}/events/
getMarketGroupsForCompetition Retrieves a list of market groups for a given competition id https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}/marketgroups/
getMarkets Retrieves one or more specific markets. Markets with Live at the end are always In-Play markets. However, not ALL In-Play markets have Live at the end of the market name. https://sandbox.whapi.com/v2/sportsdata/events/{eventId}/markets/
getMarketsByGroupId Retrieves a list of events/markets/selections where markets within said event match selected sort/groupId https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}/marketsByGroupid
getSelections Retrieves one or more selections for a market https://sandbox.whapi.com/v2/sportsdata/events/{eventId}/markets/{marketId}/selections/
getSports Gets a list of all sports https://sandbox.whapi.com/v2/sportsdata/sports/
getTopBets Retrieves a weighted list of Selections. https://sandbox.whapi.com/v2/sportsdata/topbets/
Resources Expand All Collapse All
getClassesForSport()
Retrieves a list of classes for a given sport id.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/sports/{sportId}/classes/?isPublished=yes&fields=id,name,status&include=channels&exclude=order&displayed=yes&channel=I&status=A&sort=name,desc&offset=10&limit=20&culture=de-DE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
sportId*
header parameters
Name Description
apiKey*
query parameters
Name Description
isPublished
fields
include
exclude
displayed
channel
status
sort
offset
limit
culture
Responses Expand All Collapse All
getCompetition()
Retrieves a specific competition
Request Example
get https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}?fields=id,name,status&include=channels&exclude=order&culture=de-DE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
competitionId*
header parameters
Name Description
apiKey*
query parameters
Name Description
fields
include
exclude
culture
Responses Expand All Collapse All
getCompetitionsForClass()
Retrieves a list of competitions for a given class id.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/classes/{classId}/competitions/?isPublished=yes&fields=id,name,status&include=channels&exclude=order&displayed=yes&channel=I&status=A&sort=name,desc&offset=10&limit=20&culture=de-DE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
classId*
header parameters
Name Description
apiKey*
query parameters
Name Description
isPublished
fields
include
exclude
displayed
channel
status
sort
offset
limit
culture
Responses Expand All Collapse All
getCompetitionsForSport()
Retrieves a list of competitions for a given sport id.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/sports/{sportId}/competitions/?isPublished=yes&fields=id,name,status&include=channels&exclude=order&displayed=yes&channel=I&status=A&sort=name,desc&offset=10&limit=20&culture=de-DE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
sportId*
header parameters
Name Description
apiKey*
query parameters
Name Description
isPublished
fields
include
exclude
displayed
channel
status
sort
offset
limit
culture
Responses Expand All Collapse All
getEvent()
Retrieves a single event by ID.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/events/{eventId}?includeAllDescendants=true&fields=id,name,status&include=channels&exclude=order&headlineSummary=true&marketCount=10&marketIds=OB_MA1, OB_MA2&includeEmpty=true&culture=de-DE&marketPublished=yes&marketStatus=A&marketDisplayed=yes&marketChannel=I&marketSort=MR&marketEW=yes&selectionStatus=A&selectionChannel=I&selectionPublished=yes HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
eventId*
header parameters
Name Description
apiKey*
query parameters
Name Description
includeAllDescendants
fields
include
exclude
headlineSummary
marketCount
marketIds
includeEmpty
culture
marketPublished
marketStatus
marketDisplayed
marketChannel
marketSort
marketEW
selectionStatus
selectionChannel
selectionPublished
Responses Expand All Collapse All
getEventCompetitors()
Retrieves competitors for a single event by ID.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/events/{eventId}/competitors?fields=id,name,status&include=channels&exclude=order HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
eventId*
header parameters
Name Description
apiKey*
query parameters
Name Description
fields
include
exclude
Responses Expand All Collapse All
getEvents()
Retrieves a list of events for the provided IDs.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/events/?ids=OB_OU1,OB_OU2&isPublished=yes&includeAllDescendants=true&fields=id,name,status&include=channels&exclude=order&channel=I&settled=true&includeEmpty=true&headlineSummary=true&marketCount=10&sort=name,desc&offset=10&limit=20&marketIds=OB_MA1, OB_MA2&culture=de-DE&marketPublished=yes&marketStatus=A&marketDisplayed=yes&marketChannel=I&marketSort=MR&marketEW=yes&selectionStatus=A&selectionChannel=I&selectionPublished=yes HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
header parameters
Name Description
apiKey*
query parameters
Name Description
ids
isPublished
includeAllDescendants
fields
include
exclude
channel
settled
includeEmpty
headlineSummary
marketCount
sort
offset
limit
marketIds
culture
marketPublished
marketStatus
marketDisplayed
marketChannel
marketSort
marketEW
selectionStatus
selectionChannel
selectionPublished
Responses Expand All Collapse All
getEventsForClass()
Retrieves a list of events for a given class id. 'includeAllDescendants' parameter should be accompanied with 'date' filter or one of 'dateFrom' and 'dateTo' filters.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/classes/{classId}/events/?isPublished=yes&fields=id,name,status&include=channels&exclude=order&displayed=yes&channel=I&settled=true&includeEmpty=true&status=A&sort=name,desc&offset=10&limit=20&headlineSummary=true&includeAllDescendants=true&isInPlay=true&marketCount=10&date=2015-10-10&dateFrom=2015-10-10T13:13:01&dateTo=2015-10-10T13:20:01&eventSort=MTCH&culture=de-DE&marketPublished=yes&marketStatus=A&marketDisplayed=yes&marketChannel=I&marketSort=MR&marketEW=yes&selectionStatus=A&selectionChannel=I&selectionPublished=yes HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
classId*
header parameters
Name Description
apiKey*
query parameters
Name Description
isPublished
fields
include
exclude
displayed
channel
settled
includeEmpty
status
sort
offset
limit
headlineSummary
includeAllDescendants
isInPlay
marketCount
date
dateFrom
dateTo
eventSort
culture
marketPublished
marketStatus
marketDisplayed
marketChannel
marketSort
marketEW
selectionStatus
selectionChannel
selectionPublished
Responses Expand All Collapse All
getEventsForCompetition()
Retrieves a list of events for a given competition id. 'headlineSummary' and includeAllDescendants parameters should be accompanied with 'date' filter or one of 'dateFrom' and 'dateTo' filters.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}/events/?isPublished=yes&fields=id,name,status&include=channels&exclude=order&displayed=yes&channel=I&settled=true&includeEmpty=true&status=A&sort=name,desc&offset=10&limit=20&headlineSummary=true&includeAllDescendants=true&isInPlay=true&marketCount=10&date=2015-10-10&dateFrom=2015-10-10T13:13:01&dateTo=2015-10-10T13:20:01&marketGroupId=OB_MG123&eventSort=MTCH&culture=de-DE&marketPublished=yes&marketStatus=A&marketDisplayed=yes&marketChannel=I&marketSort=MR&marketEW=yes&selectionStatus=A&selectionChannel=I&selectionPublished=yes HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
competitionId*
header parameters
Name Description
apiKey*
query parameters
Name Description
isPublished
fields
include
exclude
displayed
channel
settled
includeEmpty
status
sort
offset
limit
headlineSummary
includeAllDescendants
isInPlay
marketCount
date
dateFrom
dateTo
marketGroupId
eventSort
culture
marketPublished
marketStatus
marketDisplayed
marketChannel
marketSort
marketEW
selectionStatus
selectionChannel
selectionPublished
Responses Expand All Collapse All
getMarketGroupsForCompetition()
Retrieves a list of market groups for a given competition id
Request Example
get https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}/marketgroups/?fields=id,name,status&include=channels&exclude=order&sort=name,desc&offset=10&limit=20&culture=de-DE&name=MARKETGROUP1 HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
competitionId*
header parameters
Name Description
apiKey*
query parameters
Name Description
fields
include
exclude
sort
offset
limit
culture
name
Responses Expand All Collapse All
getMarkets()
Retrieves one or more specific markets. Markets with Live at the end are always In-Play markets. However, not ALL In-Play markets have Live at the end of the market name.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/events/{eventId}/markets/?ids=OB_OU1,OB_OU2&includeAllDescendants=true&fields=id,name,status&include=channels&exclude=order&includeEmpty=true&culture=de-DE&marketPublished=yes&marketStatus=A&marketDisplayed=yes&marketChannel=I&marketSort=MR&marketEW=yes&selectionStatus=A&selectionChannel=I&selectionPublished=yes HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
eventId*
header parameters
Name Description
apiKey*
query parameters
Name Description
ids
includeAllDescendants
fields
include
exclude
includeEmpty
culture
marketPublished
marketStatus
marketDisplayed
marketChannel
marketSort
marketEW
selectionStatus
selectionChannel
selectionPublished
Responses Expand All Collapse All
getMarketsByGroupId()
Retrieves a list of events/markets/selections where markets within said event match selected sort/groupId
Request Example
get https://sandbox.whapi.com/v2/sportsdata/competitions/{competitionId}/marketsByGroupid?fields=id,name,status&include=channels&exclude=order&marketSort=MR&marketGroupId=OB_MG123 HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
competitionId*
header parameters
Name Description
apiKey*
query parameters
Name Description
fields
include
exclude
marketSort*
marketGroupId*
Responses Expand All Collapse All
getSelections()
Retrieves one or more selections for a market
Request Example
get https://sandbox.whapi.com/v2/sportsdata/events/{eventId}/markets/{marketId}/selections/?ids=OB_OU1,OB_OU2&fields=id,name,status&include=channels&exclude=order&culture=de-DE&selectionStatus=A&selectionChannel=I&selectionPublished=yes HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
path parameters
Name Description
eventId*
marketId*
header parameters
Name Description
apiKey*
query parameters
Name Description
ids
fields
include
exclude
culture
selectionStatus
selectionChannel
selectionPublished
Responses Expand All Collapse All
getSports()
Gets a list of all sports
Request Example
get https://sandbox.whapi.com/v2/sportsdata/sports/?sort=name,desc&offset=10&isPublished=yes&limit=20&fields=id,name,status&include=channels&exclude=order&culture=de-DE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
header parameters
Name Description
apiKey*
query parameters
Name Description
sort
offset
isPublished
limit
fields
include
exclude
culture
Responses Expand All Collapse All
getTopBets()
Retrieves a weighted list of Selections.
Request Example
get https://sandbox.whapi.com/v2/sportsdata/topbets/?sportIds=OB_SP1, OB_SP2&competitionIds=OB_TY1, OB_TY2&limit=20&fields=id,name,status&include=channels&exclude=order¶mTopBetEventId=OB_EV1, OB_EV1,OB_EV2&sortName=MR&culture=de-DE&locale=de-DE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx

Request Parameters
header parameters
Name Description
apiKey*
query parameters
Name Description
sportIds
competitionIds
limit
fields
include
exclude
paramTopBetEventId
sortName
culture
locale
Responses Expand All Collapse All
HEAD and OPTIONS
You can call the following idempotent REST methods on all version 2 APIs:

HEAD

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The metainformation contained in the HTTP headers in response to a HEAD request is identical to the information sent in response to a GET request. This method is often used for testing hypertext links for validity, accessibility, and recent modification. The response to a HEAD request may be cacheable in the sense that the information contained in the response can be used to update a previously cached entity from that resource. If the new field values indicate that the cached entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or Last-Modified), then the cache treats the cache entry as stale.

OPTIONS

The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows you to determine the options and/or requirements associated with a resource without implying a resource action or initiating a resource retrieval. Responses to this method are not cacheable. The response includes any header fields that indicate optional features. The response body also includes information about the communication options.



Copyright (c) WHG (International) Limited 2016
Generated Date: 2020-06-06T10:40:57.436+01:00
Use of this document is subject to the William Hill Partner Developer Portal Terms and Conditions.