Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Current »

Customers are being integrated by pairing events identifiers (ID's). STATSCORE is responsible for the automatic pairing process that should cover the major of the mappings. The whole integration process is described in this document.
The only requirement for the customer is to provide us with the list of teams and events.


The teams data are being used by STATSCORE to make the “initial mapping” with the teams STATSCORE use.
Initial mapping is done only once (it’s not repetitive process).
The new teams or players will be mapped (automatically or manually) during the Events-Mapping process described below.

Teams list can be provided in the file (json, csv, xls).

Expected data is:

  • sport_id

  • sport_name

  • team_id

  • team_name

  • gender (optional)

  • country_name (optioinal)

At this step it is good to check and answer on below questions:

  • are the teams duplicated in your database? Is there a single representation of for example Fc Barcelona team? Or is it maybe duplicated in various leagues? Then maybe it’s better for us to map by “team_name” not by “team_id”

  • is there a gender indicator for the teams? Maybe you are using it in the team name like: “Fc Barcelona (W)” for Womans team.

  • in case you are a Sportsbook provider - is there “generic” team_id available or we need to map all your customers separately?

JSON example

[{
"sport_id": 1,
"sport_name": "basketball",
"team_id": 222,
"team_name": "FC Barcelona",
"gender": "male", 
"country_name": "Spain"
},

{...}

CSV example

"sport_id","sport_name","team_id","team_name","gender","country_name"
”1”,”basketball”,”222”,”Fc Barcelona”,”male”,”Spain”
...


The events data are being used by STATSCORE to make the pre-match or live offer mapped with the events STATSCORE offers.
In standard integration our mapping engine will request your end-point:
- in every 10 minutes for the games from the next 3 days
- in average every 24 hours for the games from the next 2 weeks

Events list should be provided in the API. The easiest way to do it is provide STATSCORE with simple REST API end-point.
End-point request example: http://customer_domain.com/statscore-events.json?sport_id=1234&date_from=2015-09-10&date_to=2015-09-11

Expected data is:

  • event_id (it can be a string value either)

  • home_team_name

  • away_team_name

  • start_date_utc

  • home_team_id

  • away_team_name

  • competition_name

  • competition_id (optional)

  • country_name

  • country_id (optional)

  • provider_name (optional) - this may help us in the automatic mapping (it could be "betradar" / "betconstruct" / "sporting-solutions" etc.)

  • provider_event_id (optional) - this may help us in the automatic mapping

JSON example

[{
"event_id": 6726394,
"home_team_name": "Albirex Niigata FC",
"away_team_name": "Tampines Rovers FC",
"start_date_utc": "2015-09-10 11:30:00",
"home_team_id": 34081,
"away_team_id": 3043,
"sport_id": 1234,
"sport_name": "soccer",
"competition_name": "S-league",
"competition_id": 2345,
"country_name": "Singapore",
"provider_name": "betradar",
"provider_event_id": 123456789 
},
{...}


Please note:

  • The list of JSON events should be ordered by start_date that is ascending. It should start from the current date and include also "live" events that have already started.

  • The list of JSON events should be limited to prevent server overload when customers have got thousands of events in the feed. This can be achieved by using filters like:

    • Filter by dates in the query ("date_from=2015-09-10&date_to=2015-09-11).

    • Filter by sport_id separated by comma f.e. sport_id=1,3,5,7, would be good additional feature.

  • The maximum size of the JSON events should not be greater than 2 MB and if there is more data it should be paginated.

  • The maximum execution time of the JSON events should not be longer than 30 seconds.

  • In case when prematch ID is different than the inplay we need to have separate event list for both (concerns only customers who are using both products - PrematchPro and LivematchPro).


How to find mapped events?

Mapped event identifiers are provided by STATSCORE in the API method named booked-events.
Example: https://api.statscore.com/v2/booked-events?product=livescorepro&client_id=2&mapped_status=mapped
In this method customer can find his own event ID (client_event_id attribute) and corresponded STATSCORE event ID (id attribute).

Returned data is:

  • id (numeric) - STATSCORE event id that can be used in the script that displays widgets (trackers) on your front-end application.

  • client_event_id (string) - this is your internal event id mapped with above STATSCORE event id

Please note:

All the requests to the booked-events API end-point should be made from your backend server (not from the front-end).
In case when there is more that 1000 (1K) requests made within 5 minutes your IP can be automatically blocked on our Load Balancer.

Booked-evnets,json

[{
"id": 123456,
"client_event_id": "123456789",
...
},
{
"id": 567890,
"client_event_id": "qweoy28qry8r7yq83",
...
}]


  • No labels