Another way to book matches is to use the API directly. 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=YOURTOKENYOUR_TOKEN
Basic use of this method will return all matches offered in the STATSCORE API , so you should extend the query with a few key parameters:
...
scoutsfeed - Required value = yes. The parameter will return only events available in Scoutsfeed.
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)
The query can be extended with some additional parameters:
- events_details - Determines if subnodes of events will be visible. Possible values:
yes - events subnodes will be shown
no - events subnodes will not be shown
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.
...
https://api.statscore.com/v2/events?token=YOURTOKENYOUR_TOKEN&date_from=2020-12-15 00:00:00&date_to=2020-12-31 00:00:00&coverage_type=from_venue&scoutsfeed=yes
Info |
---|
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. |
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:https://api. statscore.com/v2/events?token=YOURTOKEN 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
...
https://api.statscore.com/v2/booked-events?token=YOURTOKENYOUR_TOKEN&product=scoutsfeed&event_id=2750161&client_id=XXXYOUR_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:https://api.statscore. com/v2/booked-events/{event_id}?token=YOURTOKEN 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
...
https://api.statscore.com/v2/booked-events/2750161?token=YOURTOKENYOUR_TOKEN&product=scoutsfeed&client_id=XXXYOUR_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 .show endpoint with your unique token:https: //api.statscore.com/v2/booked-events?&token=YOURTOKEN 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
...
https://api.statscore.com/v2/booked-events?client_id=XXXYOUR_CLIENT_ID&token=YOURTOKENYOUR_TOKEN&product=scoutsfeed
More details in the booked-events.showindex endpoint documentation.