> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ticktock.bet/llms.txt
> Use this file to discover all available pages before exploring further.

# Team Head-to-Head

> Aggregate W/L plus deep round-level analytics across every finished match between two teams

## What it returns

Looks at every finished match between two HLTV team ids and produces three blocks:

### `summary`

Match-level and map-level W/L counts plus draws, all from the path's first id (`hltv_id`) perspective:

```json theme={null}
{
  "total_matches": 12,
  "team_wins": 7,
  "opponent_wins": 4,
  "draws": 1,
  "team_map_wins": 18,
  "opponent_map_wins": 13
}
```

### `aggregated`

Round-level analytics across every map with at least one ended round. `null` when no round data is available (yet-to-be-tracked or pure-walkover matches):

| Field                                                             | Meaning                                                               |
| ----------------------------------------------------------------- | --------------------------------------------------------------------- |
| `total_maps`, `total_rounds`, `rounds_per_map`                    | Volume                                                                |
| `team_a_ct_rounds_won`, `team_a_t_rounds_won`                     | Side-specific round wins from `team` perspective                      |
| `team_b_ct_rounds_won`, `team_b_t_rounds_won`                     | Same for `opponent`                                                   |
| `pistol_rounds_total`, `team_a_pistol_wins`, `team_b_pistol_wins` | Pistol-round W/L                                                      |
| `team_a_first_kills`, `team_b_first_kills`                        | First-kill counts                                                     |
| `team_a_first_kill_win_pct`, `team_b_first_kill_win_pct`          | Round-win conversion when getting the first kill                      |
| `race_to_6_team_a_win_pct`                                        | % of maps where `team` reached 6 round wins first. Same for 9 and 12. |
| `team_a_headshots`, `team_b_headshots`                            | Total headshot kills                                                  |
| `team_a_headshot_pct`, `team_b_headshot_pct`                      | Headshots ÷ total kills                                               |

(`team_a` = `team`, `team_b` = `opponent` throughout.)

### `recent_fixtures`

Compact list of the most recent N fixtures, normalised to `team`'s perspective:

```json theme={null}
{
  "match_id": "…",
  "scheduled_at": "2026-04-22T18:00:00+00:00",
  "finished_at": "2026-04-22T19:38:11+00:00",
  "event_name": "ESL Pro League S20",
  "bo_type": "bo3",
  "team": "Sashi",
  "opponent": "OG",
  "team_maps_won": 2,
  "opponent_maps_won": 1,
  "won": true
}
```

For full match metadata or per-map detail, follow the `match_id` to [Get Match](/api-reference/matches/get-match).

## Required scope

* **Minimum:** `cs2:teams:read`

## Query

| Param   | Default | Description                                |
| ------- | ------- | ------------------------------------------ |
| `limit` | 20      | Most recent N finished fixtures (max 100). |

## Example

```bash theme={null}
curl -H "X-API-Key: $TT_KEY" \
  "https://ticktock.bet/cs2/v1/teams/11712/h2h/9215?limit=10"
```

## Use cases

* **Pre-match models** — feed the full `aggregated` block as features (CT/T splits, pistol conversion, race-to-N).
* **Display surfaces** — `summary` + `recent_fixtures` for the match preview UI.
* **Fundamental factors** — first-kill win % and headshot % as priors for player-prop pricing.


## OpenAPI

````yaml openapi/cs2-api.json GET /cs2/v1/teams/{hltv_id}/h2h/{opponent_id}
openapi: 3.1.0
info:
  title: TickTock B2B API
  description: >-
    Unified CS2 API (``/cs2/v1/*``) plus sport-agnostic ``/v1/*`` meta
    endpoints. Tenant-authenticated via ``X-API-Key`` or ``x-access-token``
    header (REST), or ``api_key`` query parameter (WebSocket). Field visibility
    is gated by per-key scopes — see ``docs/CS2_API_REFERENCE.md`` for the
    catalog and migration.
  version: 1.0.0
servers:
  - url: https://ticktock.bet
    description: Production (same-origin proxy)
  - url: https://feed.ticktock.bet
    description: Production (B2B subdomain)
security: []
paths:
  /cs2/v1/teams/{hltv_id}/h2h/{opponent_id}:
    get:
      tags:
        - CS2
      summary: Head-to-head between two CS2 teams
      description: >-
        Aggregate W/L summary plus round-level analytics across every finished
        match between two HLTV teams. The ``team`` perspective is the path's
        first id (``hltv_id``); ``opponent`` is the second.


        Includes: match/map W/L, per-side round wins, pistol-round wins,
        first-kill counts and conversion %, race-to-6/9/12 win %, headshot
        totals and HS%, plus the N most recent fixtures in compact form. Stats
        land in ``aggregated`` only when at least one map of round data is
        available — pure-walkover or yet-to-be-tracked matches return
        ``aggregated: null``.
      operationId: get_team_h2h_cs2_v1_teams__hltv_id__h2h__opponent_id__get
      parameters:
        - name: hltv_id
          in: path
          required: true
          schema:
            type: integer
            title: Hltv Id
        - name: opponent_id
          in: path
          required: true
          schema:
            type: integer
            title: Opponent Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Most recent N fixtures.
            default: 20
            title: Limit
          description: Most recent N fixtures.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: >-
                  Response Get Team H2H Cs2 V1 Teams  Hltv Id  H2H  Opponent Id 
                  Get
              example:
                data:
                  hltv_id: 11712
                  name: Sashi
                  country_code: DK
                  world_ranking: 42
                  region: EMEA
                  time_filter: 3months
                  map_stats:
                    - map_name: all
                      maps_played: 87
                      wins: 51
                      losses: 33
                      win_rate: 0.586
                      rating: 1.06
                      ct_round_win_pct: 0.524
                      t_round_win_pct: 0.481
            application/xml: {}
        '401':
          description: >-
            Missing API key. Pass either `X-API-Key: <your-key>` or
            `$x$access-token: <your-key>` on REST calls (or `?api_key=` on
            WebSocket handshakes).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
                required:
                  - detail
              example:
                detail: Missing X-API-Key or $x$access-token header
        '403':
          description: >-
            API key authenticated but lacks the scope required for this
            endpoint, or the path's sport is not in the key's `sport_allowlist`.
            Use `GET /v1/whoami` to inspect the granted scope set.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
                required:
                  - detail
              example:
                detail: >-
                  Required scope 'cs2:matches:detail' is not granted to this API
                  key. Contact your account manager to extend the key's scopes.
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
                required:
                  - detail
              example:
                detail: Match not found
        '422':
          description: >-
            Validation error — a query/path parameter failed validation. The
            body lists the offending fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - type: enum
                    loc:
                      - query
                      - time_filter
                    msg: 'Input should be one of: 3m, 6m, 1y, all'
                    input: 2w
        '429':
          description: >-
            Tenant rate limit exceeded. Default is 600 req/min per tenant;
            configurable per contract. WebSocket connections are not
            rate-limited at the request layer.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
                required:
                  - detail
              example:
                detail: Rate limit exceeded (600 req/min)
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                example: 30
      security:
        - XAPIKeyHeader: []
        - XAccessTokenHeader: []
        - UOFAccessTokenHeader: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    XAPIKeyHeader:
      type: apiKey
      description: Tenant API key issued during onboarding
      in: header
      name: X-API-Key
    XAccessTokenHeader:
      type: apiKey
      description: UOF-standard alias for the tenant API key
      in: header
      name: x-access-token
    UOFAccessTokenHeader:
      type: apiKey
      description: Deprecated alias for x-access-token (backward compatibility)
      in: header
      name: $x$access-token

````