curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/snapchat/audiences \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "type": "lookalike", "name": "Like my subscribers", "seedAudienceId": "8c1e2f3a-0000-4000-8000-000000000101", "countries": ["US", "GB"], "similarity": "balance"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
accountId: "5a0d1b2c-0000-4000-8000-000000000003",
type: "lookalike",
name: "Like my subscribers",
seedAudienceId: "8c1e2f3a-0000-4000-8000-000000000101",
countries: ["US", "GB"],
similarity: "balance"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {
'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
'type': 'lookalike',
'name': 'Like my subscribers',
'seedAudienceId': '8c1e2f3a-0000-4000-8000-000000000101',
'countries': ['US', 'GB'],
'similarity': 'balance'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "8c1e2f3a-0000-4000-8000-000000000102",
"name": "Like my subscribers",
"type": "lookalike",
"size": { "lower": 0, "upper": 0 },
"status": { "ready": false, "code": null, "description": "NOT_READY" },
"created": "2026-12-02T12:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "ratio is not a recognised field."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "event is required on snapchat: one of APP_INSTALL, PURCHASE, ..."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Snapchat's reason"
}
Snapchat Ads
Audience बनाएँ
Snapchat customer list, website या lookalike audience segment बनाएँ, ताकि Ayrshare से Snap boost करते समय उसे शामिल या बाहर कर सकें।
POST
/
ads
/
snapchat
/
audiences
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/snapchat/audiences \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "type": "lookalike", "name": "Like my subscribers", "seedAudienceId": "8c1e2f3a-0000-4000-8000-000000000101", "countries": ["US", "GB"], "similarity": "balance"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
accountId: "5a0d1b2c-0000-4000-8000-000000000003",
type: "lookalike",
name: "Like my subscribers",
seedAudienceId: "8c1e2f3a-0000-4000-8000-000000000101",
countries: ["US", "GB"],
similarity: "balance"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {
'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
'type': 'lookalike',
'name': 'Like my subscribers',
'seedAudienceId': '8c1e2f3a-0000-4000-8000-000000000101',
'countries': ['US', 'GB'],
'similarity': 'balance'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "8c1e2f3a-0000-4000-8000-000000000102",
"name": "Like my subscribers",
"type": "lookalike",
"size": { "lower": 0, "upper": 0 },
"status": { "ready": false, "code": null, "description": "NOT_READY" },
"created": "2026-12-02T12:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "ratio is not a recognised field."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "event is required on snapchat: one of APP_INSTALL, PURCHASE, ..."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Snapchat's reason"
}
Snapchat ad account पर audience segment बनाएँ। तीन प्रकार समर्थित हैं, जिन्हें
Snapchat पर
Snapchat lookalike में कोई size percentage नहीं होता:
type से चुना जाता है:
customerList: लोगों की आपकी अपनी list, जिसे आप Audience Members के ज़रिए hashed identifiers से भरते हैं।website: वे लोग जिनके लिए आपके Snap Pixel ने आपकी site पर कोई event दर्ज किया।lookalike: आपके बताए देशों के वे लोग जो आपकी किसी customer list के लोगों जैसे हैं।
audience के अंतर्गत Audiences जैसे ही आकार में, status.ready: false के साथ लौटाया जाता है। Snapchat उसे समय के साथ भरता है। यह देखने के लिए उसे सूचीबद्ध करें कि status.ready कब true होता है, फिर जब आप Snap boost करें, तो उसका id targeting.audiences या targeting.excludedAudiences में उपयोग करें।
- जब Snapchat पर्याप्त लोगों को match कर लेता है, तब कोई boost segment को target कर सकता है। तब तक
status.readyfalseरहता है। - एक ad account में अधिकतम 1,000 customer lists हो सकती हैं, और segment का नाम अधिकतम 375 characters का होता है। इससे ज़्यादा होने पर Snapchat
code: 369के साथ मना कर देता है। - Snapchat यहाँ engagement audiences नहीं बना सकता।
type: engagementcode: 101के साथ400लौटाता है। - अगर आप दोबारा प्रयास कर सकते हैं तो
idempotencyKeyभेजें: उसी key और body के साथ दोबारा प्रयास करने पर दूसरा segment बनाने के बजाय पहला response लौटता है।
हैडर पैरामीटर
बॉडी पैरामीटर
आपके Snapchat ad account का ID जिस पर segment बनाना है, उदाहरण के लिए
5a0d0000-0000-4000-8000-000000000003।Customer list
कोई अन्य field नहीं। List खाली शुरू होती है और लोगों को तब तक रखती है जब तक आप उन्हें हटा न दें।customerFileSource वैकल्पिक है: Snapchat lists में केवल आपका अपना data होता है, इसलिए USER_PROVIDED_ONLY के अलावा कोई भी मान code: 101 लौटाता है।
Website
वह pixel event जिसे visitor ने fire किया होना चाहिए, जैसा Snapchat लिखता है:
PAGE_VIEW, VIEW_CONTENT, ADD_CART, START_CHECKOUT, PURCHASE, SIGN_UP, SUBSCRIBE, SEARCH, ADD_TO_WISHLIST, CUSTOM_EVENT_1 से CUSTOM_EVENT_5 तक, या Snapchat के pixel events में से कोई और। Snapchat पर आवश्यक।urlContains समर्थित नहीं है: Snapchat का website segment लोगों को केवल pixel event के आधार पर रखता है, इसलिए यह code: 101 लौटाता है।
Lookalike
वह customer list जिसके जैसे लोग खोजने हैं (Audiences में
type: customerList)। Snapchat lookalike केवल customer list से बनाता है, इसलिए ऐसा seed जो इस ad account पर आपकी कोई customer list नहीं है (दूसरे प्रकार का segment, किसी दूसरे account का segment, या हटाया गया segment) code: 101 लौटाता है।वे देश जिनमें लोगों को खोजना है, दो अक्षरों के codes के रूप में, जैसे
US। हर देश केवल एक बार।balance (डिफ़ॉल्ट) समानता और size को संतुलित करता है, similarity seed से सबसे मिलते-जुलते लोगों को रखता है, और reach सबसे ज़्यादा लोग खोजता है।ratio और allowInternationalSeeds code: 101 लौटाते हैं।
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/snapchat/audiences \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "type": "lookalike", "name": "Like my subscribers", "seedAudienceId": "8c1e2f3a-0000-4000-8000-000000000101", "countries": ["US", "GB"], "similarity": "balance"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
accountId: "5a0d1b2c-0000-4000-8000-000000000003",
type: "lookalike",
name: "Like my subscribers",
seedAudienceId: "8c1e2f3a-0000-4000-8000-000000000101",
countries: ["US", "GB"],
similarity: "balance"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {
'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
'type': 'lookalike',
'name': 'Like my subscribers',
'seedAudienceId': '8c1e2f3a-0000-4000-8000-000000000101',
'countries': ['US', 'GB'],
'similarity': 'balance'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "8c1e2f3a-0000-4000-8000-000000000102",
"name": "Like my subscribers",
"type": "lookalike",
"size": { "lower": 0, "upper": 0 },
"status": { "ready": false, "code": null, "description": "NOT_READY" },
"created": "2026-12-02T12:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "ratio is not a recognised field."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "event is required on snapchat: one of APP_INSTALL, PURCHASE, ..."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Snapchat's reason"
}