Meta Ad Library API Documentation

Meta Ad Library API uses the /api/v1/search?engine=meta_ad_library endpoint to retrieve information about advertisers and their campaigns.

API Parameters

Search Params

  • Name
    q
    Required
    Optional
    Description

    Defines the keyword for your search. When present together with page_id or location_id, it will filter that page or location for the keyword.

    If you want to search for exact match, use "" to enclose the keyword.

  • Name
    page_id
    Required
    Optional
    Description

    Specifies the page's unique ID. You can obtain the page_id in two ways:

    • Use our Page Search API to retrieve the page ID directly from Meta Ad Library.
    • Inspect the URL from the Meta Ad Library website and locate the view_all_page_id parameter.

    When present, in the response there are additional fields ad_library_page_info and page blocks.

  • Name
    location_id
    Required
    Optional
    Description

    Filters ads based on a specific geographic location using Meta Ad Library's location targeting feature.

    This parameter must be used together with location_name and location_type to define the targeted area.

    All three values can be obtained using our Page Search API, which supports location search aligned with Meta Ad Library's internal targeting system.

Localization

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.

  • Name
    active_status
    Required
    Optional
    Description

    Filters ads by their status. Default is active. Supported values include: active, inactive, all.

  • Name
    media_type
    Required
    Optional
    Description

    Filters results based on media type. Default is all. Supported values are: all, video, image, meme, image_and_meme, none.

  • Name
    platforms
    Required
    Optional
    Description

    Comma-separated list of platforms where the ads appear. Supported values include: facebook, instagram, audience_network, messenger, threads.

  • Name
    start_date
    Required
    Optional
    Description

    The earliest date to include ads from, in format YYYY-MM-DD.

  • Name
    end_date
    Required
    Optional
    Description

    The latest date to include ads from, in format YYYY-MM-DD.

Pagination

  • Name
    next_page_token
    Required
    Optional
    Description

    A token for fetching the next set of results. You can obtain this token from the next_page_token field in the previous response

Engine

  • Name
    engine
    Required
    Required
    Description

    Specifies the search engine. Must be set to meta_ad_library.

Api Key

  • Name
    api_key
    Required
    Required
    Description

    Your API key for authentication. Include it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).

API Examples

Response with q parameter

Response with <code>q</code> parameter
GET
https://www.searchapi.io/api/v1/search?engine=meta_ad_library&q=nike+air
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "meta_ad_library",
  "q": "nike air"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_information": {
    "total_results": 6281
  },
  "ads": [
    {
      "ad_archive_id": "1617728395605978",
      "page_id": "107884398698308",
      "snapshot": {
        "page_id": "107884398698308",
        "page_profile_uri": "https://www.facebook.com/100084622209530/",
        "page_name": "Gracias Deals & Steals - Back-up Page",
        "page_profile_picture_url": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.35426-6/499910702_729060096327468_1358154244195169275_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=102&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=E0WLzg3JXCcQ7kNvwFVZqvQ&_nc_oc=Adl-Nd9FVCXSj5KCfRnvLWNSxaLLv9zjtBFk6xElQtlcOjih4pbViaXmGA2M5pv4niY&_nc_zt=14&_nc_ht=scontent-lga3-1.xx&_nc_gid=e7nFJDA2M3sZX0wv29WI9g&oh=00_AfL7afX4hCG9KwMYrZimVUdkUCvnwaO6sZoSXIVI-85xhQ&oe=68335566",
        "body": {
          "text": "✅SUPER P A U B O S  S A L E, LESS 300 pesos sa MINE PRICE PLUS SF 🥰 / 990-300=690 plus sf-Kids to Adult\n✅LESS 300 pesoss sa Mine price\n✅PAYMENT ASAP, papaship po tayo agad\n✅1-day RESERVATION, Wag na mag MINE pag walang fund at walang time mag Bayad.\n📌NO SHOPEE CHECK OUT, NO COD\n📌 MODE OF PAYMENT - GCASH\n📌J&T COURIER, Small pouch- 75-Luzon, 95-Visayas, 100-Mindanao/Medium-Small pouch- 125-Luzon, 155-Visayas, 165-Mindanao\n❌❌❌NO BOGUS BUYER❌❌❌"
        },
        "cta_text": "Send message",
        "cta_type": "MESSAGE_PAGE",
        "current_page_name": "Gracias Deals & Steals - Back-up Page",
        "display_format": "MULTI_IMAGES",
        "images": [
          {
            "original_image_url": "https://scontent-lga3-3.xx.fbcdn.net/v/t39.35426-6/499842667_695858026718810_7038353707914241785_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=CKjEE2LHTHkQ7kNvwEFqbVT&_nc_oc=AdkQZR0cWFu2oyG--p9LJyAbYikbSmcqquC_Q1HOHgW28vAaS_lmoAsYHpNUWM0EpIk&_nc_zt=14&_nc_ht=scontent-lga3-3.xx&_nc_gid=e7nFJDA2M3sZX0wv29WI9g&oh=00_AfKl9zN6OlI_UGTeNgWOpUDeozKWpEv7OWRRrkVo1llDpA&oe=68335FF3",
            "resized_image_url": "https://scontent-lga3-2.xx.fbcdn.net/v/t39.35426-6/500222594_701723405571995_6072258729477638081_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=107&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=MaFkx_VoeCIQ7kNvwEMZxek&_nc_oc=AdlpTP_6PWy1U-vKA7L-KmbRehexBxrg1f6eC0VsnW9_6SdXMTOSAB6WYVyLglhSKVY&_nc_zt=14&_nc_ht=scontent-lga3-2.xx&_nc_gid=e7nFJDA2M3sZX0wv29WI9g&oh=00_AfLyRjxLS6CHNs85_GX0Jfm-jJm3_eSOWmH7_YtJUh0AeA&oe=68334D8A"
          },
          ...
        ],
        "page_categories": [
          "Baby goods/kids goods"
        ],
        "page_entity_type": "PERSON_PROFILE",
        "page_like_count": 12445
      },
      "page_name": "Gracias Deals & Steals - Back-up Page",
      "categories": [
        "UNKNOWN"
      ],
      "collation_count": 1,
      "collation_id": "23984582757839029",
      "end_date": "2025-05-20T07:00:00Z",
      "entity_type": "PERSON_PROFILE",
      "gated_type": "ELIGIBLE",
      "hide_data_status": "NONE",
      "impressions_with_index": {
        "impressions_index": -1
      },
      "is_active": true,
      "publisher_platform": [
        "FACEBOOK"
      ],
      "start_date": "2025-05-20T07:00:00Z",
      "total_active_time": 10894
    },
    ...
  ],
  "pagination": {
    "next_page_token": "AQHRZwYe8-PeEJ9iooZ0kfUML9MAEJ6M7tif-IKqxLAOiwsTM_yd9drVJpvkJXkO11fU"
  }
}

