Event Facts

Sport facts related endpoints

Get event facts

get
/api/sports/facts

Returns available facts from the given time frame

Get facts example

In this example we return facts for the given event.

$ curl --request GET \
  --url 'http://api.vaix.ai/api/sports/facts?event_ids=sr%3Amatch%3A42948647'
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
fromstring · date-timeOptional

The minimum timestamp for the facts. If not explicitly set it defaults to now.

from_offsetstringOptional

Considers facts occurring after the from timestamp plus the given seconds/minutes/hours/days. If not set, defaults to -1 minutes. The value must be in range [-7d - 7d].

Default: -1mExample: -1mPattern: ^[+-]?[0-9]+([.][0-9]+)?[smhd]?$
to_offsetstringOptional

Considers facts occurring till the from timestamp plus the given seconds/minutes/hours/days. If not set, defaults to 0 minutes. The value must be in range [-7d - 7d].

Default: 0mExample: 0mPattern: ^[+-]?[0-9]+([.][0-9]+)?[smhd]?$
filtersstring · enumOptional

Optional filtering of the facts to retrieve. It expects a string adhering to the filtering format, as described in the filtering section.

Example: sport_id:in:sr:sport:1,sr:sport:2Possible values:
countinteger · min: 1 · max: 100Optional

Number of facts to return.

Default: 100Example: 5
locationstringOptional

The location of the page where the request takes place.

Example: inplay_widget
fieldsstring · enumOptional

Optional selection of the object fields to retrieve. It expects a comma separated list of strings, as described in the field selection section, e.g. id,event_id.

Default: event_id,fact_type,team,minute,timestamp,sport_id,sportPossible values:
order_bystring · enumOptional

The columns to sort the results by. It expects a string adhering to the ordering format, as described in the ordering section, e.g. +event_id,-fact_type.

Default: +event_id,-timestampPossible values:
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Responses
200

OK

application/json
get
/api/sports/facts
GET /api/sports/facts HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
  "data": [
    {
      "event_id": "sr:match:21514503",
      "fact_type": "first_set",
      "minute": 10,
      "sport": null,
      "sport_id": null,
      "team": "Lazebny, Ruslan",
      "timestamp": "2020-07-02T03:00:00Z"
    },
    {
      "event_id": "sr:match:22525889",
      "fact_type": "yellow_card",
      "minute": 12,
      "sport": "Football",
      "sport_id": "sr:sport:1",
      "team": "Panathinaikos",
      "timestamp": "2020-07-02T17:02:00Z"
    },
    {
      "event_id": "sr:match:22525889",
      "fact_type": "yellow_card",
      "minute": 10,
      "sport": "Football",
      "sport_id": "sr:sport:1",
      "team": "Olympiakos",
      "timestamp": "2020-07-02T17:00:00Z"
    },
    {
      "event_id": "sr:match:22527639",
      "fact_type": "second_set",
      "minute": 20,
      "sport": null,
      "sport_id": null,
      "team": "Lazebny, Ruslan",
      "timestamp": "2020-07-02T03:10:00Z"
    }
  ],
  "status": "success"
}
get
/api/sports/facts/recommended_markets

Returns facts along with recommended markets when available

Get recommended markets example

In this example we return facts for the given event.

$ curl --request GET \
  --url 'http://api.vaix.ai/api/sports/facts/recommended_markets?event_ids=sr%3Amatch%3A42948647'
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
fromstring · date-timeOptional

The minimum timestamp for the facts. If not explicitly set it defaults to now.

from_offsetstringOptional

Considers facts occurring after the from timestamp plus the given seconds/minutes/hours/days. If not set, defaults to -1 minutes. The value must be in range [-7d - 7d].

Default: -1mExample: -1mPattern: ^[+-]?[0-9]+([.][0-9]+)?[smhd]?$
to_offsetstringOptional

Considers facts occurring till the from timestamp plus the given seconds/minutes/hours/days. If not set, defaults to 0 minutes. The value must be in range [-7d - 7d].

