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

# Audiences

> Facebook ad account की custom audiences सूचीबद्ध करें, हर एक के type, size और इस जानकारी के साथ कि कोई boost उसे अभी target कर सकता है या नहीं।

Facebook ad account की custom audiences सूचीबद्ध करें: साइट विज़िटर, वे लोग जिन्होंने किसी Page, Instagram account या वीडियो के साथ engage किया, lookalikes और आपकी अपनी customer lists। जब आप [कोई पोस्ट boost करें](https://www.ayrshare.com/docs/apis/ads/facebook/boost-post.md#audiences), तो इन ids को `targeting.audiences` या `targeting.excludedAudiences` में उपयोग करें।

<ul>
  <li>Meta Ads Manager में बनाई गई audiences भी सूचीबद्ध होती हैं, सिर्फ़ Ayrshare से बनाई गई नहीं।</li>
  <li>जब Meta audience भर देता है और कोई boost उसे target कर सकता है, तब `status.ready` का मान `true` होता है। नई audience तब तक तैयार नहीं होती जब तक Meta कम से कम 100 लोगों का मिलान न कर ले। website या engagement audience के लिए इसमें कुछ घंटे और customer list के लिए 48 घंटे तक लग सकते हैं।</li>
  <li>`size` Meta का अपना अनुमान है, निचली और ऊपरी सीमा के रूप में। जब तक Meta के पास अनुमान नहीं होता, यह `null` रहता है, उदाहरण के लिए जब audience अभी भर रही हो।</li>
  <li>परिणाम cache नहीं होते: audience के भरते समय उसका size और readiness बदलते रहते हैं।</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*

वह ad account जिसकी audiences सूचीबद्ध करनी हैं, [ad accounts](https://www.ayrshare.com/docs/apis/ads/facebook/get-ad-accounts.md) से, `act_` prefix के साथ या उसके बिना।

**limit** `number`

एक पेज में लौटाई जाने वाली अधिकतम audiences, 1 से 1000 तक। डिफ़ॉल्ट 100 है; इससे बड़ी संख्या 1000 लौटाती है।

**next** `string`

जब response में `meta.pagination.hasMore: true` हो, तो अगला पेज पाने के लिए उसका `meta.pagination.next` मान यहाँ भेजें। बाकी parameters बिना बदलाव भेजें: किसी दूसरे request का `next` मान `code: 101` लौटाता है।

## Response

हर audience में होता है:

<ul>
  <li>`id`: boost करने, लोगों को जोड़ने या delete करने के लिए audience id।</li>
  <li>`name`: Ads Manager में दिखने वाला नाम।</li>
  <li>`type`: `website`, `engagement`, `lookalike`, `customerList`, या `other` उस audience प्रकार के लिए जिसे Ayrshare नहीं बनाता।</li>
  <li>`size`: `{ lower, upper }`, Meta का अनुमान, या `null`।</li>
  <li>`status`: `{ ready, code, description }`। `ready` का मान `true` होता है जब कोई boost अभी audience को target कर सकता है; `code` और `description` Meta का delivery status हैं।</li>
  <li>`created`: audience कब बनाई गई, ISO 8601 में, या `null`।</li>
</ul>

जब और audiences हों, तो `meta.pagination.hasMore` का मान `true` होता है और `meta.pagination.next` सेट होता है। अगला पेज पाने के लिए वही request दोबारा भेजें, जिसमें `next` उस मान पर सेट हो।

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

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

fetch("https://api.ayrshare.com/api/ads/facebook/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/facebook/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.