Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

Facebook Ad Search

Docs 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.

Prix
À partir de $0.0011USD / appel
Méthode
POST
Réponse
JSON
Paramètres
1 obligatoires · 10 facultatifs

Bac à sable

Entrée
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.
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

README de l'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.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
FacebookÀ partir de $0.0011 par appelJSON
FacebookÀ partir de $0.0012 par appelJSON
FacebookÀ partir de $0.00462 par appelJSON
FacebookÀ partir de $0.0012 par appelJSON
FacebookÀ partir de $0.0011 par appelJSON
FacebookÀ partir de $0.0012 par appelJSON

Guides :Best Facebook API in 2026: Pricing Compared

Questions

FAQ

Comment utiliser l’API Facebook Ad Search ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/facebook/ads-search avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.

Combien coûte l’API Facebook Ad Search ?

À partir de $0.0011 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.

Quels paramètres l’API Facebook Ad Search accepte-t-elle ?

Obligatoire : query (string). Facultatif : adType (l’un de all, political_and_issue_ads), cursor (string), sortBy (l’un de impressions, recent), status (l’un de ALL, ACTIVE, INACTIVE), country (string) et endDate (string) et 4 de plus. Le tableau des paramètres et le Playground sur cette page listent tous les champs.

Que renvoie l’API Facebook Ad Search ?

Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.

Ai-je besoin d’un compte développeur ou d’une clé API Facebook ?

Non. Facebook Ad Search fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Facebook séparément.