Meta Ad Library Page Search API Documentation

GET   /api/v1/search?engine=meta_ad_library_page_search

This API allows you to search for Facebook and Instagram pages listed in the Meta Ad Library using a given keyword. It returns three separate lists:

  • page_results – Contains metadata for pages that match the keyword. Each entry includes a page ID, name, verification status, and other identifying information.
  • location_results – Includes IDs and metadata for countries or regions associated with the search query, useful for location-specific ad filtering
  • keyword_results – Provides autocomplete-style suggestions related to the original keyword, aiding in refining the search.

You can later use either the page ID or a location ID with the Meta Ad Library Ads Search API to retrieve the actual ads associated with them.

API Parameters

Search Params

  • Name
    q
    Required
    Required
    Description

    Defines the keyword for your search.

Localization

  • Name
    country
    Required
    Optional
    Description

    Specifies the country for your search. The default value is ALL. Check the full list of supported Meta Ad Library countries and their supported ad_type.

Filters

  • Name
    ad_type
    Required
    Optional
    Description

    Specifies the type of ads to return. Default is all. Supported values include: all, political_and_issue_ads, housing_ads, employment_ads, credit_ads.

    Note: Availability may depend on the selected country. Check the full list of supported Meta Ad Library countries and their supported ad_type.

Engine

  • Name
    engine
    Required
    Required
    Description

    Specifies the search engine. Must be set to meta_ad_library_page_search.

Api Key

  • Name
    api_key
    Required
    Required
    Description

    Your API key for authentication. Include it as a query parameter (?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).

Zero Data Retention

  • Name
    zero_retention
    Enterprise Only
    Enterprise Only
    Required
    Optional
    Description

    Set this parameter to true to disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.

API Examples

Response with page_results block

Response with <code>page_results</code> block
GET
https://www.searchapi.io/api/v1/search?engine=meta_ad_library_page_search&q=tesl
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "meta_ad_library_page_search",
  "q": "tesl"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_wr07vRBGpw4dcnRZgb6ZlXJj",
    "status": "Success",
    "created_at": "2025-05-28T21:01:34Z",
    "request_time_taken": 1.86,
    "parsing_time_taken": 0.01,
    "total_time_taken": 1.87,
    "request_url": "https://www.facebook.com/ads/library",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_wr07vRBGpw4dcnRZgb6ZlXJj.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_wr07vRBGpw4dcnRZgb6ZlXJj"
  },
  "search_parameters": {
    "engine": "meta_ad_library_page_search",
    "q": "tesl",
    "country": "ALL",
    "ad_type": "all"
  },
  "page_results": [
    {
      "page_id": "110887675450872",
      "category": "Brand",
      "image_uri": "https://scontent.fybz1-1.fna.fbcdn.net/v/t39.30808-1/410138141_122117126396102063_4488524891669120305_n.jpg?stp=dst-jpg_s200x200_tt6&_nc_cat=103&ccb=1-7&_nc_sid=418b77&_nc_ohc=bWBmywJCaEYQ7kNvwFxjLBs&_nc_oc=AdmvTNXA3CJP5w_K-QlPodS6VYF9ymhts6BBHuAkmWM2HlnEMWtMYsO_9u-CbcGlxaE&_nc_zt=24&_nc_ht=scontent.fybz1-1.fna&_nc_gid=SIR_nqWZ1_Nyvrm-FAFABw&oh=00_AfKjN_P6p56IBujD12YAKEn1r_YuaQdFMC5AvLEOY6fbKQ&oe=683D306D",
      "likes": 2589,
      "verification": "NOT_VERIFIED",
      "name": "Teslahubs",
      "entity_type": "PERSON_PROFILE",
      "ig_username": "teslahubs",
      "ig_followers": 11057,
      "page_alias": "teslahubs"
    },
    ...
  ]
}

Response with location_results block

Response with <code>location_results</code> block
GET
https://www.searchapi.io/api/v1/search?ad_type=housing_ads&country=gb&engine=meta_ad_library_page_search&q=lond
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "meta_ad_library_page_search",
  "q": "lond",
  "country": "gb",
  "ad_type": "housing_ads"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "location_results": [
    {
      "id": "106078429431815",
      "location_type": "CITY",
      "name": "London, United Kingdom",
      "image_uri": "https://scontent-hou1-1.xx.fbcdn.net/v/t1.30497-1/83245568_1845797888897938_3274147281632231424_n.png?stp=c81.0.275.275a_dst-png_s200x200&_nc_cat=1&ccb=1-7&_nc_sid=613f8e&_nc_ohc=_-pPTAGFbWAQ7kNvwGQJoam&_nc_oc=AdmJvd33g0ubfdOGmN7lX2m65PPNag5fmpehKBaA3Tc01B9XCP1vC15D4zhV2VqaLQM&_nc_zt=24&_nc_ht=scontent-hou1-1.xx&oh=00_AfI_zS33S4vK-k-AqJ16O_ADoMTmZB0H_joL8vR3jezUeg&oe=68600654"
    },
    ...
  ],
  "page_results": [...],
}

Response with keywords_results block

Response with <code>keywords_results</code> block
GET
https://www.searchapi.io/api/v1/search?country=us&engine=meta_ad_library_page_search&q=travel
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "meta_ad_library_page_search",
  "q": "travel",
  "country": "us"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "keyword_results": [
    "travel tax",
    "travel perfect"
  ],
  "page_results": [...]
}