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

# GET /player_positions — List All Player Positions

> Returns the complete list of position codes and full names used by SquadAssist, such as GK, CM, and ST, for use in filters and lookups.

Use this endpoint to retrieve the full catalogue of player position codes and their corresponding display names as used throughout the SquadAssist platform. The `id` values returned here are the same codes you will see in the `position` field of `GET /player_info`.

## Authentication

All requests must include a valid API key, either as an `x-api-key` header or as a Bearer token in the `Authorization` header.

```http theme={null}
x-api-key: YOUR_API_KEY
# or
Authorization: Bearer YOUR_API_KEY
```

## Request

<ParamField query="player_id" type="string" required>
  The SquadAssist player ID. Obtain this from `POST /query_player` if you only have an external ID such as a Transfermarkt or Wyscout ID.
</ParamField>

## Response

<ResponseField name="positions" type="array">
  An array of position objects, one for each supported position.

  <Expandable title="position object">
    <ResponseField name="id" type="string">
      The position code used in the API (e.g., `"GK"`, `"CM"`, `"ST"`).
    </ResponseField>

    <ResponseField name="name" type="string">
      The full display name of the position (e.g., `"Goalkeeper"`, `"Central Midfielder"`, `"Striker"`).
    </ResponseField>
  </Expandable>
</ResponseField>

## Positions Reference

The table below lists every position returned by this endpoint.

| Code  | Full Name            |
| ----- | -------------------- |
| `GK`  | Goalkeeper           |
| `LWB` | Left Wing Back       |
| `LB`  | Left Back            |
| `CB`  | Center Back          |
| `RB`  | Right Back           |
| `RWB` | Right Wing Back      |
| `CDM` | Defensive Midfielder |
| `LM`  | Left Midfielder      |
| `CM`  | Central Midfielder   |
| `RM`  | Right Midfielder     |
| `CAM` | Attacking Midfielder |
| `LF`  | Left Forward         |
| `CF`  | Center Forward       |
| `RF`  | Right Forward        |
| `LW`  | Left Wing            |
| `ST`  | Striker              |
| `RW`  | Right Wing           |

## Example

<CodeGroup>
  ```bash Powershell theme={null}
  $headers = @{
      "x-api-key"    = "your API key" #Change 
      "Content-Type" = "application/json"
  }

  curl "https://api.squadassist.ai/v1/player_positions" -H $headers
  ```

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

  url = "https://api.squadassist.ai/v1/player_positions"

  headers = {
      "x-api-key": "your_API_key",
      "Content-Type": "application/json"
  }

  # Make the request
  response = requests.get(url, headers=headers)

  if response.status_code == 200:
      positions = response.json()
      print(positions)
  else:
      print(f"Error: {response.status_code}")
  ```

  ```r R theme={null}
  library(httr2)

  resp <- httr2::request("https://api.squadassist.ai/v1/player_positions") |>
      httr2::req_headers("x-api-key" = API_KEY) |>
      req_perform() |>
      resp_body_json()
  print(resp)
  ```
</CodeGroup>

```json Response theme={null}
{
  "positions": [
    { "id": "GK",  "name": "Goalkeeper" },
    { "id": "LWB", "name": "Left Wing Back" },
    { "id": "LB",  "name": "Left Back" },
    { "id": "CB",  "name": "Center Back" },
    { "id": "RB",  "name": "Right Back" },
    { "id": "RWB", "name": "Right Wing Back" },
    { "id": "CDM", "name": "Defensive Midfielder" },
    { "id": "LM",  "name": "Left Midfielder" },
    { "id": "CM",  "name": "Central Midfielder" },
    { "id": "RM",  "name": "Right Midfielder" },
    { "id": "CAM", "name": "Attacking Midfielder" },
    { "id": "LF",  "name": "Left Forward" },
    { "id": "CF",  "name": "Center Forward" },
    { "id": "RF",  "name": "Right Forward" },
    { "id": "LW",  "name": "Left Wing" },
    { "id": "ST",  "name": "Striker" },
    { "id": "RW",  "name": "Right Wing" }
  ]
}
```
