> ## 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_info — Retrieve Player Details

> Fetch a player's role, position, club associations, and key identifiers for the current 2025/2026 season using their SquadAssist ID.

Use this endpoint to retrieve detailed information about a specific player, including their SquadAssist role classification, current position code, club associations, and linked external IDs. All data is returned for the default season, which is currently **2025/2026**.

## 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="squadassist_id" type="string">
  The SquadAssist internal player ID, echoed back from the request.
</ResponseField>

<ResponseField name="player_role" type="string">
  The player's SquadAssist role classification (e.g., `"Box-to-Box Midfielder"`, `"Centre-Back"`). Use `GET /role_description` to retrieve a full description of any role value.
</ResponseField>

<ResponseField name="position" type="string">
  The player's primary position code (e.g., `"CM"`, `"ST"`, `"CB"`). Use `GET /player_positions` for the full list of valid codes and their names.
</ResponseField>

<ResponseField name="nationality" type="string">
  The player's nationality.
</ResponseField>

<ResponseField name="age" type="integer">
  The player's current age in years.
</ResponseField>

<ResponseField name="agency_name" type="string">
  The name of the agency of the player.
</ResponseField>

<ResponseField name="contract_end_date" type="string">
  The end date of the current player's contract.
</ResponseField>

<ResponseField name="preferred_foot" type="string">
  The player's preferred foot (e.g., `"Right"`, `"Left"`, `"Both"`).
</ResponseField>

<ResponseField name="owning_club_id" type="string">
  The SquadAssist ID of the club that holds the player's registration.
</ResponseField>

<ResponseField name="last_active_club_id" type="string">
  The SquadAssist ID of the most recent club where the player was active.
</ResponseField>

<ResponseField name="current_team_id" type="string">
  The SquadAssist ID of the player's current team (may differ from `owning_club_id` for loan players).
</ResponseField>

<ResponseField name="transfermarkt_id" type="integer | null">
  The player's Transfermarkt ID, or `null` if not linked.
</ResponseField>

<ResponseField name="wyscout_id" type="integer | null">
  The player's Wyscout ID, or `null` if not linked.
</ResponseField>

<Note>
  Player data is always returned for the **2025/2026** season regardless of the current calendar date. Season selection is not supported on this endpoint.
</Note>

## Errors

| Status | Description                                                               |
| ------ | ------------------------------------------------------------------------- |
| `400`  | `player_id` query parameter is missing or the value is invalid.           |
| `403`  | Player is not yet ready for API access, or is not in the allowed leagues. |
| `404`  | No player found with the given `player_id`.                               |

## Example

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

  #Change player_id in request to desired player 
  curl "https://api.squadassist.ai/v1/player_info?player_id=P01K0WPQJPWZCNCYH1KXHTJ9R31" -H $headers
  ```

  ```python Python theme={null}
      # 1. Define the endpoint with the player_id already in the URL
      url = "https://api.squadassist.ai/v1/player_info"
      player_id = "P01K0WPQJPWZCNCYH1KXHTJ9R31" # Change 

      # 2. Set up your headers
      headers = {
          "x-api-key": API_KEY, # Replace with your actual key
          "Content-Type": "application/json"
      }

      # 3. Add the parameters
      params = {
          "player_id": player_id 
      }

      # 4. Make the GET request
      response = requests.get(url, headers=headers, params=params)
      # 5. Output the result
      if response.status_code == 200:
          data = response.json()
          print(data)
      else:
          print(f"Error {response.status_code}: {response.text}")
  ```

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

  # 1. Define the base URL and the API key
  base_url <- "https://api.squadassist.ai/v1/player_info"
  api_key  <- "API_KEY"

  # 2. Build the request
  req <- httr2::request(base_url) |>
    httr2::req_headers("x-api-key" = API_KEY) |>
    # This adds the ?player_id=... part automatically
    httr2::req_url_query(player_id = "P01K0WPQJPWZCNCYH1KXHTJ9R31")

  # 3. Perform and parse
  resp <- httr2::req_perform(req)
  player_info <- httr2::resp_body_json(resp)

  print(player_info)
  ```
</CodeGroup>

```json Response theme={null}
{
  "squadassist_id": "P01K0WPQJPWZCNCYH1KXHTJ9R31",
  "player_role": "Box-to-Box Midfielder",
  "position": "CM",
  "nationality": "Belgium",
  "age": 17,
  "preferred_foot": "Right",
  "owning_club_id": "C01JJBVJAPKG8CM7ZA5JF5G84R8",
  "last_active_club_id": "C01JJBVJAPKG8CM7ZA5JF5G84R8",
  "current_team_id": "C01JJBVJAPKG8CM7ZA5JF5G84R8",
  "transfermarkt_id": 1105541,
  "wyscout_id": 777864
}
```
