> ## 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 /career_path — Get Player History

> Returns the clubs where the player has been during his carreer. It will provide a chronological list of periods of that player at a club, so users can easily track history of a player.

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

<ParamField query="min_duration_days" type="int">
  The minimum amount of days a player should be at a club to take that period into account.
</ParamField>

## Response

<ResponseField name="career_path" type="array">
  An array of objects, with each object representing one period of the player at a club.

  <Expandable title="Career step">
    <ResponseField name="club_id" type="string">
      The SquadAssist id of the club of the player at this step in his career.
    </ResponseField>

    <ResponseField name="club_name" type="string">
      The display name of the club during this career step.
    </ResponseField>

    <ResponseField name="end_date" type="date">
      The end date of this career step.
    </ResponseField>

    <ResponseField name="end_year" type="int">
      The year in which this career step ended.
    </ResponseField>

    <ResponseField name="is_loan" type="boolean">
      Indicates whether the player was on loan at this club.
    </ResponseField>

    <ResponseField name="start_date" type="date">
      The start date of this career step.
    </ResponseField>

    <ResponseField name="club_name" type="int">
      The year in which this carreer step started.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="player_id" type="string">
  Echoes the player\_id of the initial reques
</ResponseField>

## 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/career_path?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/career_path"
      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/career_path"
  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}
{
    "career_path": [
        {
            "club_id": "C01JJBWJRY350A4XZN1G1YN2MBP",
            "club_name": "TSG 1899 Hoffenheim",
            "end_date": null,
            "end_year": null,
            "is_loan": false,
            "start_date": "2026-07-10",
            "start_year": 2026
        },
        {
            "club_id": "C01JJBVJAPKG8CM7ZA5JF5G84R8",
            "club_name": "RSC Anderlecht",
            "end_date": "2026-07-10",
            "end_year": 2026,
            "is_loan": false,
            "start_date": "2018-07-01",
            "start_year": 2018
        }
    ],
    "player_id": "P01K0WPQJPWZCNCYH1KXHTJ9R31"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.