Booking events via API
With the help of several endpoints in the API, the user is able to find a match, book or unbook it and check the currently booked matches for a selected period of time.
Selection of the event: events.index
To check the Scoutsfeed match offer, please use endpoint events.index with your unique token:
https://api.statscore.com/v2/events?scoutsfeed=yes&events_details=no&competitions_details=yes&token=YOUR_TOKEN
Basic use of this method will return all matches offered in the STATSCORE API covered in ScoutsFeed. To filter the results you can use some additional parameters in the request:
date_from - Selection datetime, format 'yyyy-mm-dd hh:mm:ss'. Date from which events should be returned. If you use a single date_from parameter you will receive all events that start in the 24 hours from the requested date
date_to - Selection datetime, format 'yyyy-mm-dd hh:mm:ss'. End date of returned events. The maximum period beetwen date_from and date_to parameter is 30 days. This rule is not valid when you use the following query parameter in your request: season_id, stage_id, group_id, participant_id
coverage_type - Determines coverage type. Possible values:
from_venue - means the scout is relaying the event directly from the stadium (max. latency 1 second)
from_tv - means the scout is relaying the event from low latency TV transmission (max. latency 6 seconds)
sport_id - Determines the sport identifier in which the events are played. Possibility to input multiple identifiers, separated by a comma. The complete list of possible sports can be retrieved using the API resource: sports.index
competition_id - Determines the competition identifier in which the events are played. Possibility to input multiple identifiers, separated by a comma. The complete list of possible competitions can be retrieved using the API resource: competitions.index
season_id - Determines the season identifier in which the events are played. Possibility to input multiple identifiers, separated by a comma. The complete list of possible seasons can be retrieved using the API resource: seasons.index
timestamp - Selection date, format UNIX_TIMESTAMP. Only changes in events that occurred or were updated after this timestamp will be returned.
Below is an example query that allows you to check offered matches for a specific time period with coverage type = from venue:
https://api.statscore.com/v2/events?token=YOUR_TOKEN&date_from=2020-12-15 00:00:00&date_to=2020-12-31 00:00:00&coverage_type=from_venue&scoutsfeed=yes
Parameters like: events_details and competitions_details used in the query does not filter data, but only determines if subnodes of events and competitions will be visible.
More details in the events.index endpoint documentation.
Booking of the event: booked-events.create
To book a match, use the POST method for the booked-events.create endpoint with your unique token. In order for the match to be booked correctly, the basic request should be extended with several required parameters:
product - Required value=scoutsfeed
event_id - The requested event identifier. Could be found in the events.index method described above
client_id - Assigned to you by the API administrator
Below is an example query that allows you to book the selected match:
https://api.statscore.com/v2/booked-events?token=YOUR_TOKEN&product=scoutsfeed&event_id=2750161&client_id=YOUR_CLIENT_ID
More details in the booked-events.create endpoint documentation.
Unbooking of the event: booked-events.delete
To unbook a match, use the DELETE method for the booked-events.delete endpoint (with your unique token) which contains the event_id of the event to be unbooked. In order for the match to be unbooked correctly, the basic request should be extended with several required parameters:
product - Required value =scoutsfeed
client_id - Assigned to you by the API administrator
Below is an example query that allows you to book the selected match:
https://api.statscore.com/v2/booked-events/2750161?token=YOUR_TOKEN&product=scoutsfeed&client_id=YOUR_CLIENT_ID
More details in the booked-events.delete endpoint documentation.
Returning of the events booked by the client: booked-events
To return the list of booked events, use the GET method for the booked-events endpoint with your unique token: In order to return the list of booked events, the basic request should be extended with several required parameters:
product - Required value =scoutsfeed
client_id - Assigned to you by the API administrator
Below is an example query that allows you to book selected match:
https://api.statscore.com/v2/booked-events?client_id=YOUR_CLIENT_ID&token=YOUR_TOKEN&product=scoutsfeed
More details in the booked-events.index endpoint documentation.