> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Аудиторії

> Список користувацьких аудиторій рекламного акаунта Instagram із типом, розміром і тим, чи може просування вже на них таргетуватися.

Повертає користувацькі аудиторії рекламного акаунта Instagram: відвідувачів сайту, людей, які взаємодіяли зі сторінкою, акаунтом Instagram або відео, схожі аудиторії (lookalike) і ваші власні списки клієнтів. Використовуйте ідентифікатори в `targeting.audiences` або `targeting.excludedAudiences`, коли [просуваєте допис](https://www.ayrshare.com/docs/apis/ads/instagram/boost-post.md#audiences).

<ul>
  <li>У списку є й аудиторії, створені в Meta Ads Manager, а не лише ті, що створені через Ayrshare.</li>
  <li>`status.ready` має значення `true`, щойно Meta наповнила аудиторію і просування може на неї таргетуватися. Нова аудиторія не готова, доки Meta не зіставить щонайменше 100 людей. Для аудиторії сайту чи взаємодії це може тривати кілька годин, а для списку клієнтів до 48 годин.</li>
  <li>`size` є власною оцінкою Meta у вигляді нижньої та верхньої межі. Значення `null`, доки в Meta немає оцінки, наприклад поки аудиторія ще наповнюється.</li>
  <li>Результати не кешуються: розмір і готовність аудиторії змінюються, поки вона наповнюється.</li>
</ul>

## Параметри заголовка

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## Параметри запиту

**accountId** `string` *required*

Рекламний акаунт, аудиторії якого потрібно отримати, з [рекламних акаунтів](https://www.ayrshare.com/docs/apis/ads/instagram/get-ad-accounts.md), з префіксом `act_` або без нього.

**limit** `number`

Максимальна кількість аудиторій на сторінці, від 1 до 1000. За замовчуванням 100; більше число повертає 1000.

**next** `string`

Якщо відповідь містить `meta.pagination.hasMore: true`, надішліть тут її значення `meta.pagination.next`, щоб отримати наступну сторінку. Інші параметри надсилайте без змін: значення `next` з іншого запиту повертає `code: 101`.

## Відповідь

Кожна аудиторія містить:

<ul>
  <li>`id`: ідентифікатор аудиторії для просування, додавання людей або видалення.</li>
  <li>`name`: назва, що відображається в Ads Manager.</li>
  <li>`type`: `website`, `engagement`, `lookalike`, `customerList` або `other` для типу аудиторії, який Ayrshare не створює.</li>
  <li>`size`: `{ lower, upper }`, оцінка Meta, або `null`.</li>
  <li>`status`: `{ ready, code, description }`. `ready` має значення `true`, коли просування може таргетуватися на аудиторію вже зараз; `code` і `description` містять статус показу від Meta.</li>
  <li>`created`: коли аудиторію створено, у форматі ISO 8601, або `null`.</li>
</ul>

Якщо аудиторій більше, `meta.pagination.hasMore` має значення `true`, а `meta.pagination.next` заповнено. Надішліть той самий запит ще раз зі значенням `next`, щоб отримати наступну сторінку.

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/instagram/audiences?accountId=1234567890"
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/instagram/audiences?accountId=1234567890", {
      method: "GET",
      headers: {
        "Authorization": `Bearer ${API_KEY}`
      }
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {'Authorization': 'Bearer API_KEY'}

r = requests.get('https://api.ayrshare.com/api/ads/instagram/audiences?accountId=1234567890', headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "audiences": [
    {
      "id": "23851234567890123",
      "name": "Site visitors 30d",
      "type": "website",
      "size": { "lower": 12000, "upper": 14100 },
      "status": { "ready": true, "code": 200, "description": "This audience is ready for use." },
      "created": "2026-10-20T09:12:00.000Z"
    },
    {
      "id": "23851234567890456",
      "name": "Like site visitors",
      "type": "lookalike",
      "size": null,
      "status": { "ready": false, "code": 300, "description": "This audience is still being populated." },
      "created": "2026-10-28T16:40:00.000Z"
    }
  ],
  "meta": { "pagination": { "hasMore": false } }
}
```

```json 400: Missing account theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "accountId is required."
}
```

```json 400: Meta refused the request theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 370,
  "message": "Error getting audiences. Please try again.",
  "details": "Meta's reason"
}
```


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