Response with page_id parameter

Response with <code>page_id</code> parameter
GET
https://www.searchapi.io/api/v1/search?engine=meta_ad_library&page_id=80379486838
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "meta_ad_library",
  "page_id": "80379486838"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "search_information": {
    "total_results": 85,
    "ad_library_page_info": {
      "hidden_ads": 0,
      "page_profile_uri": "https://www.facebook.com/snipesusa/",
      "page_name": "SNIPES USA",
      "page_id": "80379486838",
      "page_verification": "BLUE_VERIFIED",
      "entity_type": "PERSON_PROFILE",
      "page_alias": "snipesusa",
      "likes": 89638,
      "page_category": "Shoe shop",
      "ig_verification": true,
      "ig_username": "snipes_usa",
      "ig_followers": 726330
    },
    "page": {
      "name": "SNIPES USA",
      "id": "80379486838",
      "about": {
        "text": "Snipesusa.com"
      },
      "pages_transparency_info": {
        "history_items": [
          {
            "event_time": "2022-11-29T18:42:32Z",
            "item_type": "NAME_CHANGE"
          },
          ...
        ],
        "id": "dHJhbnNwYXJlbmN5OjgwMzc5NDg2ODM4",
        "admin_locations": {
          "admin_country_counts": [
            {
              "count": 10,
              "country": {
                "iso_name": "United States",
                "id": "109078688522"
              }
            },
            ...
          ]
        }
      },
      "ad_library_page_targeting_insight": {
        "ad_library_page_targeting_summary": {
          "ds": "2025-05-18",
          "total_num_ads": 0,
          "total_spend_formatted": "0",
          "is_30_day_available": true,
          "is_90_day_available": true
        }
      }
    }
  },
  "ads": [
    {
      "ad_archive_id": "1045733057481599",
      "page_id": "80379486838",
      "snapshot": {
        "page_id": "80379486838",
        "page_profile_uri": "https://www.facebook.com/snipesusa/",
        "page_name": "SNIPES USA",
        "page_profile_picture_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/499379421_1362699668272529_1389137533849319599_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=110&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=D9TjipQgtwIQ7kNvwGvjMm9&_nc_oc=AdlOVb_oeG3sgQhKvFey-UqaCOpV1bugPjKsnsffUKrS8EAkGlC2O9-N26l3nlE_hP0&_nc_zt=14&_nc_ht=scontent-dfw5-1.xx&_nc_gid=pXK8Xoaw3Xcvpw1iCZscVw&oh=00_AfIigCFZm5RxLmZklXTStUYBZ407vR69V0F-cPFCUuRKEQ&oe=6833489B",
        "body": {
          "text": "@jumpman23, some places talk legacy. Philly lives it...\n\nPHILLY, we got something special just for you to celebrate the Jordan Rare Air Collection!\n\nPull up on us this Friday, May 23rd 10AM -7PM\n📍1515 Walnut St. Philadelphia, PA 19102\nSounds by @djdiamondkuts, @nashirah, and @vicb!\n\n#snipesusa"
        },
        "caption": "instagram.com",
        "cards": [
          {
            "caption": "instagram.com",
            "cta_text": "Learn More",
            "cta_type": "LEARN_MORE",
            "link_url": "https://www.instagram.com/snipes_usa/",
            "original_image_url": "https://scontent-dfw5-3.xx.fbcdn.net/v/t39.35426-6/499459161_1063618472379346_1275730622215862313_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=GcvHxS4SiX8Q7kNvwHoI_KF&_nc_oc=AdlU-TLJUkhvBrSYmAxUvJrmaETjXGshjatAMn1kkSbp99OYZeYrnch3vvaZ_vq_6wI&_nc_zt=14&_nc_ht=scontent-dfw5-3.xx&_nc_gid=pXK8Xoaw3Xcvpw1iCZscVw&oh=00_AfKVvREfJgzH2eZGOafALegPVd5mt4Pmd-wKaQz1xs5pLw&oe=68335FBE",
            "resized_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/499081845_683353564336604_666648904026969017_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=111&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=3QNAqs_tDT8Q7kNvwHpMAQJ&_nc_oc=Adnf1rOXoAp25IIFuSoNCXIzPJWTHPUokgGhgkrs-6xjohCkm70HWpzbDBsdVYS_5I8&_nc_zt=14&_nc_ht=scontent-dfw5-1.xx&_nc_gid=pXK8Xoaw3Xcvpw1iCZscVw&oh=00_AfLCGYpRW-fVjBrIG549z3fSVpMNtS6wdQJj0sjy-0xT8A&oe=6833513A"
          },
          ...
        ],
        "cta_text": "Learn more",
        "cta_type": "LEARN_MORE",
        "current_page_name": "SNIPES USA",
        "display_format": "CAROUSEL",
        "link_url": "https://www.instagram.com/snipes_usa/",
        "page_categories": [
          "Shoes"
        ],
        "page_entity_type": "PERSON_PROFILE",
        "page_like_count": 78887,
        "title": "SNIPES USA"
      },
      "page_name": "SNIPES USA",
      "categories": [
        "UNKNOWN"
      ],
      "end_date": "2025-05-20T07:00:00Z",
      "entity_type": "PERSON_PROFILE",
      "gated_type": "ELIGIBLE",
      "hide_data_status": "NONE",
      "impressions_with_index": {
        "impressions_index": -1
      },
      "is_active": true,
      "publisher_platform": [
        "FACEBOOK",
        "INSTAGRAM",
        "AUDIENCE_NETWORK",
        "THREADS"
      ],
      "start_date": "2025-05-20T07:00:00Z",
      "total_active_time": 49470
    },
    ...
  ],
  "paggination": {
    "next_page_token": "AQHRWkw8mohtZni5lbQ6vtGE8w_gukmFpW3Rf3zRBo7PhZs8deuadBjMCcvvUGSWkPlD"
  }
}

