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

# H2H

## H2H

> Return analysis data of 2 teams (historical confrontation, recent results, future schedule)

```json
{"openapi":"3.0.1","info":{"title":"Tennis API","version":"1.0.250606"},"tags":[{"name":"MATCH DATA","description":"MATCH DATA"}],"servers":[{"url":"https://api.thesports.com"}],"paths":{"/v1/tennis/match/analysis":{"get":{"tags":["MATCH DATA"],"description":"Return analysis data of 2 teams (historical confrontation, recent results, future schedule)","summary":"H2H","operationId":"getMatchAnalysis","parameters":[{"$ref":"#/components/parameters/User"},{"$ref":"#/components/parameters/Secret"},{"name":"home_team_uuid","in":"query","description":"Home team id","required":true,"schema":{"type":"string"}},{"name":"away_team_uuid","in":"query","description":"Away team 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","description":"Data details","properties":{"history":{"type":"object","description":"historical confrontation/recent results","properties":{"vs":{"type":"array","description":"Historical confrontation, Up to 30 matches (no data is empty)","items":{"$ref":"#/components/schemas/Match"}},"home":{"type":"array","description":"Home team recent record, Up to 30 matches (no data is empty)","items":{"$ref":"#/components/schemas/Match"}},"away":{"type":"array","description":"Away team recent record, Up to 30 matches (no data is empty)","items":{"$ref":"#/components/schemas/Match"}}}},"future":{"type":"object","description":"future matches","properties":{"home":{"type":"array","description":"Home team future matches, Up to 30 matches (no data is empty)","items":{"$ref":"#/components/schemas/Match"}},"away":{"type":"array","description":"Away team future matches, Up to 30 matches (no data is empty)","items":{"$ref":"#/components/schemas/Match"}}}}}},"Match":{"type":"object","description":"Data details","properties":{"id":{"type":"string","description":"Match id"},"unique_tournament_id":{"type":"string","description":"Competition id"},"season_id":{"type":"string","description":"Season id"},"tournament_id":{"type":"string","description":"Stage id"},"venue_id":{"type":"string","description":"Venue id"},"home_team_id":{"type":"string","description":"Home team id"},"away_team_id":{"type":"string","description":"Away team id"},"status_id":{"type":"integer","description":"Match status, please refer to Status code->Match state"},"match_time":{"type":"integer","description":"Match time"},"neutral":{"type":"integer","description":"Is it neutral, 1-Yes, 0-No"},"bestof":{"type":"integer","description":"Number of sets, 3-BO3, 5-BO5, 0-Unknown"},"coverage":{"type":"object","description":"Animation","properties":{"mlive":{"type":"integer","description":"Is there any animation, 1-yes, 0-no"}}},"scores":{"$ref":"#/deps/schemas/Score"},"match_ids":{"$ref":"#/deps/schemas/MatchTids"},"tbd":{"type":"integer","description":"Is the match time to be determined? 1. Yes(if it exists, it will be returned)"},"weather":{"type":"object","description":"Match environment(No data, field does not exist)","properties":{"desc":{"type":"string","description":"Weather description"},"pressure":{"type":"integer","description":"Air pressure mmHg"},"temp":{"type":"integer","description":"Temperature ℃"},"wind":{"type":"integer","description":"Wind speed m/s"},"humidity":{"type":"integer","description":"Humidity %"}}},"updated_at":{"type":"integer","description":"Update time"}}}},"responses":{"404NotFound":{"description":"Resource does not exist","content":{"application/json":{"schema":{"$ref":"#/common/schemas/ErrorMsg"}}}}}},"deps":{"schemas":{"Score":{"type":"object","description":"Score data(May be empty)<br/>ft - Total score<br/>p* - Single set score(* - Number of sets, 1, 2, 3...)<br/>x* - Grab 7 points(* - Number of sets, 1, 2, 3...)<br/>pt - Real-time score","properties":{"ft":{"$ref":"#/deps/schemas/MatchScore"},"p*":{"$ref":"#/deps/schemas/MatchScore"},"x*":{"$ref":"#/deps/schemas/MatchScore"},"pt":{"$ref":"#/deps/schemas/MatchScoreStr"}}},"MatchScore":{"type":"array","items":"","description":"**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Home team score | Integer |\n| `1` | Away team score | Integer |\n"},"MatchScoreStr":{"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"},"MatchTids":{"type":"array","description":"Matches associated with team competitions<br/>example: [\"82rek6s0xy91rep\", \"y8m4znswpgjvql0\"]\n\n**Field definitions**\n\n| Index | Field | Type |\n| --- | --- | --- |\n| `0` | Match id | String |\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/tennis/match-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.
