# Event Facts

Sport facts related endpoints

## Get recommended markets

> Returns facts along with recommended markets when available\
> \
> {% hint style="info" %}\
> \
> \## Get recommended markets example\
> \
> \
> In this example we return facts for the given event.\
> \
> \`\`\`bash\
> $ curl --request GET \\\
> &#x20; \--url '<http://api.vaix.ai/api/sports/facts/recommended\\_markets?event\\_ids=sr%3Amatch%3A42948647'\\>
> \`\`\`\
> \
> {% endhint %}\ <br>

````json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"Sport facts related endpoints","name":"Event Facts"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"FactsRecommendedMarkets":{"additionalProperties":false,"description":"A live fact object with its recommended markets","properties":{"event_id":{"description":"The unique event id","type":"string"},"event_state":{"description":"The state of the event at the time the fact occurred","type":"object"},"fact_type":{"description":"The type of fact","type":"string"},"market_recommendations":{"description":"The recommended markets of the given fact","items":{"properties":{"market":{"description":"The `market`","nullable":true,"type":"string"},"market_id":{"description":"The `market`'s id","nullable":true,"type":"number"},"market_type_id":{"description":"The `market_type`'s id","nullable":true,"type":"number"},"selection":{"description":"The recommended selection for this market, if available","nullable":true,"type":"object"},"text":{"description":"The text representation of the market, when available","type":"string"}},"type":"object"},"type":"array"},"minute":{"description":"How many minutes since the event started that the fact occurred","type":"integer"},"player_id":{"description":"The id of the player the fact concerns, if applicable","nullable":true,"type":"string"},"player_name":{"description":"The name of the player the fact concerns, if applicable","nullable":true,"type":"string"},"seconds":{"description":"How many seconds since the event started that the fact occurred","type":"integer"},"sport":{"description":"The sport of the event, e.g. `soccer`","nullable":true,"type":"string"},"sport_id":{"description":"The id of the event's sport","nullable":true,"type":"string"},"team":{"description":"The name of the team the fact concerns","type":"string"},"timestamp":{"description":"The timestamp when the fact occurred","format":"date-time","type":"string"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/sports/facts/recommended_markets":{"get":{"description":"Returns facts along with recommended markets when available\n\n{% hint style=\"info\" %}\n\n## Get recommended markets example\n\n\nIn this example we return facts for the given event.\n\n```bash\n$ curl --request GET \\\n  --url 'http://api.vaix.ai/api/sports/facts/recommended_markets?event_ids=sr%3Amatch%3A42948647'\n```\n\n{% endhint %}\n\n","operationId":"get_facts_with_recommendations","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"The minimum timestamp for the facts. If not explicitly set it defaults to `now`.","in":"query","name":"from","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Considers facts occurring after the from timestamp plus the given\nseconds/minutes/hours/days. If not set, defaults to `-1 minutes`.\nThe value must be in range [-7d - 7d].\n","in":"query","name":"from_offset","required":false,"schema":{"default":"-1m","pattern":"^[+-]?[0-9]+([.][0-9]+)?[smhd]?$","type":"string"}},{"description":"Considers facts occurring till the `from` timestamp plus the given\nseconds/minutes/hours/days. If not set, defaults to `0 minutes`.\nThe value must be in range [`-7d` - `7d`].\n","in":"query","name":"to_offset","required":false,"schema":{"default":"0m","pattern":"^[+-]?[0-9]+([.][0-9]+)?[smhd]?$","type":"string"}},{"description":"Optional filtering of the facts to retrieve. It expects a string\nadhering to the filtering format, as described in the filtering\nsection.\n","in":"query","name":"filters","required":false,"schema":{"enum":["event_id","sport_id","name","type_id","fact_type"],"type":"string"}},{"description":"Number of facts to return.\n","in":"query","name":"count","required":false,"schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The user to get recommendations for.","in":"query","name":"user","required":false,"schema":{"type":"string"}},{"description":"A list of specific facts to get recommendations for.","in":"query","name":"facts","required":false,"schema":{"type":"string"}},{"description":"The number of recommendations to return per fact.\n","in":"query","name":"recommendations_count","required":false,"schema":{"default":1,"maximum":5,"minimum":1,"type":"integer"}},{"description":"The operator to use for querying data. Notice that this is applied only\nif your account has access to multiple operators. In a different case\nthe assigned operator to your account is used and the value of this\nfield is ignored.\n","in":"query","name":"operator","required":false,"schema":{"type":"string"}},{"description":"The bookmaker id to use for querying data. Notice that this is applied only\nif your account has access to multiple operators. In a different case\nthe assigned operator to your account is used and the value of this\nfield is ignored. Note that this parameter is used together with the\n`sub_bookmaker_id` parameter.\n","in":"query","name":"bookmaker_id","required":false,"schema":{"type":"integer"}},{"description":"The sub-bookmaker id to use for querying data. Notice that this is applied only\nif your account has access to multiple operators. In a different case\nthe assigned operator to your account is used and the value of this\nfield is ignored. Note that this parameter is used together with the\n`bookmaker_id` parameter.\n","in":"query","name":"sub_bookmaker_id","required":false,"schema":{"type":"integer"}},{"description":"The location of the page where the request takes place.\n","in":"query","name":"location","required":false,"schema":{"type":"string"}},{"description":"Optional selection of the object fields to retrieve. It expects a comma\nseparated list of strings, as described in the field selection section,\ne.g. `id,event_id`.\n","in":"query","name":"fields","required":false,"schema":{"default":"event_id,fact_type,team,player_id,player_name,minute,timestamp,sport_id,sport,market_recommendations","enum":["id","event_id","fact_type","name","type_id","timestamp","team","player_id","player_name","minute","seconds","event_state","sport_id","sport","market_recommendations"],"type":"string"}},{"description":"The columns to sort the results by. It expects a string adhering to\nthe ordering format, as described in the ordering section, e.g.\n`+event_id,-fact_type`.\n","in":"query","name":"order_by","required":false,"schema":{"default":"+event_id,-timestamp","enum":["event_id","fact_type","timestamp"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/FactsRecommendedMarkets"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get recommended markets","tags":["Event Facts"]}}}}
````

## Get recommended markets for the given fact

> Return recommended markets for the provided fact type.\
> \
> {% hint style="info" %}\
> \
> \## Supported facts\
> \
> \
> The fact types that are supported are the following:\
> \
> \<details>\
> &#x20; \<summary>\`Football\`\</summary>\
> \- match\_about\_to\_start\
> \- game\_start\
> \- half\_time\
> \- second\_half\_start\
> \- goal\
> \- corner\
> \- yellow\_card\
> \- red\_card\
> \- yellow\_red\_card\
> \- substitution\
> \- penalty\
> \- free\_kick\
> \- shot\_on\_target\
> \</details>\
> \
> \<details>\
> &#x20; \<summary>\`Basketball\`\</summary>\
> \- game\_start\
> \- second\_quarter\_start\
> \- third\_quarter\_start\
> \- fourth\_quarter\_start\
> \- timeout\
> \- three\_points\_scored\
> \</details>\
> \
> \<details>\
> &#x20; \<summary>\`Baseball\`\</summary>\
> \- 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\
> \</details>\
> \
> \<details>\
> &#x20; \<summary>\`Ice\_hockey\`\</summary>\
> \- game\_start\
> \- second\_period\_start\
> \- third\_period\_start\
> \- goal\
> \- player\_suspension\
> \- penalty\_rewarded\
> \- timeout\
> \</details>\
> \
> \<details>\
> &#x20; \<summary>\`Tennis\`\</summary>\
> \- game\_start\
> \- second\_set\_start\
> \- third\_set\_start\
> \- fourth\_set\_start\
> \- fifth\_set\_start\
> \- point\_won\
> \- game\_won\
> \- break\_won\
> \- set\_won\
> \</details>\
> \
> \<details>\
> &#x20; \<summary>\`American\_football\`\</summary>\
> \- 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\
> \</details>\
> \
> \
> If an other fact type is provided, a fallback mechanism will\
> be used for the market recommendation picking.\
> \
> {% endhint %}\
> \
> \
> {% hint style="info" %}\
> \
> \## 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\`\
> \
> \`\`\`bash\
> $ curl --request GET \\\
> &#x20; \--url '<http://api.vaix.ai/api/sports/facts/goal/recommended\\_markets?event\\_id=sr%3Amatch%3A42948647\\&user=123'\\>
> \`\`\`recommended\_markets\_of\_fact\
> \
> {% endhint %}\ <br>

````json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"Sport facts related endpoints","name":"Event Facts"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"FactRecommendedMarkets":{"additionalProperties":false,"description":"Recommended markets for a live fact","properties":{"market_recommendations":{"description":"The recommended markets of the given fact","items":{"properties":{"market":{"description":"The `market`","nullable":true,"type":"string"},"market_id":{"description":"The `market`'s id","nullable":true,"type":"number"},"market_type_id":{"description":"The `market_type`'s id","nullable":true,"type":"number"},"selection":{"description":"The recommended selection for this market, if available","nullable":true,"type":"object"},"text":{"description":"The text representation of the market, when available","type":"string"}},"type":"object"},"type":"array"},"sport":{"description":"The sport of the event, e.g. `soccer`","nullable":true,"type":"string"},"sport_id":{"description":"The id of the event's sport","nullable":true,"type":"string"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/sports/facts/{fact}/recommended_markets":{"get":{"description":"Return recommended markets for the provided fact type.\n\n{% hint style=\"info\" %}\n\n## Supported facts\n\n\nThe fact types that are supported are the following:\n\n<details>\n  <summary>`Football`</summary>\n- match_about_to_start\n- game_start\n- half_time\n- second_half_start\n- goal\n- corner\n- yellow_card\n- red_card\n- yellow_red_card\n- substitution\n- penalty\n- free_kick\n- shot_on_target\n</details>\n\n<details>\n  <summary>`Basketball`</summary>\n- game_start\n- second_quarter_start\n- third_quarter_start\n- fourth_quarter_start\n- timeout\n- three_points_scored\n</details>\n\n<details>\n  <summary>`Baseball`</summary>\n- game_start\n- first_inning_start\n- second_inning_start\n- third_inning_start\n- fourth_inning_start\n- fifth_inning_start\n- sixth_inning_start\n- seventh_inning_start\n- eighth_inning_start\n- ninth_inning_start\n- hit\n- batter_out\n- foul_ball\n- home_run\n- run\n- strike\n</details>\n\n<details>\n  <summary>`Ice_hockey`</summary>\n- game_start\n- second_period_start\n- third_period_start\n- goal\n- player_suspension\n- penalty_rewarded\n- timeout\n</details>\n\n<details>\n  <summary>`Tennis`</summary>\n- game_start\n- second_set_start\n- third_set_start\n- fourth_set_start\n- fifth_set_start\n- point_won\n- game_won\n- break_won\n- set_won\n</details>\n\n<details>\n  <summary>`American_football`</summary>\n- match_started\n- match_ended\n- second_quarter_start\n- third_quarter_start\n- fourth_quarter_start\n- break\n- interrupted\n- overtime\n- full_time\n- extra_time\n- first_quarter_score\n- second_quarter_score\n- third_quarter_score\n- fourth_quarter_score\n- field_goal_result\n- fumble\n- new_first_down\n- touchdown\n- two_point_conversion\n</details>\n\n\nIf an other fact type is provided, a fallback mechanism will\nbe used for the market recommendation picking.\n\n{% endhint %}\n\n\n{% hint style=\"info\" %}\n\n## Get recommended markets for a fact\n\n\nIn this example we return recommended markets for the user `123`, based\non the `goal` fact that occurred in the event with id `sr:match:42948647`\n\n```bash\n$ curl --request GET \\\n  --url 'http://api.vaix.ai/api/sports/facts/goal/recommended_markets?event_id=sr%3Amatch%3A42948647&user=123'\n```recommended_markets_of_fact\n\n{% endhint %}\n\n","operationId":"get_fact_recommendations","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"The fact to get recommended markets for","in":"path","name":"fact","required":true,"schema":{"type":"string"}},{"description":"The minimum timestamp for the facts. If not explicitly set it defaults to `now`.","in":"query","name":"from","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"The user to get recommendations for.","in":"query","name":"user","required":true,"schema":{"type":"string"}},{"description":"The event id the fact occured","in":"query","name":"event_id","required":true,"schema":{"type":"string"}},{"description":"Optional filtering of the markets to retrieve. It expects a string\nadhering to the filtering format, as described in the filtering\nsection.\n","in":"query","name":"filters","required":false,"schema":{"enum":["market_type","market_type_id","market","market_id","market_status","market_group_status","trade_status","trade_market_status","quote","period_id","bet_builder","market_bet_builder"],"type":"string"}},{"description":"How many markets to recommended","in":"query","name":"count","required":false,"schema":{"default":1,"maximum":10,"minimum":1,"type":"integer"}},{"description":"The category ranking to be used","in":"query","name":"category_ranking","required":false,"schema":{"default":"prematch","enum":["prematch","live"],"type":"string"}},{"description":"How many retries to perform in order to fetch the recommended markets.\nIf not set, one try will only be performed.\n","in":"query","name":"retries","required":false,"schema":{"default":0,"maximum":10,"minimum":0,"type":"integer"}},{"description":"How many milliseconds to wait until trying to fetch the recommended markets again.\nIf `retries` is less than 1, this value will be ignored.\n","in":"query","name":"retry_timeout","required":false,"schema":{"default":1000,"maximum":10000,"minimum":0,"type":"integer"}},{"description":"If set to `:market` it will return the whole market, if set to `:selection` it will return\nonly the selection. Defaults to :selection\n","in":"query","name":"type","required":false,"schema":{"default":"selection","enum":["market","selection"],"type":"string"}},{"description":"The maximum number of times that the same market will be recommended in a row. Notice\nthat this does not affect the total number of times a market is recommended if other\nmarkets have been recommended in between. If 0 (the default), then no limit is applied.\n","in":"query","name":"consecutive_limit","required":false,"schema":{"default":0,"maximum":10,"minimum":0,"type":"integer"}},{"description":"The operator to use for querying data. Notice that this is applied only\nif your account has access to multiple operators. In a different case\nthe assigned operator to your account is used and the value of this\nfield is ignored.\n","in":"query","name":"operator","required":false,"schema":{"type":"string"}},{"description":"The bookmaker id to use for querying data. Notice that this is applied only\nif your account has access to multiple operators. In a different case\nthe assigned operator to your account is used and the value of this\nfield is ignored. Note that this parameter is used together with the\n`sub_bookmaker_id` parameter.\n","in":"query","name":"bookmaker_id","required":false,"schema":{"type":"integer"}},{"description":"The sub-bookmaker id to use for querying data. Notice that this is applied only\nif your account has access to multiple operators. In a different case\nthe assigned operator to your account is used and the value of this\nfield is ignored. Note that this parameter is used together with the\n`bookmaker_id` parameter.\n","in":"query","name":"sub_bookmaker_id","required":false,"schema":{"type":"integer"}},{"description":"List of event types to consider when generating recommendations.\nOne or more types can be provided.\nAvailable options are:\n* `match`: Standard matches to be considered.\n* `seasonal`: Seasonal events to be considered.\n* `forced_events`: Handpicked events to be considered regardless of their start_time.\n","in":"query","name":"event_types","required":false,"schema":{"default":"match,forced_events","enum":["match","seasonal","forced_events"],"type":"string"}},{"description":"The location of the page where the request takes place.\n","in":"query","name":"location","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"$ref":"#/components/schemas/FactRecommendedMarkets"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get recommended markets for the given fact","tags":["Event Facts"]}}}}
````

## Get participants' previous event stats

> Returns the average of the fact statistics of previous events for the participants\
> of each of the given event\_ids.\
> \
> {% hint style="info" %}\
> \
> \## Limiting history size example\
> \
> \
> In this example we only return the stats from each participant's last match.\
> \
> \`\`\`bash\
> $ curl --request GET \\\
> &#x20; \--url '<http://api.vaix.ai/api/sports/participants/stats?event\\_ids=sr%3Amatch%3A42948647\\&history\\_size=1'\\>
> \`\`\`\
> \
> {% endhint %}\ <br>

````json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"Sport facts related endpoints","name":"Event Facts"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"ParticipantStats":{"additionalProperties":false,"description":"A participant stats object","properties":{"away_cards":{"description":"Card stats per event for the away theam","type":"number"},"away_corner_kicks":{"description":"Corner kicks stats per event for the away theam","type":"number"},"away_halftime":{"description":"Halftime score per event for the away theam","type":"number"},"away_total":{"description":"Total score per event for the away theam","type":"number"},"event_id":{"description":"The unique event id","type":"string"},"home_cards":{"description":"Card stats per event for the home theam","type":"number"},"home_corner_kicks":{"description":"Corner kicks stats per event for the home theam","type":"number"},"home_halftime":{"description":"Halftime score per event for the home theam","type":"number"},"home_total":{"description":"Total score per event for the home theam","type":"number"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/sports/participants/stats":{"get":{"description":"Returns the average of the fact statistics of previous events for the participants\nof each of the given event_ids.\n\n{% hint style=\"info\" %}\n\n## Limiting history size example\n\n\nIn this example we only return the stats from each participant's last match.\n\n```bash\n$ curl --request GET \\\n  --url 'http://api.vaix.ai/api/sports/participants/stats?event_ids=sr%3Amatch%3A42948647&history_size=1'\n```\n\n{% endhint %}\n\n","operationId":"get_participant_stats","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"Comma separated list of event ids whose participants' previous\nevent stats to return.\n","in":"query","name":"event_ids","required":true,"schema":{"type":"string"}},{"description":"The stats of which team or teams to return, home or away. Defaults to both.\n","in":"query","name":"teams","required":false,"schema":{"default":"home,away","enum":["home","away"],"type":"string"}},{"description":"The number of previous events whose stats to return.","in":"query","name":"history_size","required":false,"schema":{"default":3,"maximum":20,"minimum":1,"type":"integer"}},{"description":"Optional selection of the object fields to retrieve. It expects a comma\nseparated list of strings, as described in the field selection section,\ne.g. `event_id,total`.\n","in":"query","name":"fields","required":false,"schema":{"default":"event_id,total,halftime,cards,corner_kicks","enum":["event_id","total","halftime","cards","corner_kicks"],"type":"string"}},{"description":"The location of the page where the request takes place.\n","in":"query","name":"location","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/ParticipantStats"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get participants' previous event stats","tags":["Event Facts"]}}}}
````

## Get event facts

> Returns available facts from the given time frame\
> \
> {% hint style="info" %}\
> \
> \## Get facts example\
> \
> \
> In this example we return facts for the given event.\
> \
> \`\`\`bash\
> $ curl --request GET \\\
> &#x20; \--url '<http://api.vaix.ai/api/sports/facts?event\\_ids=sr%3Amatch%3A42948647'\\>
> \`\`\`\
> \
> {% endhint %}\ <br>

````json
{"openapi":"3.0.1","info":{"title":"","version":"0.1.0"},"tags":[{"description":"Sport facts related endpoints","name":"Event Facts"}],"servers":[{"description":"Production API","url":"https://api.vaix.ai"},{"description":"Staging (integration) API","url":"https://staging-api.vaix.ai"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"Facts":{"additionalProperties":false,"description":"A live fact object","properties":{"event_id":{"description":"The unique event id","type":"string"},"event_state":{"description":"The state of the event at the time the fact occurred","type":"object"},"fact_type":{"description":"The type of fact","type":"string"},"minute":{"description":"How many minutes since the event started that the fact occurred","type":"integer"},"player_id":{"description":"The id of the player the fact concerns, if applicable","nullable":true,"type":"string"},"player_name":{"description":"The name of the player the fact concerns, if applicable","nullable":true,"type":"string"},"seconds":{"description":"How many seconds since the event started that the fact occurred","type":"integer"},"sport":{"description":"The sport of the event, e.g. `soccer`","nullable":true,"type":"string"},"sport_id":{"description":"The id of the event's sport","nullable":true,"type":"string"},"team":{"description":"The name of the team the fact concerns","type":"string"},"timestamp":{"description":"The timestamp when the fact occurred","format":"date-time","type":"string"}},"type":"object"},"Error":{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},"Errors":{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"},"UnprocessableEntityError":{"oneOf":[{"additionalProperties":false,"description":"The generic API's error response","properties":{"error":{"description":"Description of the error","type":"string"},"status":{"description":"response status","type":"string"}},"type":"object"},{"additionalProperties":false,"description":"The generic API's errors response","properties":{"errors":{"description":"An object with the request errors","type":"object"}},"type":"object"}]}}},"paths":{"/api/sports/facts":{"get":{"description":"Returns available facts from the given time frame\n\n{% hint style=\"info\" %}\n\n## Get facts example\n\n\nIn this example we return facts for the given event.\n\n```bash\n$ curl --request GET \\\n  --url 'http://api.vaix.ai/api/sports/facts?event_ids=sr%3Amatch%3A42948647'\n```\n\n{% endhint %}\n\n","operationId":"get_events_facts","parameters":[{"description":"Custom client header, the value should be the name of the group the user belongs to","in":"header","name":"x-vaix-client-id","required":true,"schema":{"type":"string"}},{"description":"Authentication method to be used, supported values [`vaix`, `iam`]. Defaults to `vaix`","in":"header","name":"x-vaix-authentication-method","required":false,"schema":{"type":"string"}},{"description":"The minimum timestamp for the facts. If not explicitly set it defaults to `now`.","in":"query","name":"from","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Considers facts occurring after the from timestamp plus the given\nseconds/minutes/hours/days. If not set, defaults to `-1 minutes`.\nThe value must be in range [-7d - 7d].\n","in":"query","name":"from_offset","required":false,"schema":{"default":"-1m","pattern":"^[+-]?[0-9]+([.][0-9]+)?[smhd]?$","type":"string"}},{"description":"Considers facts occurring till the `from` timestamp plus the given\nseconds/minutes/hours/days. If not set, defaults to `0 minutes`.\nThe value must be in range [`-7d` - `7d`].\n","in":"query","name":"to_offset","required":false,"schema":{"default":"0m","pattern":"^[+-]?[0-9]+([.][0-9]+)?[smhd]?$","type":"string"}},{"description":"Optional filtering of the facts to retrieve. It expects a string\nadhering to the filtering format, as described in the filtering\nsection.\n","in":"query","name":"filters","required":false,"schema":{"enum":["event_id","sport_id","name","type_id","fact_type"],"type":"string"}},{"description":"Number of facts to return.\n","in":"query","name":"count","required":false,"schema":{"default":100,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The location of the page where the request takes place.\n","in":"query","name":"location","required":false,"schema":{"type":"string"}},{"description":"Optional selection of the object fields to retrieve. It expects a comma\nseparated list of strings, as described in the field selection section,\ne.g. `id,event_id`.\n","in":"query","name":"fields","required":false,"schema":{"default":"event_id,fact_type,team,player_id,player_name,minute,timestamp,sport_id,sport","enum":["id","event_id","fact_type","name","type_id","timestamp","team","player_id","player_name","minute","seconds","event_state","sport_id","sport"],"type":"string"}},{"description":"The columns to sort the results by. It expects a string adhering to\nthe ordering format, as described in the ordering section, e.g.\n`+event_id,-fact_type`.\n","in":"query","name":"order_by","required":false,"schema":{"default":"+event_id,-timestamp","enum":["event_id","fact_type","timestamp"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"API response","properties":{"data":{"description":"Array of objects","items":{"$ref":"#/components/schemas/Facts"},"type":"array"},"status":{"description":"The status of the request","enum":["success","error"],"type":"string"}},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"406":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Not Acceptable"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityError"}}},"description":"Unprocessable Entity"},"425":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}},"description":"Too Early"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Internal Server Error"}},"summary":"Get event facts","tags":["Event Facts"]}}}}
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportradar.com/personalization/api-reference/sports/event-facts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
