> ## 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.

# Rankings Endpoints

> V2 Tennis API: 5 ranking endpoints for ATP, WTA singles and race rankings

## Base URL

```
https://api.sportsapipro.com/v2/tennis
```

<Info>
  Rankings are a **tennis-unique feature** — not available in the football or basketball APIs. These endpoints return comprehensive ranking data including rank, points, and player details.
</Info>

<Tip>
  **Rankings return Team IDs — that's the only ID you need for tennis on V2.** In V2 tennis the team entity *is* the player; pass the returned ID directly to `/api/teams/:id`, `/api/teams/:id/events/last/:page`, `/api/teams/:id/near-events`, `/api/teams/:id/featured-event`, `/api/teams/:id/media`, and `/api/teams/:id/tournament/:tid/season/:sid/statistics`. The separate `/api/players/:id` career family is **not currently available for tennis** — see the [Team/Player docs](/api-reference/tennis-v2/team) for the supported surface.
</Tip>

***

## ATP Rankings

### ATP Singles Rankings

```bash theme={null}
GET /api/rankings
```

Returns the current ATP Singles rankings (up to 500 players).

### ATP Race Rankings

```bash theme={null}
GET /api/rankings/atp-race
```

Returns the current ATP Race to Turin rankings (calendar year points).

***

## WTA Rankings

### WTA Singles Rankings

```bash theme={null}
GET /api/rankings/wta
```

Returns the current WTA Singles rankings.

<Warning>
  Use this endpoint (`/api/rankings/wta`) for WTA Singles. The legacy ranking type `6` is known-broken upstream (ranks start at 101 instead of 1) and should not be called directly. `/api/rankings/wta` is now backed by the correct upstream source and returns rank #1 through #500 as expected.
</Warning>

### WTA Race Rankings

```bash theme={null}
GET /api/rankings/wta-race
```

Returns the current WTA Race rankings (calendar year points).

***

## Custom Rankings

### Rankings by Type ID

```bash theme={null}
GET /api/rankings/type/{typeId}
```

Returns rankings for a specific ranking type. Only tennis ranking types are allowed.

<ParamField path="typeId" type="number" required>
  The ranking type ID. Valid tennis types: `5` (ATP alt), `7` (ATP Singles), `8` (WTA Singles), `34` (ATP Race), `35` (WTA Race alt). Type `6` is accepted for back-compat but is **broken upstream** — use `/api/rankings/wta` for WTA Singles instead.
</ParamField>

<Warning>
  Non-tennis type IDs will return a **400 Bad Request** with an error message listing the valid types. This prevents football or other sport data from leaking through the tennis namespace.
</Warning>

***

## Example Requests

<CodeGroup>
  ```bash cURL — ATP Singles theme={null}
  curl -X GET "https://api.sportsapipro.com/v2/tennis/rankings" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash cURL — WTA Singles theme={null}
  curl -X GET "https://api.sportsapipro.com/v2/tennis/rankings/wta" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash cURL — ATP Race theme={null}
  curl -X GET "https://api.sportsapipro.com/v2/tennis/rankings/atp-race" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.sportsapipro.com/v2/tennis/rankings',
    { headers: { 'x-api-key': 'YOUR_API_KEY' } }
  );
  const atpRankings = await response.json();
  // Returns ~500 ranked players with rank, points, player details
  ```

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

  response = requests.get(
      'https://api.sportsapipro.com/v2/tennis/rankings/wta',
      headers={'x-api-key': 'YOUR_API_KEY'}
  )
  wta_rankings = response.json()
  ```
</CodeGroup>
