---
title: "Get employee details from Personio API"
description: "Technical guide on Personio API to Get employee details from Peronio API"
source_url: "https://www.getknit.dev/blog/get-employee-details-from-personio-api-rhovmw"
page_type: "blog"
---

_This is an educational blog post from Knit's blog: “Get employee details from Personio API”._

# Get employee details from Personio API

## Introduction

This article is a part of a series of articles covering the [Personio](https://md.getknit.dev/mcp-servers/personio-mcp-server) API in depth, and covers the specific use case of using the [Personio](https://md.getknit.dev/mcp-servers/personio-mcp-server) API to Get employee details from Peronio API.  
You can find all the other use cases we have covered for the Personio API along with a comprehensive deep dive on its various aspects like authentication, rate limits etc [here.](https://www.getknit.dev/blog/personio-guide)

### Overview

To retrieve employee details such as first name, last name, and date of joining from the Personio API, you can utilize the `listEmployees` endpoint. Below is a step-by-step guide with Python code snippets to achieve this.

#### 1\. Set Up Your Environment

Ensure you have the necessary libraries installed:

```
pip install requests
```

#### 2\. Define API Credentials

Set your API credentials for authentication:

```
api_url = "https://api.personio.de/v1/company/employees"
headers = {
    "X-Personio-Partner-ID": "your_partner_id",
    "X-Personio-App-ID": "your_app_id",
}
```

#### 3\. Make the API Request

Send a GET request to the `listEmployees` endpoint to fetch the required details:

```
import requests

params = {
    "attributes[]": ["first_name", "last_name", "hire_date"]
}

response = requests.get(api_url, headers=headers, params=params)

if response.status_code == 200:
    employees = response.json().get("data", [])
    for employee in employees:
        first_name = employee["attributes"].get("first_name")
        last_name = employee["attributes"].get("last_name")
        hire_date = employee["attributes"].get("hire_date")
        print(f"First Name: {first_name}, Last Name: {last_name}, Date of Joining: {hire_date}")
else:
    print(f"Failed to retrieve data: {response.status_code}")
```

#### 4\. Handle the Response

Process the response to extract and display the employee details:

```
if response.status_code == 200:
    employees = response.json().get("data", [])
    for employee in employees:
        first_name = employee["attributes"].get("first_name")
        last_name = employee["attributes"].get("last_name")
        hire_date = employee["attributes"].get("hire_date")
        print(f"First Name: {first_name}, Last Name: {last_name}, Date of Joining: {hire_date}")
else:
    print(f"Failed to retrieve data: {response.status_code}")
```

## Knit for Personio API Integration

For quick and seamless access to [Personio](https://www.getknit.dev/integration/personio) API, Knit API offers a convenient solution. By integrating with Knit just once, you can streamline the entire process. Knit takes care of all the authentication, authorization, and ongoing integration maintenance, this approach not only saves time but also ensures a smooth and reliable connection to your [Personio](https://www.getknit.dev/integration/personio) API.


## Related pages

- [How Knit works](https://md.getknit.dev/how-knit-works)
- [Unified API product](https://md.getknit.dev/products/unified-api)
