curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "ca.129482487242999",
"name": "Site visitors 30d",
"type": "website",
"size": null,
"status": { "ready": false, "code": null, "description": "PENDING" },
"created": "2026-12-02T10:05: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": "retentionDays on reddit is at most 90."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Reddit's reason"
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Reddit's reason"
}
Reddit Ads
オーディエンスを作成
独自の顧客リストまたはサイト訪問者のRedditカスタムオーディエンスを作成し、投稿をブーストするときに含める・除外します。
POST
/
ads
/
reddit
/
audiences
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "ca.129482487242999",
"name": "Site visitors 30d",
"type": "website",
"size": null,
"status": { "ready": false, "code": null, "description": "PENDING" },
"created": "2026-12-02T10:05: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": "retentionDays on reddit is at most 90."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Reddit's reason"
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Reddit's reason"
}
Redditの広告アカウントにカスタムオーディエンスを作成します。
Redditでは
typeで選べる2種類に対応しています。
customerList: 独自の人物リスト。オーディエンスメンバーからハッシュ化した識別子で追加します。website: Redditピクセルがサイト上で検出した人。
audienceにstatus.ready: falseとして返されます。Redditはその後、時間をかけてオーディエンスを作成します。一覧表示してstatus.readyがtrueになったことを確認し、投稿をブーストするときにそのidをtargeting.audiencesまたはtargeting.excludedAudiencesに指定します。
- Redditでは、ここでエンゲージメントオーディエンスや類似オーディエンスは作成できません。
type: engagementまたはtype: lookalikeを送信すると、code: 101付きの400が返されます。 - ブーストでターゲットにするには、オーディエンスで1,000人以上がマッチングされている必要があります。
ヘッダーパラメータ
ボディパラメータ
両方のタイプで次のパラメータを使用します。customerListまたはwebsite。各タイプは以下に示す専用のフィールドのみを受け付けます。別のタイプのフィールドを指定すると、そのフィールド名を示すcode: 101付きの400が返されます。新しいオーディエンスごとの新しい一意の値(UUIDなど)。同じキーでリクエストを繰り返すと、Ayrshareは
idempotentReplayed: trueを付けた最初のレスポンスを返し、2つ目のオーディエンスは作成しません。キーは代わりにIdempotency-Keyヘッダーで送ることもできます。両方を送る場合は一致させる必要があります。別のリクエストでキーを再利用した場合や、最初のリクエストがまだ処理中の場合は409が返されます。503はキーを確保できず何も作成されなかったことを意味します。後で同じキーで再試行してください。顧客リストオーディエンス
顧客リストには他の必須フィールドはなく、空の状態で作成されます。オーディエンスメンバーで人を追加します。ハッシュ化した識別子も個人データです。リストをアップロードする前にそのページを読んでください。 Redditでは、customerFileSourceはUSER_PROVIDED_ONLY以外は受け付けません。Redditが受け付けるのは独自のリストのみです。
ウェブサイトオーディエンス
このイベントを発生させた訪問者のみを対象にします。Redditの標準イベントは
PAGE_VISIT、VIEW_CONTENT、SEARCH、ADD_TO_CART、ADD_TO_WISHLIST、PURCHASE、LEAD、SIGN_UPで、大文字・小文字は問いません。それ以外の値はカスタムイベント名として送信されます。省略するとすべての訪問を数えます。urlContainsは受け付けません。RedditのウェブサイトオーディエンスにはURLフィルターがありません。
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "ca.129482487242999",
"name": "Site visitors 30d",
"type": "website",
"size": null,
"status": { "ready": false, "code": null, "description": "PENDING" },
"created": "2026-12-02T10:05: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": "retentionDays on reddit is at most 90."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Reddit's reason"
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Reddit's reason"
}