> 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/baseball/match-data/real-time-data.md).

# Real-time data

## Real-time data

> This interface returns the scores data of the matches within 120 minutes from now(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

```json
{"openapi":"3.0.1","info":{"title":"Baseball API","version":"1.0.250818"},"tags":[{"name":"MATCH DATA","description":"MATCH DATA"}],"servers":[{"url":"https://api.thesports.com"}],"paths":{"/v1/baseball/match/detail_live":{"get":{"tags":["MATCH DATA"],"description":"This interface returns the scores data of the matches within 120 minutes from now(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","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","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","items":{"$ref":"#/deps/schemas/LiveStats"}},"players":{"type":"object","description":"Player Statistics","properties":{"home":{"type":"array","description":"Home Team","items":{"$ref":"#/components/schemas/LivePlayers"}},"away":{"type":"array","description":"Away Team","items":{"$ref":"#/components/schemas/LivePlayers"}}}},"extra":{"type":"object","description":"Additional data","properties":{"good":{"type":"integer","description":"Strikes"},"bad":{"type":"integer","description":"Non-Strikes"},"base":{"type":"string","description":"Number of bases on base (from left to right: 1st base, 2nd base, 3rd base, 1 is on base and 0 is not on base)"},"out":{"type":"integer","description":"Outs"}}}}},"LivePlayers":{"type":"object","description":"Data details","properties":{"id":{"type":"string","description":"Player id"},"stats":{"$ref":"#/deps/schemas/LivePlayers"}}}},"responses":{"404NotFound":{"description":"Resource does not exist","content":{"application/json":{"schema":{"$ref":"#/common/schemas/ErrorMsg"}}}}}},"deps":{"schemas":{"LiveScore":{"type":"array","description":"Score data<br/>example: [\"pxwrxgs7zyl7myk\", 437, 1, {\"ft\": [\"0\", \"0\"], \"p1\": [\"0\", \"0\"], \"p2\": [\"0\", \"0\"], \"p3\": [\"0\", \"0\"], \"h\": [\"1\", \"1\"]}]\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 state | Integer |\n| `2` | Batting team (stick), 1. Home team, 2. Away team, 0. Unknown | Integer |\n| `3` | Detailed instructions, as above | Not specified |\n","properties":[{"$ref":"#/deps/schemas/Score"}],"items":""},"Score":{"type":"object","description":"Score data (May be empty)<br/>ft - Total score<br/>p* - Single inning score(* - Number of inning, 1, 2, 3...)<br/>ot - Overtime score<br/>h - Hit, the total number of hits<br/>e - Error, the number of mistakes made by the entire team on defense","properties":{"ft":{"$ref":"#/deps/schemas/MatchScore"},"p*":{"$ref":"#/deps/schemas/MatchScore"},"ot":{"$ref":"#/deps/schemas/MatchScore"},"h":{"$ref":"#/deps/schemas/MatchScore"},"e":{"$ref":"#/deps/schemas/MatchScore"}}},"MatchScore":{"type":"array","items":"","description":"**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Home team score | String |\n| `1` | Away team score | String |\n"},"LiveStats":{"type":"array","description":"Technical Statistics<br/>example: [[0, [[601, 7, 5], [612, 0.226, 0.156]]]]\n\n**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Type, 0-full court, 1-first set, 2-second set, and so on | Integer |\n| `1` | Nested array; see details below | Array |\n\n**Index `1` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `1[0]` | Nested array; see details below | Array |\n\n**Index `1[0]` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `1[0][0]` | Statistic type, please refer to Status code->Team Statistics | Integer |\n| `1[0][1]` | Home team value | Integer/Float |\n| `1[0][2]` | Away team value | Integer/Float |\n","items":""},"LivePlayers":{"type":"array","description":"Player Statistics<br/>example: [[613, 7], [634, 0.1]]\n\n**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Nested array; see details below | Array |\n\n**Index `0` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0[0]` | Statistic type, please refer to Status code->Player Statistics | Integer |\n| `0[1]` | Value | Integer/Float |\n","items":""}}},"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/baseball/match-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.
