Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

Facebook Ad Search

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

Preço
A partir de $0.0011USD / chamada
Método
POST
Resposta
JSON
Parâmetros
1 obrigatórios · 10 opcionais

Playground

Entrada
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.
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da 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.

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
FacebookA partir de $0.0011 por chamadaJSON
FacebookA partir de $0.0012 por chamadaJSON
FacebookA partir de $0.00462 por chamadaJSON
FacebookA partir de $0.0012 por chamadaJSON
FacebookA partir de $0.0011 por chamadaJSON
FacebookA partir de $0.0012 por chamadaJSON

Guias:Best Facebook API in 2026: Pricing Compared

Perguntas

FAQ

Como eu uso a API Facebook Ad Search?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/facebook/ads-search com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API Facebook Ad Search?

A partir de $0.0011 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API Facebook Ad Search aceita?

Obrigatórios: query (string). Opcionais: adType (um de all, political_and_issue_ads), cursor (string), sortBy (um de impressions, recent), status (um de ALL, ACTIVE, INACTIVE), country (string) e endDate (string) e mais 4. A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API Facebook Ad Search retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor Facebook ou de uma chave de API?

Não. Facebook Ad Search funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Facebook separadamente.