brand_idsarraybắt buộc
Brand ID(s) to search for. Can be a single ID or multiple IDs separated by commas.
https://api.sandbase.ai/v1/api/foreplay/brand-adsList the social ads a brand has run by Foreplay brand ID, with creative, copy, platforms, run dates and landing page, filtered by format, platform and run time.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
List the social ads a brand has run by Foreplay brand ID, with creative, copy, platforms, run dates and landing page, filtered by format, platform and run time.
curl -X POST "https://api.sandbase.ai/v1/api/foreplay/brand-ads" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"brand_ids": ["3YfFtyvZ3viTAbbLaWLV"], "limit": 3}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
brand_ids | array | Yes | Brand ID(s) to search for. Can be a single ID or multiple IDs separated by commas. |
limit | integer | No | Pagination limit (max 250). Controls the number of ads returned per request. |
collect | string | No | Best-effort live fallback. If the cached results are empty and collect=true, the API translates each brand id to its Meta page id (adlibraryid), kicks off a live fetch through our Spyder pipeline, and polls for ~30 s |
cursor | string | No | Cursor for pagination. Use the cursor value from the previous response's metadata to get the next page of results. |
display_format | string | No | Filter by one or more display formats. Available formats (11): carousel, dco, dpa, event, image, multi_images, multi_medias, multi_videos, page_like, text, video Example: ?display_format=video&display_format=carousel |
end_date | string | No | End date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To include all results for a |
languages | string | No | Filter by languages. Accepts various language formats: 'french', 'FR', 'romanian', 'ro', 'english', 'en', etc. Example: ?languages=en&languages=fr |
live | string | No | Filter ads by live status. true means currently active ads, false means inactive ads. Leave empty to include both. |
market_target | string | No | Filter by market target. Available targets: b2b (business-to-business), b2c (business-to-consumer) Example: ?market_target=b2b |
niches | string | No | Filter by one or more niches. Available niches: travel, food, fashion, beauty, health, technology, automotive, finance, education, entertainment, sports, home, pets, business, other Example: `?niches=travel&niches=fashio |
order | string | No | Order of results: 'newest' (default), 'oldest', 'longest_running', or 'most_relevant'. Sorts ads by creation date, longest running duration, or relevance to the search query. |
publisher_platform | string | No | Filter by one or more publisher platforms. Available platforms: facebook, instagram, audience_network, messenger, tiktok, youtube, linkedin, threads, whatsapp Example: `?publisher_platform=facebook&publisher_platform=ins |
running_duration_max_days | string | No | Filter ads by maximum running duration in days. Must be a positive integer. |
running_duration_min_days | string | No | Filter ads by minimum running duration in days. Must be a positive integer. |
start_date | string | No | Start date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To get all ads from a spec |
video_duration_max | string | No | Filter ads by maximum video duration in seconds. Only applies to video ads. |
video_duration_min | string | No | Filter ads by minimum video duration in seconds. Only applies to video ads. |
Billed at the actual upstream cost of each call (about $0.0525 for the request above). Failed calls are not charged.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/api/foreplay/brand-ads" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 3,
"order": "newest",
"collect": "false",
"brand_ids": [
"3YfFtyvZ3viTAbbLaWLV"
]
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
brand_idsarraybắt buộcBrand ID(s) to search for. Can be a single ID or multiple IDs separated by commas.
limitintegerNumber of results (1-20). Each returned item is billed at about $0.0175, so this caps the cost of one call.
Mặc định: 10
collectstringBest-effort live fallback. If the cached results are empty and `collect=true`, the API translates each brand id to its Meta page id (`adlibraryid`), kicks off a live fetch through our Spyder pipeline, and polls for ~30 seconds. Returns whatever is available at the end of the window — may still be empty if a brand has no Meta page on file, the page is restricted, deleted, or simply isn't running ads. Not perfect — use it as a fallback when the regular response is empty, not as a default.
Mặc định: "false"
cursorstringCursor for pagination. Use the cursor value from the previous response's metadata to get the next page of results.
display_formatstringFilter by one or more display formats. Available formats (11): carousel, dco, dpa, event, image, multi_images, multi_medias, multi_videos, page_like, text, video Example: `?display_format=video&display_format=carousel`
Giá trị có thể dùng: carousel, dco, dpa, event, image, multi_images, multi_medias, multi_videos, page_like, text, video
end_datestringEnd date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To include all results for a given day, set end_date to 'YYYY-MM-DD 23:59:59' or to the next day at '00:00:00'. Examples: start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59.
languagesstringFilter by languages. Accepts various language formats: 'french', 'FR', 'romanian', 'ro', 'english', 'en', etc. Example: `?languages=en&languages=fr`
livestringFilter ads by live status. `true` means currently active ads, `false` means inactive ads. Leave empty to include both.
market_targetstringFilter by market target. Available targets: b2b (business-to-business), b2c (business-to-consumer) Example: `?market_target=b2b`
nichesstringFilter by one or more niches. Available niches: travel, food, fashion, beauty, health, technology, automotive, finance, education, entertainment, sports, home, pets, business, other Example: `?niches=travel&niches=fashion`
orderstringOrder of results: 'newest' (default), 'oldest', 'longest_running', or 'most_relevant'. Sorts ads by creation date, longest running duration, or relevance to the search query.
Mặc định: "newest"
Giá trị có thể dùng: newest, oldest, longest_running, most_relevant
publisher_platformstringFilter by one or more publisher platforms. Available platforms: facebook, instagram, audience_network, messenger, tiktok, youtube, linkedin, threads, whatsapp Example: `?publisher_platform=facebook&publisher_platform=instagram`
Giá trị có thể dùng: facebook, instagram, audience_network, messenger, tiktok, youtube, linkedin, threads, whatsapp
running_duration_max_daysstringFilter ads by maximum running duration in days. Must be a positive integer.
running_duration_min_daysstringFilter ads by minimum running duration in days. Must be a positive integer.
start_datestringStart date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To get all ads from a specific day, set end_date to 'YYYY-MM-DD 23:59:59' or to the next day at '00:00:00'. Examples: start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59.
video_duration_maxstringFilter ads by maximum video duration in seconds. Only applies to video ads.
video_duration_minstringFilter ads by minimum video duration in seconds. Only applies to video ads.
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Foreplay Brand AdsAPI này Foreplay | Từ $0.0525 mỗi lần gọi | JSON |
Foreplay | Từ $0.0525 mỗi lần gọi | JSON |
Foreplay | Từ $0.1225 mỗi lần gọi | JSON |
Foreplay | Từ $0.0175 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/foreplay/brand-ads với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
Từ $0.0525 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: brand_ids (array). Tùy chọn: limit (integer), collect (string), cursor (string), display_format (một trong số carousel, dco, dpa, event, image, multi_images, multi_medias, multi_videos, page_like, text, video), end_date (string) và languages (string) và 10 mục khác. Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ).
Không. Foreplay Brand Ads chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Foreplay.