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

# Player Match History

> Get match history for a specific tennis player

## Overview

Returns the match-by-match history for a specific tennis player, including scores, opponents, and match statistics.

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  # Get recent matches for a player
  curl -X GET "https://v1.tennis.sportsapipro.com/athletes/games?athleteId=874&numOfGames=10" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://v1.tennis.sportsapipro.com/athletes/games?athleteId=874&numOfGames=10',
    { headers: { 'x-api-key': 'YOUR_API_KEY' } }
  );
  const { games } = await response.json();

  games.forEach(match => {
    console.log(`vs ${match.opponent.name}: ${match.score}`);
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://v1.tennis.sportsapipro.com/athletes/games?athleteId=874&numOfGames=10',
      headers={'x-api-key': 'YOUR_API_KEY'}
  )
  matches = response.json()['games']
  ```
</CodeGroup>

## Parameters

<ParamField query="athleteId" type="integer" required>
  The player ID
</ParamField>

<ParamField query="numOfGames" type="integer">
  Number of matches to return (default: 10)
</ParamField>

## Response Structure

<ResponseField name="games" type="array">
  Array of match records with scores and statistics
</ResponseField>

<Tip>
  Combine with `/athletes/top` to get player IDs, then fetch their match history.
</Tip>


## OpenAPI

````yaml openapi-tennis GET /athletes/games
openapi: 3.1.0
info:
  title: SportsAPI Pro - Tennis API
  description: >-
    Professional tennis data API providing live scores, rankings, player
    statistics, betting odds, and more for ATP, WTA, and Grand Slam tournaments
    worldwide.
  version: 1.0.0
  contact:
    name: SportsAPI Pro Support
    email: support@sportsapipro.com
servers:
  - url: https://v1.tennis.sportsapipro.com
    description: Production API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Games
    description: Live scores, fixtures, and match data
  - name: Competitions
    description: Tournaments and rankings
  - name: Standings
    description: ATP/WTA rankings
  - name: Athletes
    description: Player statistics and data
  - name: Betting
    description: Betting lines, props, and predictions
  - name: Search
    description: Search entities
  - name: Account
    description: Account status and usage
paths:
  /athletes/games:
    get:
      tags:
        - Athletes
      summary: Player Match History
      description: Get match-by-match history for a specific player
      operationId: getAthleteGames
      parameters:
        - name: athleteId
          in: query
          required: true
          description: Player ID
          schema:
            type: integer
            example: 874
        - name: numOfGames
          in: query
          description: Number of matches to return
          schema:
            type: integer
            default: 10
            example: 10
      responses:
        '200':
          description: Player match history retrieved successfully
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your SportsAPI Pro API key

````