# List Contacts in a List

> Page through, sort, and search the contacts in one contact list

URL: https://docs.lemuai.com/api-reference/contacts/list-members

Returns the contacts in one list. Unlike [List contacts](https://docs.lemuai.com/api-reference/contacts/list), you can sort the results and fetch up to 1,000 contacts per page.

**Endpoint:** `GET /api/v1/contacts/lists/{list_id}/contacts`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `list_id` | integer | Yes | The list's `id` from [List contact lists](https://docs.lemuai.com/api-reference/contacts/lists). |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `page` | integer | No | Page number, starting at `1`. Default `1`. |
| `limit` | integer | No | Contacts per page, `1` to `1000`. Default `25`. |
| `sort_by` | string | No | Column to sort by. Default `added_at` (when the contact joined the list). |
| `sort_dir` | string | No | `desc` (default) or `asc`. |
| `search` | string | No | Text to look for in name, phone, email, and company. |

**Example request:**

**cURL**

```bash
curl -G https://app.lemuai.com/api/v1/contacts/lists/55/contacts \
  -H "X-API-Key: lemu_your_api_key" \
  --data-urlencode "limit=500" \
  --data-urlencode "sort_dir=asc"
```

**JavaScript**

```js
const params = new URLSearchParams({
  "limit": "500",
  "sort_dir": "asc",
});
const res = await fetch(`https://app.lemuai.com/api/v1/contacts/lists/55/contacts?${params}`, {
  method: "GET",
  headers: {
    "X-API-Key": process.env.LEMU_API_KEY,
  },
});
if (!res.ok) throw new Error(`LemuAI API ${res.status}: ${await res.text()}`);
const data = await res.json();
console.log(data);
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://app.lemuai.com/api/v1/contacts/lists/55/contacts",
    headers={
        "X-API-Key": os.environ["LEMU_API_KEY"],
    },
    params={
        "limit": "500",
        "sort_dir": "asc",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

## Response

**`200`**: the same shape as [List contacts](https://docs.lemuai.com/api-reference/contacts/list): `contacts`, `total_count`, `page`, `limit`, and `total_pages`.

## Errors

| Status | When |
|---|---|
| `404` | No list with this id in your organization |
