> 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/h2h.md).

# H2H

## H2H

> Return to match analysis statistics (historical confrontation/recent results,future matches,goal distribution)\<br/>\<br/>This interface is used to request data such as historical matchups of matches that have not started before the match. Most of them are historical data and change infrequently\<br/>Request limit:Matches within 30 days before today\<br/>\<br/>Request times:60 times/min

```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/analysis":{"get":{"tags":["BASIC DATA"],"description":"Return to match analysis statistics (historical confrontation/recent results,future matches,goal distribution)<br/><br/>This interface is used to request data such as historical matchups of matches that have not started before the match. Most of them are historical data and change infrequently<br/>Request limit:Matches within 30 days before today<br/><br/>Request times:60 times/min","summary":"H2H","operationId":"getMatchAnalysis","parameters":[{"$ref":"#/components/parameters/User"},{"$ref":"#/components/parameters/Secret"},{"name":"uuid","in":"query","description":"Match id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"results":{"$ref":"#/components/schemas/MatchAnalysis"}}}}}},"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":{"MatchAnalysis":{"type":"object","properties":{"info":{"$ref":"#/deps/schemas/InfoHistory"},"history":{"type":"object","description":"historical confrontation/recent results","properties":{"vs":{"type":"array","description":"Historical confrontation (the format is the same as the \"info\" field),no data is empty","items":{"$ref":"#/deps/schemas/InfoHistory"}},"home":{"type":"array","description":"Home team recent record (the format is the same as the \"info\" field),no data is empty","items":{"$ref":"#/deps/schemas/InfoHistory"}},"away":{"type":"array","description":"Away team recent record (the format is the same as the \"info\" field),no data is empty","items":{"$ref":"#/deps/schemas/InfoHistory"}}}},"future":{"type":"object","description":"future matches","properties":{"home":{"type":"array","description":"Home team future matches (the format is the same as the \"info\" field),no data is empty","items":{"$ref":"#/deps/schemas/InfoHistory"}},"away":{"type":"array","description":"Away team future matches (the format is the same as the \"info\" field),no data is empty","items":{"$ref":"#/deps/schemas/InfoHistory"}}}},"goal_distribution":{"$ref":"#/components/schemas/GoalDistribution"}}},"GoalDistribution":{"type":"object","description":"goal distribution","properties":{"home":{"type":"object","description":"Home team goal distribution,no data is empty","properties":{"all":{"type":"object","description":"All matches","properties":{"matches":{"type":"integer","description":"Matches"},"scored":{"type":"array","description":"Home team goal distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}},"conceded":{"type":"array","description":"Home team conceded distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}}}},"home":{"type":"object","description":"Home matches","properties":{"matches":{"type":"integer","description":"Matches"},"scored":{"type":"array","description":"Home team home goal distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}},"conceded":{"type":"array","description":"Home team home conceded distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}}}},"away":{"type":"object","description":"Away matches","properties":{"matches":{"type":"integer","description":"Matches"},"scored":{"type":"array","description":"Home team away goal distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}},"conceded":{"type":"array","description":"Home team away conceded distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}}}}}},"away":{"type":"object","description":"Away team goal distribution,no data is empty","properties":{"all":{"type":"object","description":"All matches","properties":{"matches":{"type":"integer","description":"Matches"},"scored":{"type":"array","description":"Away team goal distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}},"conceded":{"type":"array","description":"Away team conceded distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}}}},"home":{"type":"object","description":"Home matches","properties":{"matches":{"type":"integer","description":"Matches"},"scored":{"type":"array","description":"Away team home goal distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}},"conceded":{"type":"array","description":"Away team home conceded distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}}}},"away":{"type":"object","description":"Away matches","properties":{"matches":{"type":"integer","description":"Matches"},"scored":{"type":"array","description":"Away team away goal distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}},"conceded":{"type":"array","description":"Away team away conceded distribution","items":{"$ref":"#/deps/schemas/GoalDistribution"}}}}}}}}},"responses":{"404NotFound":{"description":"Resource does not exist","content":{"application/json":{"schema":{"$ref":"#/common/schemas/ErrorMsg"}}}}}},"deps":{"schemas":{"InfoHistory":{"type":"array","description":"Match information field description<br/>example:[\"kp3glrw7hwqdyjv\",\"kp3glrw7hwqdyjv\",8,1516125600,0,[\"kp3glrw7hwqdyjv\", \"4\", 1, 0, 0, 0, -1, 0, 0],[\"kp3glrw7hwqdyjv\", \"19\", 1, 0, 0, 0, -1, 0, 0],[\"0.86,-0.5,1.04,0\",\"3.8,3.6,2.05,0\",\"0.9,2.75,1.0,0\",\"\"],[\"\",0,21],[\"kp3glrw7hwqdyjv\",\"2017\"]]\n\n**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Match id | String |\n| `1` | Competition id | String |\n| `2` | Match status,please refer to Status Code -> Match Status | Integer |\n| `3` | Match time | Integer |\n| `4` | Kick-off timestamp,kick-off time of the first/second half | Integer |\n| `5` | Nested array; see details below | Array |\n| `6` | Nested array; see details below | Array |\n| `7` | Nested array; see details below | Array |\n| `8` | Nested array; see details below | Array |\n| `9` | Nested array; see details below | Array |\n\n**Index `5` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `5[0]` | Home team id | String |\n| `5[1]` | Home League Ranking | String |\n| `5[2]` | Home Team Score (regular time) | Integer |\n| `5[3]` | Home Team Halftime score | Integer |\n| `5[4]` | Home Team Red cards | Integer |\n| `5[5]` | Home Team Yellow cards | Integer |\n| `5[6]` | Home Team Corners,-1 means no corner kick data | Integer |\n| `5[7]` | Home Team Overtime score (120 minutes,including regular time),only available in overtime | Integer |\n| `5[8]` | Home Team Penalty shootout score,only penalty shootout | Integer |\n\n**Index `6` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `6[0]` | Away team id | String |\n| `6[1]` | Away League Ranking | String |\n| `6[2]` | Away Team Score (regular time) | Integer |\n| `6[3]` | Away Team Halftime score | Integer |\n| `6[4]` | Away Team Red cards | Integer |\n| `6[5]` | Away Team Yellow cards | Integer |\n| `6[6]` | Away Team Corners,-1 means no corner kick data | Integer |\n| `6[7]` | Away Team Overtime score (120 minutes,including regular time),only available in overtime | Integer |\n| `6[8]` | Away Team Penalty shootout score,only penalty shootout | Integer |\n\n**Index `7` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `7[0]` | (Asian plate) home win,handicap,away win,whether to close (1-Yes,0-No) | String |\n| `7[1]` | (European plate) Win,draw,lose,whether to close (1-Yes,0-No) | String |\n| `7[2]` | (Size Ball plate) Big,handicap,small,whether to close (1-Yes,0-No) | String |\n| `7[3]` | (Corner plate) Big,handicap,small,whether to close (1-Yes,0-No) | String |\n\n**Index `8` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `8[0]` | Match description | String |\n| `8[1]` | Is it neutral,1-Yes 0-No | Integer |\n| `8[2]` | Match round | Integer |\n\n**Index `9` details**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `9[0]` | Season id | String |\n| `9[1]` | Season year | String |\n","items":""},"GoalDistribution":{"type":"array","description":"15 minutes as one segment,a total of 6 segments<br/>example:[5, 26, 1, 15]\n\n**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Number | Integer |\n| `1` | percentage(%) | Integer |\n| `2` | Start time(minutes) | Integer |\n| `3` | End Time(minutes) | Integer |\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/thesports-docs/basic-data/h2h.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.
