> For the complete documentation index, see [llms.txt](https://docs.thesports.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thesports.com/thesports-docs/basic-data/real-time-data.md).

# Real-time data

## Real-time data

> Return the score,match incidents,and technical statistics data in the last 120 minutes(full update)\<br/>ps:The match data beyond 120 minutes is updated and will be returned synchronously\<br/>Suggest the request frequency:2 seconds/time\<br/>\<br/>The formula for obtaining the minutes of the match\<br/>First half:match minutes = (current timestamp-first half kick-off timestamp) / 60 + 1\<br/>Second half:match minutes = (current timestamp-second half kick-off timestamp) / 60 + 45 + 1\<br/>Overtime:match minutes = (current timestamp-overtime kick-off timestamp) / 60 + 90 + 1\<br/>Note:If the overtime kick-off timestamp returns 0, it means we don't have this data for this competition so that the time can not be calculated.\<br />\<br/>Stats:match event field description\<br/>Includes:corner,yellow card,red card,penalty,shots on target,shots off target,blocked shots,attacks,dangerous attack,ball possession\<br />\<br/>Incidents:match event field description\<br/>Includes:yellow card,card upgrade confirmed,red card,goal (assist),substitution,penalty,penalty missed,own goal,VAR,midfield,injury time,end,overtime is end,penalty kick ended

```json
{"openapi":"3.0.1","info":{"title":"Football API","version":"1.0.251028"},"tags":[{"name":"BASIC DATA","description":"BASIC DATA"}],"servers":[{"url":"https://api.thesports.com"}],"paths":{"/v1/football/match/detail_live":{"get":{"tags":["BASIC DATA"],"description":"Return the score,match incidents,and technical statistics data in the last 120 minutes(full update)<br/>ps:The match data beyond 120 minutes is updated and will be returned synchronously<br/>Suggest the request frequency:2 seconds/time<br/><br/>The formula for obtaining the minutes of the match<br/>First half:match minutes = (current timestamp-first half kick-off timestamp) / 60 + 1<br/>Second half:match minutes = (current timestamp-second half kick-off timestamp) / 60 + 45 + 1<br/>Overtime:match minutes = (current timestamp-overtime kick-off timestamp) / 60 + 90 + 1<br/>Note:If the overtime kick-off timestamp returns 0, it means we don't have this data for this competition so that the time can not be calculated.<br /><br/>Stats:match event field description<br/>Includes:corner,yellow card,red card,penalty,shots on target,shots off target,blocked shots,attacks,dangerous attack,ball possession<br /><br/>Incidents:match event field description<br/>Includes:yellow card,card upgrade confirmed,red card,goal (assist),substitution,penalty,penalty missed,own goal,VAR,midfield,injury time,end,overtime is end,penalty kick ended","summary":"Real-time data","operationId":"getMatchDetailLive","parameters":[{"$ref":"#/components/parameters/User"},{"$ref":"#/components/parameters/Secret"}],"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"results":{"type":"array","description":"Real-time data list","items":{"$ref":"#/components/schemas/MatchDetailLive"}}}}}}},"404":{"$ref":"#/components/responses/404NotFound"}}}}},"components":{"parameters":{"User":{"name":"user","in":"query","description":"Username,please contact business","required":true,"schema":{"type":"string"}},"Secret":{"name":"secret","in":"query","description":"Key,please contact business","required":true,"schema":{"type":"string"}}},"schemas":{"MatchDetailLive":{"type":"object","description":"Data details","properties":{"id":{"type":"string","description":"Match id"},"score":{"$ref":"#/deps/schemas/LiveScore"},"stats":{"type":"array","description":"Match statistics","items":{"$ref":"#/deps/schemas/LiveStats"}},"incidents":{"type":"array","description":"Match incidents","items":{"$ref":"#/deps/schemas/LiveIncidents"}},"tlive":{"type":"array","description":"Match text","items":{"$ref":"#/deps/schemas/LiveTlive"}}}}},"responses":{"404NotFound":{"description":"Resource does not exist","content":{"application/json":{"schema":{"$ref":"#/common/schemas/ErrorMsg"}}}}}},"deps":{"schemas":{"LiveScore":{"type":"array","description":"Score field description<br/>example:[\"1l4rjnh22p2wm7v\", 8, [1, 0, 0, 0, -1, 0, 0], [1, 0, 0, 0, -1, 0, 0], 0, \"\"]\n\n**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Match id | String |\n| `1` | Match status,please refer to Status Code -> Match Status | Integer |\n| `2` | Nested array; see details below | Array |\n| `3` | Nested array; see details below | Array |\n| `4` | Kick-off timestamp,kick-off time of the first/second half, overtime (judged according to the state of the match) | Integer |\n| `5` | Compatible ignore | String |\n\n**Index `2` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `2[0]` | Home Team Score (regular time) | Integer |\n| `2[1]` | Home Team Halftime score | Integer |\n| `2[2]` | Home Team Red cards | Integer |\n| `2[3]` | Home Team Yellow cards | Integer |\n| `2[4]` | Home Team Corners,-1 means no corner kick data | Integer |\n| `2[5]` | Home Team Overtime score (120 minutes,including regular time),only available in overtime | Integer |\n| `2[6]` | Home Team Penalty shootout score,only penalty shootout | Integer |\n\n**Index `3` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `3[0]` | Away Team Score (regular time) | Integer |\n| `3[1]` | Away Team Halftime score | Integer |\n| `3[2]` | Away Team Red cards | Integer |\n| `3[3]` | Away Team Yellow cards | Integer |\n| `3[4]` | Away Team Corners,-1 means no corner kick data | Integer |\n| `3[5]` | Away Team Overtime score (120 minutes,including regular time),only available in overtime | Integer |\n| `3[6]` | Away Team Penalty shootout score,only penalty shootout | Integer |\n","items":""},"LiveStats":{"type":"object","description":"Data details","properties":{"type":{"type":"integer","description":"Type,see status code -> technical statistics"},"home":{"type":"integer","description":"Home team value"},"away":{"type":"integer","description":"Away team value"}}},"LiveIncidents":{"type":"object","description":"Data details","properties":{"type":{"type":"integer","description":"Type,see status code -> technical statistics"},"position":{"type":"integer","description":"The incident occurred,0-neutral,1- home team,2- away team"},"time":{"type":"integer","description":"Time (minutes)"},"second":{"type":"integer","description":"Time (seconds)"},"add_time":{"type":"integer","description":"Add time (minutes), which is related to injury time or stoppage time and may not exist"},"not_on_pitch":{"type":"integer","description":"Whether off-field, 1-Yes (a red or yellow card incident exists)"},"person_type":{"type":"integer","description":"Personnel type, 1-Head coach, 2-Coaching staff and other team personnel (a red or yellow card incident exists)"},"miss":{"type":"integer","description":"Whether suspended, 1-Yes (a red or yellow card incident exists)"},"player_id":{"type":"string","description":"Player id related to the incident,may not exist"},"player_name":{"type":"string","description":"Player name related to the incident,may not exist"},"assist1_id":{"type":"string","description":"Assist player 1 id,related to the goal incident,may not exist"},"assist1_name":{"type":"string","description":"Assist player 1 name,related to the goal incident,may not exist"},"assist2_id":{"type":"string","description":"Assist player 2 id,related to the goal incident,may not exist"},"assist2_name":{"type":"string","description":"Assist player 2 name,related to the goal incident,may not exist"},"home_score":{"type":"integer","description":"Home team score,related to the goal incident,may not exist"},"away_score":{"type":"integer","description":"Away team score,related to the goal incident,may not exist"},"in_player_id":{"type":"string","description":"Replace the player id(Put on),which is related to the substitution incident and may not exist"},"in_player_name":{"type":"string","description":"Replace the player name(Put on),which is related to the substitution incident and may not exist"},"out_player_id":{"type":"string","description":"Replace the player id(Replace),which is related to the substitution incident and may not exist"},"out_player_name":{"type":"string","description":"Replace the player name(Replace),which is related to the substitution incident and may not exist"},"var_reason":{"type":"integer","description":"VAR reason,related to var incident<br/>1-Goal awarded<br/>2-Goal not awarded<br/>3-Penalty awarded<br/>4-Penalty not awarded<br/>5 -Red card given<br/>6-Card upgrade<br/>7-Mistaken identity<br/>8-Corner awarded<br/>9-Corner not awarded<br/>0-Other"},"var_result":{"type":"integer","description":"VAR result,related to var incident<br/>1-Goal confirmed<br/>2-Goal cancelled<br/>3-Penalty confirmed<br/>4-Penalty cancelled<br/>5-Red card confirmed<br/>6-Red card cancelled<br/>7-Card upgrade confirmed<br/>8-Card upgrade cancelled<br/>9-Original decision<br/>10-Original decision changed<br/>11-Corner confirmed<br/>12-Corner cancelled<br/>0-Unknown"},"reason_type":{"type":"integer","description":"The reason for the red and yellow cards and substitution events, please refer to the status code -> event reason (the red and yellow cards and substitution events related field)"}}},"LiveTlive":{"type":"object","description":"Data details","properties":{"time":{"type":"string","description":"Time (minutes)"},"data":{"type":"string","description":"Contents"},"position":{"type":"integer","description":"The incident occurred,0-neutral,1- home team,2- away team"}}}}},"common":{"schemas":{"ErrorMsg":{"type":"object","description":"abnormal","properties":{"code":{"type":"integer","description":"status code"},"msg":{"type":"string","description":"Error message"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.thesports.com/thesports-docs/basic-data/real-time-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