Default: 0mExample: 0mPattern: ^[+-]?[0-9]+([.][0-9]+)?[smhd]?$
filtersstring · enumOptional

Optional filtering of the facts to retrieve. It expects a string adhering to the filtering format, as described in the filtering section.

Example: sport_id:in:sr:sport:1,sr:sport:2Possible values:
countinteger · min: 1 · max: 100Optional

Number of facts to return.

Default: 100Example: 5
userstringOptional

The user to get recommendations for.

factsstringOptional

A list of specific facts to get recommendations for.

recommendations_countinteger · min: 1 · max: 5Optional

The number of recommendations to return per fact.

Default: 1Example: 5
operatorstringOptional

The operator to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored.

bookmaker_idintegerOptional

The bookmaker id to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored. Note that this parameter is used together with the sub_bookmaker_id parameter.

sub_bookmaker_idintegerOptional

The sub-bookmaker id to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored. Note that this parameter is used together with the bookmaker_id parameter.

locationstringOptional

The location of the page where the request takes place.

Example: inplay_widget
fieldsstring · enumOptional

Optional selection of the object fields to retrieve. It expects a comma separated list of strings, as described in the field selection section, e.g. id,event_id.

Default: event_id,fact_type,team,minute,timestamp,sport_id,sport,market_recommendationsPossible values:
order_bystring · enumOptional

The columns to sort the results by. It expects a string adhering to the ordering format, as described in the ordering section, e.g. +event_id,-fact_type.

Default: +event_id,-timestampPossible values:
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Responses
200

OK

application/json
get
/api/sports/facts/recommended_markets
GET /api/sports/facts/recommended_markets HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
  "data": [
    {
      "event_id": "sr:match:22525889",
      "fact_type": "yellow_card",
      "market_recommendations": [
        {
          "market_id": null,
          "market_type_id": 1
        }
      ],
      "minute": 12,
      "sport": "Football",
      "sport_id": "sr:sport:1",
      "team": "Panathinaikos",
      "timestamp": "2020-07-02T17:02:00Z"
    },
    {
      "event_id": "sr:match:22525889",
      "fact_type": "yellow_card",
      "market_recommendations": [
        {
          "market_id": null,
          "market_type_id": 1
        }
      ],
      "minute": 10,
      "sport": "Football",
      "sport_id": "sr:sport:1",
      "team": "Olympiakos",
      "timestamp": "2020-07-02T17:00:00Z"
    }
  ],
  "status": "success"
}
get
/api/sports/facts/{fact}/recommended_markets

Return recommended markets for the provided fact type.

Supported facts

The fact types that are supported are the following:

`Football`

- game_start - half_time - second_half_start - goal - corner - yellow_card - red_card - yellow_red_card - substitution - penalty - free_kick

`Basketball`

- game_start - second_quarter_start - third_quarter_start - fourth_quarter_start - timeout - three_points_scored

`Baseball`

- game_start - first_inning_start - second_inning_start - third_inning_start - fourth_inning_start - fifth_inning_start - sixth_inning_start - seventh_inning_start - eighth_inning_start - ninth_inning_start - hit - batter_out - foul_ball - home_run - run - strike

`Ice_hockey`

- game_start - second_period_start - third_period_start - goal - player_suspension - penalty_rewarded - timeout

`Tennis`

- game_start - second_set_start - third_set_start - fourth_set_start - fifth_set_start - point_won - game_won - break_won - set_won

`American_football`

- match_started - match_ended - second_quarter_start - third_quarter_start - fourth_quarter_start - break - interrupted - overtime - full_time - extra_time - first_quarter_score - second_quarter_score - third_quarter_score - fourth_quarter_score - field_goal_result - fumble - new_first_down - touchdown - two_point_conversion

If an other fact type is provided, a fallback mechanism will be used for the market recommendation picking.

Get recommended markets for a fact

In this example we return recommended markets for the user 123, based on the goal fact that occurred in the event with id sr:match:42948647

$ curl --request GET \
  --url 'http://api.vaix.ai/api/sports/facts/goal/recommended_markets?event_id=sr%3Amatch%3A42948647&user=123'
