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
オーディエンスを作成
顧客リスト、ウェブサイト、類似の Snapchat セグメントを作成し、Ayrshare で Snap をブーストする際に含める・除外します。
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 広告アカウントにオーディエンスセグメントを作成します。
Snapchat の類似オーディエンスにはサイズの割合がありません:
type で選ぶ 3 種類に対応しています:
customerList: 独自の人のリスト。オーディエンスメンバーでハッシュ化した識別子を追加して作成します。website: Snap Pixel があなたのサイトでイベントを 1 つ検出した人。lookalike: 指定した国にいる、あなたの顧客リストのいずれかにいる人と似た人。
audience に status.ready: false の状態で返されます。Snapchat が時間をかけて蓄積します。一覧表示して status.ready が true になったことを確認してから、Snap をブーストするときにその id を targeting.audiences または targeting.excludedAudiences で使用します。
- Snapchat が十分な人を照合すると、ブーストでセグメントをターゲットにできます。それまでは
status.readyはfalseです。 - 1 つの広告アカウントに置ける顧客リストは最大 1,000 件、セグメント名は最大 375 文字です。それを超えると Snapchat は
code: 369で拒否します。 - Snapchat ではここでエンゲージメントオーディエンスを作成できません。
type: engagementはcode: 101付きの400を返します。 - 再試行する可能性がある場合は
idempotencyKeyを送ってください: 同じキーと同じボディで再試行すると、2 つ目のセグメントを作成せずに最初のレスポンスが返されます。
ヘッダーパラメータ
ボディパラメータ
顧客リスト
その他のフィールドはありません。リストは空の状態で始まり、削除するまで人を保持します。customerFileSource は省略可能です: Snapchat のリストには独自のデータのみが含まれるため、USER_PROVIDED_ONLY 以外の値は code: 101 を返します。
ウェブサイト
訪問者が発生させている必要があるピクセルイベント。Snapchat の表記どおりに指定します:
PAGE_VIEW、VIEW_CONTENT、ADD_CART、START_CHECKOUT、PURCHASE、SIGN_UP、SUBSCRIBE、SEARCH、ADD_TO_WISHLIST、CUSTOM_EVENT_1 から CUSTOM_EVENT_5、またはその他の Snapchat ピクセルイベント。Snapchat では必須です。urlContains は Snapchat ではサポートされていません: Snapchat のウェブサイトセグメントはピクセルイベントのみで人を保持するため、code: 101 を返します。
類似オーディエンス (lookalike)
似た人を探す元となる顧客リスト (オーディエンスの
type: customerList)。Snapchat は顧客リストからのみ類似オーディエンスを作成するため、この広告アカウント上のあなたの顧客リストでないシード (別の種類のセグメント、別のアカウントのセグメント、削除済みのセグメント) は code: 101 を返します。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"
}