curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/instagram/audiences?accountId=1234567890"
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);
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())
{
"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"
}
Instagram Ads
الجماهير
اعرض الجماهير المخصصة في حساب إعلاني على Instagram، مع نوع كل منها وحجمه وما إذا كان التعزيز يستطيع استهدافه الآن.
GET
/
ads
/
instagram
/
audiences
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/instagram/audiences?accountId=1234567890"
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);
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())
{
"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"
}
اعرض الجماهير المخصصة في حساب إعلاني على Instagram: زوار الموقع، والأشخاص الذين تفاعلوا مع صفحة أو حساب Instagram أو فيديو، والجماهير المشابهة (lookalikes)، وقوائم العملاء الخاصة بك. استخدم المعرّفات في
targeting.audiences أو targeting.excludedAudiences عندما تعزّز منشورًا.
- تُعرض أيضًا الجماهير التي أُنشئت في Meta Ads Manager، وليس فقط تلك التي أُنشئت عبر Ayrshare.
- تكون قيمة
status.readyهيtrueبمجرد أن تملأ Meta الجمهور ويصبح التعزيز قادرًا على استهدافه. لا يكون الجمهور الجديد جاهزًا حتى تطابق Meta ما لا يقل عن 100 شخص، وقد يستغرق ذلك بضع ساعات لجمهور الموقع أو التفاعل وحتى 48 ساعة لقائمة العملاء. sizeهو تقدير Meta الخاص، في صورة حد أدنى وحد أعلى. وتكون قيمتهnullما دام لا يوجد لدى Meta تقدير، مثلًا بينما لا يزال الجمهور يمتلئ.- لا تُخزَّن النتائج مؤقتًا: يتغير حجم الجمهور وجاهزيته أثناء امتلائه.
معاملات الترويسة
معاملات الاستعلام
الحساب الإعلاني الذي تريد عرض جماهيره، من الحسابات الإعلانية، مع البادئة
act_ أو بدونها.أقصى عدد من الجماهير في الصفحة الواحدة، من 1 إلى 1000. القيمة الافتراضية 100؛ والرقم الأكبر يُرجع 1000.
عندما تتضمن الاستجابة
meta.pagination.hasMore: true، أرسل قيمة meta.pagination.next الخاصة بها هنا للحصول على الصفحة التالية. أرسل المعاملات الأخرى دون تغيير: قيمة next من طلب مختلف تُرجع code: 101.الاستجابة
يحتوي كل جمهور على:id: معرّف الجمهور المستخدم عند التعزيز أو إضافة الأشخاص أو الحذف.name: الاسم المعروض في Ads Manager.type:websiteأوengagementأوlookalikeأوcustomerList، أوotherلنوع جمهور لا ينشئه Ayrshare.size:{ lower, upper }، تقدير Meta، أوnull.status:{ ready, code, description }. تكونreadyهيtrueعندما يستطيع التعزيز استهداف الجمهور الآن؛ وcodeوdescriptionهما حالة العرض لدى Meta.created: وقت إنشاء الجمهور، بتنسيق ISO 8601، أوnull.
meta.pagination.hasMore هي true وتُعيَّن meta.pagination.next. أرسل الطلب نفسه مرة أخرى مع تعيين next إلى تلك القيمة للحصول على الصفحة التالية.
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/instagram/audiences?accountId=1234567890"
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);
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())
{
"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"
}