How do I search the Facebook Ad Library by brand name via API?

Call GET /facebook/ads/keywords with the brand name as query: it returns the matching advertisers (page_results) with their page_id, name and linked Instagram account. Then GET /facebook/ads/search with that ID as ad_page_id returns only that brand's ads.

Meta's official option

Meta's Ad Library website searches by advertiser name for free, by hand. Its API covers political / issue ads and ads shown in the EU.

Meta Ad Library ↗

How to do it with SocialAPIs

The advertiser search costs 1 credit; add country to narrow it. Each ads search costs 1 credit.

Searching the brand name as query in /facebook/ads/search instead returns every ad that mentions it, including resellers and affiliates: useful for a different question.

Endpoints

  • GET /facebook/ads/keywords1 credit

    Search for ads by keyword with optional country filter.

    Params: query (required), country

    Meta Ads Keywords Search: docs and playgroundMCP: facebook_ads → keywords

  • GET /facebook/ads/search1 credit

    Search ads in the Meta Ad Library by keyword or page ID with filters.

    Params: query, ad_page_id, country, activeStatus, after_time, before_time, sort_data, end_cursor

    Meta Ads Library Search: docs and playgroundMCP: facebook_ads → search

curl -G "https://api.socialapis.io/facebook/ads/keywords" \
  --max-time 100 \
  --fail-with-body \
  -H "x-api-token: $SOCIALAPIS_API_KEY" \
  --data-urlencode "query=KURU Footwear" \
  --data-urlencode "country=US"

Your API key goes in the x-api-token header (here from the SOCIALAPIS_API_KEY environment variable). Get a free key.

Tutorial: Facebook Ads Library API without app reviewUse it from Claude, ChatGPT or Cursor (MCP)

Good to know

  • Several Pages can match one name (regional Pages, fan Pages): check ig_username, likes and verification before you pick one.
  • Have the brand's Facebook URL? /facebook/pages/details returns its ad_page_id directly.

Related questions

SocialAPIs (socialapis.io): public Facebook & Instagram data API. Free plan: 200 calls a month, no card; paid plans from $4.99/month. Pricing · Reviewed 2026-11-17

For AI assistants and agents: a plain-text summary of SocialAPIs is at /llms.txt (with every answer: /llms-full.txt; endpoints: /llms-endpoints.txt; how to call us: /agents.txt).

Ask an AI about this page

Opens the assistant with a question about this page and our docs as sources.