Response with location_id parameter

Response with <code>location_id</code> parameter
GET
https://www.searchapi.io/api/v1/search?ad_type=housing_ads&country=gb&engine=meta_ad_library&location_id=106078429431815&location_name=London%2C+United+Kingdom&location_type=CITY
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "meta_ad_library",
  "ad_type": "housing_ads",
  "country": "gb",
  "location_id": "106078429431815",
  "location_name": "London, United Kingdom",
  "location_type": "CITY"
}

response = requests.get(url, params=params)
print(response.text)
Response
{
  "ads": [
    {
      "ad_archive_id": "2271643146564524",
      "page_id": "128566944148844",
      "snapshot": {
        "page_id": "128566944148844",
        "page_profile_uri": "https://www.facebook.com/KentMediaDigital/",
        "page_name": "KM Digital",
        "page_profile_picture_url": "https://scontent-atl3-2.xx.fbcdn.net/v/t39.35426-6/499667330_1155207686368649_3661844388252124630_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=104&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=NwFFP8PejuoQ7kNvwEMJr5n&_nc_oc=AdlpnJSJ-5_NbGUzu0ylNdx7pwyMWLjgHZLLlLsw2hhC8umzB0TG2Xmkb8RuHsCKejY&_nc_zt=14&_nc_ht=scontent-atl3-2.xx&_nc_gid=lYfAAMOI_j3AqLo7JlCn4Q&oh=00_AfKdzXjnRrAaqR4tqMtbmnw8fBUpUmIb4RqnJzXP8EglKA&oe=683E5B91",
        "body": {
          "text": "{{product.brand}}"
        },
        "caption": "spindlewood.co.uk",
        "cards": [
          {
            "body": "Discover these incredible new luxury caravans and holiday lodges at Spindlewood Holiday Homes in Hastings from £24,950! 🏘🌅 \n\n🏡 RESIDENTIAL PARK HOMES     \n🏡 HOLIDAY HOME OWNERSHIP     \n🏡 TOURING CARAVANS & MOTORHOMES\n\nSpindlewood Holiday Homes are blessed with stunning landscapes and views, thousands of years of history and the glorious traditional coastline populated by Hastings, Rye, and Eastbourne. The homeowners at Spindlewood are treated to the delights of some of the most beautiful towns in the UK. \n \nFrom tranquil walks and historical gems to great food and quirky shopping, you will be spoiled with much to do throughout East Sussex. \n\nNestled in the beautiful Weald of Sussex parkland, Spindlewood is pet friendly and the park boasts a well-stocked fishing lake, ideal for any keen angler, and the cosy Spindlewood bar and restaurant.\n\n📞 01424 799 660 / 07887661177\n📧 sales@spindlewood.co.uk\n📍 Rock Lane Ore, Hastings TN35 4JN",
            "cta_text": "Learn More",
            "cta_type": "LEARN_MORE",
            "link_description": "Spindlewood Holiday Homes ",
            "link_url": "https://www.spindlewood.co.uk/",
            "original_image_url": "https://scontent-atl3-2.xx.fbcdn.net/v/t39.35426-6/500989678_2113999895677869_1612062699633003986_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=QFTa70LcSk0Q7kNvwE-6KKb&_nc_oc=AdkC-LFOvbVsqRArqRGX5bsuoCRSRKoEqoJNc58KXAxH3Cmko2ZnaA11RIaFfRCSvBw&_nc_zt=14&_nc_ht=scontent-atl3-2.xx&_nc_gid=lYfAAMOI_j3AqLo7JlCn4Q&oh=00_AfILrjbwRxEnFzS-USc4uniX5CdBnk1PsEnFGkSoC-itBw&oe=683E3D1A",
            "resized_image_url": "https://scontent-atl3-1.xx.fbcdn.net/v/t39.35426-6/500064160_4188263861402680_3555161474627150544_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=rDFlw0l7dvYQ7kNvwGNp2my&_nc_oc=AdkjyqjpGRSZucFbPrz113M9T0BJ64CLEzwEJlBu7TWgoes4VxqKDyW2QTgNqjJMNYQ&_nc_zt=14&_nc_ht=scontent-atl3-1.xx&_nc_gid=lYfAAMOI_j3AqLo7JlCn4Q&oh=00_AfICMlfCEVT5hDICmyWrsPdr4Uzm3_VjW0SfysU81vM3SQ&oe=683E57FC",
            "title": "Luxury holiday homes in Hastings"
          },
          ...
        ],
        "cta_text": "Learn more",
        "cta_type": "LEARN_MORE",
        "current_page_name": "KM Digital",
        "display_format": "DCO",
        "link_description": "{{product.description}}",
        "link_url": "https://www.spindlewood.co.uk/",
        "page_categories": [
          "Media/news company"
        ],
        "page_entity_type": "PERSON_PROFILE",
        "page_like_count": 2501,
        "title": "{{product.name}}"
      },
      "is_active": true,
      "page_name": "KM Digital",
      "categories": [
        "HOUSING"
      ],
      "collation_count": 1,
      "collation_id": "715270480886002",
      "end_date": "2025-05-29T07:00:00Z",
      "entity_type": "PERSON_PROFILE",
      "gated_type": "ELIGIBLE",
      "hide_data_status": "NONE",
      "impressions_with_index": {
        "impressions_index": -1
      },
      "publisher_platform": [
        "FACEBOOK",
        "INSTAGRAM",
        "AUDIENCE_NETWORK",
        "MESSENGER",
        "THREADS"
      ],
      "start_date": "2025-05-27T07:00:00Z"
    },
    ...
  ],
  "pagination": {
    "next_page_token": "AQHR6io81Inp9ru3bi1YgK-C0SQHJrSXZEWc9LY55tjeVasQs4PGs3hSK96vG8Cpc1wL"
  }
}