curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/facebook/audiences?accountId=1234567890"
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);
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())
{
"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 } }
}
{
"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."
}
{
"action": "ads",
"status": "error",
"code": 370,
"message": "Error getting audiences. Please try again.",
"details": "Meta's reason"
}
Facebook Ads
Audiences
List the custom audiences on a Facebook ad account, with each one’s type, size and whether a boost can target it yet.
GET
/
ads
/
facebook
/
audiences
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/facebook/audiences?accountId=1234567890"
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);
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())
{
"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 } }
}
{
"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."
}
{
"action": "ads",
"status": "error",
"code": 370,
"message": "Error getting audiences. Please try again.",
"details": "Meta's reason"
}
List the custom audiences on a Facebook ad account: site visitors, people who engaged with a Page, an Instagram account or a video, lookalikes, and your own customer lists. Use the ids in
targeting.audiences or targeting.excludedAudiences when you boost a post.
- Audiences created in Meta Ads Manager are listed too, not only the ones created through Ayrshare.
status.readyistrueonce Meta has filled the audience and a boost can target it. A new audience is not ready until Meta has matched at least 100 people, which can take a few hours for a website or engagement audience and up to 48 hours for a customer list.sizeis Meta’s own estimate, as a lower and upper bound. It isnullwhile Meta has none, for example while the audience is still filling.- Results are not cached: an audience’s size and readiness change while it fills.
Header Parameters
Query Parameters
The ad account whose audiences to list, from ad accounts, with or without the
act_ prefix.The most audiences to return in one page, from 1 to 1000. Defaults to 100; a larger number returns 1000.
When the response has
meta.pagination.hasMore: true, send its meta.pagination.next value here to get the next page. Send the other parameters unchanged: a next value from a different request returns code: 101.Response
Each audience has:id: the audience id to use when boosting, adding people or deleting.name: the name shown in Ads Manager.type:website,engagement,lookalike,customerList, orotherfor an audience kind Ayrshare does not create.size:{ lower, upper }, Meta’s estimate, ornull.status:{ ready, code, description }.readyistruewhen a boost can target the audience now;codeanddescriptionare Meta’s delivery status.created: when the audience was created, ISO 8601, ornull.
meta.pagination.hasMore is true and meta.pagination.next is set. Send the same request again with next set to that value to get the next page.
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/facebook/audiences?accountId=1234567890"
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);
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())
{
"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 } }
}
{
"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."
}
{
"action": "ads",
"status": "error",
"code": 370,
"message": "Error getting audiences. Please try again.",
"details": "Meta's reason"
}