```recommended_markets_of_fact

</div>
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
factstringRequired

The fact to get recommended markets for

Query parameters
fromstring · date-timeOptional

The minimum timestamp for the facts. If not explicitly set it defaults to now.

userstringRequired

The user to get recommendations for.

event_idstringRequired

The event id the fact occured

Example: sr:match:21514503
filtersstring · enumOptional

Optional filtering of the markets to retrieve. It expects a string adhering to the filtering format, as described in the filtering section.

Possible values:
countinteger · min: 1 · max: 10Optional

How many markets to recommended

Default: 1Example: 1
category_rankingstring · enumOptional

The category ranking to be used

Default: prematchPossible values:
retriesinteger · max: 10Optional

How many retries to perform in order to fetch the recommended markets. If not set, one try will only be performed.

Default: 0Example: 1
retry_timeoutinteger · max: 10000Optional

How many milliseconds to wait until trying to fetch the recommended markets again. If retries is less than 1, this value will be ignored.

Default: 1000Example: 1000
typestring · enumOptional

If set to :market it will return the whole market, if set to :selection it will return only the selection. Defaults to :selection

Default: selectionPossible values:
consecutive_limitinteger · max: 10Optional

The maximum number of times that the same market will be recommended in a row. Notice that this does not affect the total number of times a market is recommended if other markets have been recommended in between. If 0 (the default), then no limit is applied.

Default: 0Example: 1
operatorstringOptional

The operator to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored.

bookmaker_idintegerOptional

The bookmaker id to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored. Note that this parameter is used together with the sub_bookmaker_id parameter.

sub_bookmaker_idintegerOptional

The sub-bookmaker id to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored. Note that this parameter is used together with the bookmaker_id parameter.

event_typesstring · enumOptional

List of event types to consider when generating recommendations. One or more types can be provided. Available options are:

  • match: Standard matches to be considered.
  • seasonal: Seasonal events to be considered.
  • forced_events: Handpicked events to be considered regardless of their start_time.
Default: match,forced_eventsPossible values:
locationstringOptional

The location of the page where the request takes place.

Example: inplay_widget
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Responses
200

OK

application/json
get
/api/sports/facts/{fact}/recommended_markets
GET /api/sports/facts/{fact}/recommended_markets?user=text&event_id=text HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
  "data": {
    "market_recommendations": [
      {
        "market_id": null,
        "market_type_id": 1
      }
    ]
  },
  "status": "success"
}

Get participants' previous event stats

get
/api/sports/participants/stats

Returns the average of the fact statistics of previous events for the participants of each of the given event_ids.

Limiting history size example

In this example we only return the stats from each participant's last match.

$ curl --request GET \
  --url 'http://api.vaix.ai/api/sports/participants/stats?event_ids=sr%3Amatch%3A42948647&history_size=1'
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
event_idsstringRequired

Comma separated list of event ids whose participants' previous event stats to return.

Example: sr:match:21514503,sr:match:25852926,sr:match:21516115
teamsstring · enumOptional

The stats of which team or teams to return, home or away. Defaults to both.

Default: home,awayExample: home,awayPossible values:
history_sizeinteger · min: 1 · max: 20Optional

The number of previous events whose stats to return.

Default: 3Example: 3
fieldsstring · enumOptional

Optional selection of the object fields to retrieve. It expects a comma separated list of strings, as described in the field selection section, e.g. event_id,total.

Default: event_id,total,halftime,cards,corner_kicksPossible values:
locationstringOptional

The location of the page where the request takes place.

Example: inplay_widget
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Responses
200

OK

application/json
get
/api/sports/participants/stats
GET /api/sports/participants/stats?event_ids=text HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
  "data": [
    {
      "away_cards": 1,
      "away_corner_kicks": 0,
      "away_halftime": 1,
      "away_total": 1,
      "event_id": "sr:match:22525889",
      "home_cards": 1,
      "home_corner_kicks": 0,
      "home_halftime": 1,
      "home_total": 1
    }
  ],
  "status": "success"
}

Was this helpful?