Sand AISand AI MAGI-2MAGI-2 kini tersedia di SandBase: video 1080p dengan audio nativeCoba sekarang

Facebook Ad Search

Dokumentasi API
https://api.sandbase.ai/v1/api/facebook/ads-search

Search the Meta Ad Library by keyword and get matching ads (advertiser, creative text, CTA, platforms, and run dates) with cursor pagination.

Harga
Dari $0.0011USD / panggilan
Metode
POST
Respons
JSON
Parameter
1 wajib · 10 opsional

Playground

Input
Keyword to search the Meta Ad Library for (e.g. "protein powder").
Restrict to all ads (default) or only political and issue ads.
Opaque pagination cursor from a previous response's nextCursor.
Sort order: impressions (highest first, the default) or recent (most recent).
Ad status filter.
Two-letter country code to scope results. Omit for all countries.
Filter to ads with impressions on or before this date, in YYYY-MM-DD format.
Creative media type filter.
Filter to ads with impressions on or after this date, in YYYY-MM-DD format.
Match mode for the query: loose keyword match (keyword_unordered, the default) or exact phrase (keyword_exact_phrase).
Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `totalResults`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on an ad that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.
OutputSiap

Output Anda akan muncul di sini

Lengkapi input, lalu klik Run.

README API

Facebook Ad Search API

Returns ads from the Meta Ad Library that match a keyword. Each ad includes the advertiser page, creative text, call to action, platforms, and start and end dates. The only required input is query.

Use cases

  • Track which creatives and offers a competitor runs for a brand name.
  • Collect ad copy and call-to-action types for a keyword to study how a niche advertises.
  • Find the advertiser pages that run ads for a product term, then check their page details.
  • Pull image links and landing page URLs for ads that mention a brand.

Request

curl -X POST "https://api.sandbase.ai/v1/api/facebook/ads-search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "nike", "country": "US", "searchType": "keyword_exact_phrase"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
querystringYesKeyword to search the Meta Ad Library for (e.g. "protein powder").
adTypestringNoRestrict to all ads (default) or only political and issue ads.
countrystringNoTwo-letter country code to scope results. Omit for all countries.
cursorstringNoOpaque pagination cursor from a previous response's nextCursor.
endDatestringNoFilter to ads with impressions on or before this date, in YYYY-MM-DD format.
mediaTypestringNoCreative media type filter.
requireFieldsarrayNoOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example totalResults, and it is served only by a source that returns every o
searchTypestringNoMatch mode for the query: loose keyword match (keyword_unordered, the default) or exact phrase (keyword_exact_phrase).
sortBystringNoSort order: impressions (highest first, the default) or recent (most recent).
startDatestringNoFilter to ads with impressions on or after this date, in YYYY-MM-DD format.
statusstringNoAd status filter.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "ads": [
      {
        "active": true,
        "adCount": null,
        "caption": "play.google.com",
        "categories": [
          "UNKNOWN"
        ],
        "creatives": [],
        "ctaText": "Install now",
        "ctaType": "INSTALL_MOBILE_APP",
        "displayFormat": "IMAGE",
        "endDate": 1793606400,
        "id": "1550534860016399",
        "isReshared": false,
        "linkDescription": ""
      }
    ],
    "nextCursor": "cur_I3725J-mWy22VxKd8YIRew",
    "totalResults": 19895
  },
  "found": true
}

Response fields

FieldMeaning
data.ads[].idID of the ad in the Meta Ad Library. sourceUrl links to the ad's library page.
data.ads[].pageName / pageId / pageUrlName, ID and Facebook URL of the advertiser page that runs the ad.
data.ads[].text / titleMain body text and headline of the ad.
data.ads[].ctaText / ctaTypeButton label shown on the ad (such as Shop now) and its type code (such as SHOP_NOW).
data.ads[].platformsList of platforms the ad runs on, such as FACEBOOK, INSTAGRAM, MESSENGER and AUDIENCE_NETWORK.
data.ads[].startDate / endDateStart and end of the ad run as Unix timestamps in seconds.
data.ads[].activetrue when the ad is currently active.
data.ads[].displayFormatCreative format, for example IMAGE or DPA. Ads in DPA format carry several items in creatives.
data.ads[].creatives[]Per-item creatives for multi-item ads. Each has title, body, image, linkUrl, ctaText and ctaType.
data.ads[].media[]Media files of the ad. Each has a type and a url.
data.totalResultsTotal number of ads that match the search.

Notes

  • Pass nextCursor from the response as cursor in the next request to get the next page.
  • Ad IDs are numeric strings. Use them with Facebook Ad Details to look up one ad.
  • To list ads for one advertiser instead of a keyword, use Facebook Company Ads.
  • adCount is null for the ads in this sample.

Pricing

Billed at the actual cost of each call, about $0.0011 for the request above. Failed calls are not charged.

Jelajahi lebih lanjut

API Terkait

Semua APIs
APIHargaRespons
FacebookDari $0.0011 per panggilanJSON
FacebookDari $0.0012 per panggilanJSON
FacebookDari $0.00462 per panggilanJSON
FacebookDari $0.0012 per panggilanJSON
FacebookDari $0.0011 per panggilanJSON
FacebookDari $0.0012 per panggilanJSON

Panduan:Best Facebook API in 2026: Pricing Compared

Pertanyaan

FAQ

Bagaimana cara menggunakan API Facebook Ad Search?

Kirim permintaan POST ke https://api.sandbase.ai/v1/api/facebook/ads-search dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.

Berapa biaya API Facebook Ad Search?

Mulai dari $0.0011 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.

Parameter apa yang diterima API Facebook Ad Search?

Wajib: query (string). Opsional: adType (salah satu dari all, political_and_issue_ads), cursor (string), sortBy (salah satu dari impressions, recent), status (salah satu dari ALL, ACTIVE, INACTIVE), country (string) dan endDate (string) dan 4 lainnya. Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.

Apa yang dikembalikan API Facebook Ad Search?

Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.

Apakah saya memerlukan akun developer atau kunci API Facebook?

Tidak. Facebook Ad Search berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Facebook secara terpisah.