---
title: "Head to head"
method: POST
path: "/v1/get_head_to_head"
tags: ["Multi-table"]
---

# Head to head

`POST /v1/get_head_to_head`

## Request

- Base URL: `https://mcp.acesapi.com`
- URL: `https://mcp.acesapi.com/v1/get_head_to_head`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Use for two players' head to head: wins each, sets won, wins by surface and in finals, and every meeting with its score. Walkovers are listed but not counted as wins; incomplete records are not counted. Tour: atp (default) or wta; on the shared endpoint pass league: "wta" for the WTA. Costs 3 credits.

## Request body

- object
  - `player_id` string, required: First player id.
  - `opponent_id` string, required: Second player id.
  - `league` 'tennis' | 'wta': League. Defaults to tennis. One of: tennis, wta.

## Response `200`

The result, wrapped in data.

- object
  - `data` object, required
    - `tour` string, required
    - `players` object[], required
    - `summary` object, required
    - `matches` object[], required

## Other responses

- `400`: Invalid arguments.
- `401`: Missing or invalid API key.
- `402`: Not enough credits.
- `429`: Rate limited.

---

[API](https://skmtc.dev/acesapi/apis/acesapi-api.md) · [All operations](https://skmtc.dev/acesapi/apis/acesapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/acesapi/apis/acesapi-api/revisions/01a182013f8b?raw)
