---
title: "Developer guide to list ALL candidates using Ashby API (Python Example)"
description: "This developer guide talks about how to list all candidates who have applied to a job using Ashby API"
source_url: "https://www.getknit.dev/blog/developer-guide-to-list-all-candidates-using-ashby-api-python-example"
page_type: "blog"
---

_This is an educational blog post from Knit's blog: “Developer guide to list ALL candidates using Ashby API (Python Example)”._

# Developer guide to list ALL candidates using Ashby API (Python Example)

## Introduction

This article is a part of a series of articles covering the Ashby API in depth, and covers the specific use case of using the Ashby API to List all Candidates from Ashby API.  
You can find all the other use cases we have covered for the Ashby API along with a comprehensive deep dive on its various aspects like authentication, rate limits etc [in our in-depth Ashby API end point directory.](https://www.getknit.dev/blog/ashby-api-directory-jx2VSB)

The Ashby API provides a robust method to list all candidates within an organization using the `candidate.list` endpoint. This endpoint supports pagination and incremental synchronization, allowing efficient data retrieval. Below is a step-by-step guide to using this API with Python code snippets.

### API Endpoint

**Endpoint:** `https://api.ashbyhq.com/candidate.list`  
**HTTP Method:** POST

### Request Body

The request body should be a JSON object. You can specify parameters such as `limit`, `cursor`, and `syncToken` to control pagination and synchronization.

```
{
  "limit": 25,
  "cursor": "your-cursor-value",
}
```

### Python Code Snippet

Below is a Python code snippet demonstrating how to list all candidates using the Ashby API:

```
import requests

url = "https://api.ashbyhq.com/candidate.list"
headers = {
    "Accept": "application/json",
}
data = {
    "limit": 25
}

response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
    result = response.json()
    print(result)
    while result.get("moreDataAvailable"):
        data["cursor"] = result.get("nextCursor")
        response = requests.post(url, headers=headers, json=data)
        result = response.json()
        print(result)
else:
    print("Error:", response.status_code, response.text)
```

### Response

The response will include a list of candidates and pagination information. If `moreDataAvailable` is `true`, use `nextCursor` to fetch the next page.

```
{
  "success": true,
  "results": [
    // Array of candidate objects
  ],
  "moreDataAvailable": true,
  "nextCursor": "next-cursor-value",
}
```

If you are looking to learn how to get details on an individual candidate using Ashby API, read our developer guide here : [Get candidate data using Ashby API (Python Example)](https://www.getknit.dev/blog/developer-guide-to-get-candidate-data-using-ashby-api-python-example)

## Knit for Ashby API Integration

For quick and seamless access to [Ashby](https://www.getknit.dev/integration/ashby-ats) API, Knit API offers a convenient Unified API solution. By integrating with Knit just once, you can integrate with multiple ATS systems in on go. 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 [Ashby](https://www.getknit.dev/integration/ashby-ats) API.


## Related pages

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