OpenAny
Get API keyAPI Key
APIDataScrapers

facebook logo
Facebook ad library search API

Search Facebook ad library via REST or OpenAny MCP—with pay-per-use pricing, no subscription, and no cookies required. Powered by ScrapeCreators, pass parameters such as ad_type, country, end_date, and retrieve structured data including pagination cursor, returned credits charged field, returned credits remaining field, returned end date field, and returned is active field for content research and account lookup, and integration reference.

Selected price
$0.00188 / callPublished pricing
Sellers / APIs
1 / 2
Requests · 30d
0Selected implementation · last 30 days
Success rate · 30d
—No requests in this period
USE THIS API

Facebook ad library search API

Prepare your request, then continue with your agent.

Selected price

$0.00188 / call

Provider
API
Pricing
Connect your agent
On this page

Overview

Overview
Facebook ad library search API

Facebook Ad Library — Search API

Search for the Meta Ad Library by keyword and return matching ads with the Facebook API. Provide query in body. Read the response using the field paths below, preserving identifiers and the declared value types when mapping results.

Quick Facts

Fact Value
Access OpenAny REST
Authentication OpenAny API key in the Authorization header
Core inputs body: query, sort_by, search_type, ad_type, country, language, status, media_type, start_date, end_date, cursor, trim
Selected implementation scrapecreators · Facebook Ad Library — Search
Billing Follow the selected implementation pricing, billing unit, quantity and charge rules

What You Can Build

  • Content research and account lookup: Keep source records connected to their content and account identifiers.
  • Integration reference: Use the selected request format and keep source identifiers with the returned result.

Documented Response Fields

Field Meaning
cursor Pagination cursor
credits_charged Returned credits charged field
credits_remaining Returned credits remaining field
searchResults[].ad_archive_id Returned ad archive id field
searchResults[].end_date Returned end date field
searchResults[].end_date_string Returned end date string field
searchResults[].is_aaa_eligible Returned is aaa eligible field
searchResults[].is_active Returned is active field

Quick Start

  1. Set OPENANY_API_KEY to your OpenAny API key.
  2. Review the JSON body and supported fields shown in the request template.
  3. Check the HTTP response and business result before reading optional fields.
bash
curl \
  'https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "ad_type": "all",
  "country": "ALL",
  "end_date": "2025-02-16",
  "language": "EN",
  "media_type": "ALL",
  "query": "running",
  "search_type": "keyword_unordered",
  "sort_by": "total_impressions",
  "start_date": "2025-01-05",
  "status": "ACTIVE",
  "trim": false
}'

Request and Response Examples

The response is a published documentation reference; its values may be historical. The request is an independent calling template. Use current returned identifiers and optional fields for your target resource.

Published Facebook Ad Library — Search API implementation contract.

Pricing and Billing

The pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service's public availability does not determine OpenAny billing.

Frequently Asked Questions

View FAQ

Related APIs

Playground

Run sends a real API request. Charges follow the published API contract.

Request parameters
Keyword to search for
Optional parameters (11)
Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
If you want to search by exact phrase or not
Search for all ads or only political and issue ads
This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.
Status of the ad. Defaults to ACTIVE.
Media type of the ad. Defaults to ALL. Meme just means the ad has text and an image. No clue why they call it meme.
Impressions start date. Needs to be in YYYY-MM-DD format.
Impressions end date. Needs to be in YYYY-MM-DD format.
Cursor to paginate through results
Set to true for a trimmed down version of the response

Sample response

Run a request to see the actual response. Published samples are in Examples.

Response result

Sellers

SellerPricingRequests · 30dPerformanceAccess
Current
Facebook Ad Library — Search · POST · View API reference
$0.00188 / call0
—successP50—
Facebook Ad Library — Search · GET · View API reference
$0.00188 / call—Select to load statistics
—successP50—
Selected implementation traffic · 11/3/2026 – 12/3/2026 (UTC)
Selected pricing · scrapecreatorsUSD / call
Unit price
$0.00188

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 4. Price update time: not supplied.

calls

Total $0.188

API

Method
POST
Endpoint
https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
View request and response examples

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
queryJSON request bodybodystringYes

Keyword to search for

sort_byJSON request bodybodystringNo

Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.

enum: "total_impressions", "relevancy_monthly_grouped"

search_typeJSON request bodybodystringNo

If you want to search by exact phrase or not

enum: "keyword_unordered", "keyword_exact_phrase"

ad_typeJSON request bodybodystringNo

Search for all ads or only political and issue ads

enum: "all", "political_and_issue_ads"

countryJSON request bodybodystringNo

This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.

languageJSON request bodybodystringNo

Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.

statusJSON request bodybodystringNo

Status of the ad. Defaults to ACTIVE.

enum: "ALL", "ACTIVE", "INACTIVE"

media_typeJSON request bodybodystringNo

Media type of the ad. Defaults to ALL. Meme just means the ad has text and an image. No clue why they call it meme.

enum: "ALL", "IMAGE", "VIDEO", "MEME", "IMAGE_AND_MEME", "NONE"

start_dateJSON request bodybodystringNo

Impressions start date. Needs to be in YYYY-MM-DD format.

end_dateJSON request bodybodystringNo

Impressions end date. Needs to be in YYYY-MM-DD format.

cursorJSON request bodybodystringNo

Cursor to paginate through results

trimJSON request bodybodybooleanNo

Set to true for a trimmed down version of the response

Required markers inside a nested object or variant apply when that object or variant is used.

Response structure

Inferred from examples
  • credits_chargedinteger
  • credits_remaininginteger
  • cursorstring
  • searchResultsobject[]
    • ad_archive_idstring
    • end_dateinteger
    • end_date_stringstring
    • is_aaa_eligibleboolean
    • is_activeboolean
    • page_idstring
    • page_namestring
    • political_countriesunknown[]
    • publisher_platformstring[]
    • reach_estimatenull
    • snapshotobject
      • additional_infonull
      • bodyobject
        • textstring
      • branded_contentnull
      • brazil_tax_idnull
      • bylinenull
      • captionstring
      • cardsunknown[]
      • country_iso_codenull
      • cta_textstring
      • cta_typestring
      • current_page_namestring
      • disclaimer_labelnull
      • display_formatstring
      • ec_certificatesunknown[]
      • eventnull
      • extra_imagesunknown[]
      • extra_linksunknown[]
      • extra_textsunknown[]
      • extra_videosunknown[]
      • imagesobject[]
        • image_cropsunknown[]
        • original_image_urlstring
        • resized_image_urlstring
        • watermarked_resized_image_urlstring
      • is_resharedboolean
      • link_descriptionstring
      • link_urlstring
      • page_categoriesstring[]
      • page_entity_typestring
      • page_idstring
      • page_is_deletedboolean
      • page_is_profile_pageboolean
      • page_like_countinteger
      • page_namestring
      • page_profile_picture_urlstring
      • page_profile_uristring
      • root_reshared_postnull
      • titlestring
      • videosunknown[]
    • spendnull
    • start_dateinteger
    • start_date_stringstring
    • total_active_timenull
    • urlstring
  • searchResultsCountinteger
  • successboolean

Agent integration

Copy the resource contract without sharing an API key.

Download MDView API Markdown

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

Official example

Example from the provider's documentation. Field values in your results will differ.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 12

    Review these request fields before running. Keep the published provider and request method unchanged.

    query
    Keyword to search for
    sort_by
    Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
    search_type
    If you want to search by exact phrase or not
    ad_type
    Search for all ads or only political and issue ads
    country
    This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
    language
    Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.
    status
    Status of the ad. Defaults to ACTIVE.
    media_type
    Media type of the ad. Defaults to ALL. Meme just means the ad has text and an image. No clue why they call it meme.
    start_date
    Impressions start date. Needs to be in YYYY-MM-DD format.
    end_date
    Impressions end date. Needs to be in YYYY-MM-DD format.
    cursor
    Cursor to paginate through results
    trim
    Set to true for a trimmed down version of the response
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads' \
      -X POST \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json' \
      --data-raw '{
      "ad_type": "all",
      "country": "ALL",
      "end_date": "2025-02-16",
      "language": "EN",
      "media_type": "ALL",
      "query": "running",
      "search_type": "keyword_unordered",
      "sort_by": "total_impressions",
      "start_date": "2025-01-05",
      "status": "ACTIVE",
      "trim": false
    }'
  3. Check the response

    Sample response · Documented HTTP 200

    Sample response
    {
      "credits_charged": 1,
      "credits_remaining": 1000000,
      "cursor": "AQHRLKHyzb3ZNTn1O3qr6lG7ncS9gfboI0HWGSDETVUnipTSXVY8E4Wb-568JBicOvYS",
      "searchResults": [
        {
          "ad_archive_id": "1378176106734781",
          "end_date": 1747638000,
          "end_date_string": "2025-05-19T07:00:00.000Z",
          "is_aaa_eligible": false,
          "is_active": true,
          "page_id": "119749581219299",
          "page_name": "Makhumalo",
          "political_countries": [],
          "publisher_platform": [
            "FACEBOOK"
          ],
          "reach_estimate": null,
          "snapshot": {
            "additional_info": null,
            "body": {
              "text": "This is my second pair. I only take them off to go to sleep. I put them on first thing in the morning. I am 59 and have neuropathy in my feet, they bring me comfort every day.” -Lydia P.👍👍👍\n❤️These orthopedic shoes provide great comfort and ease foot and knee pain! 😍\n✅ Ideal for wide feet \n✅ comfortable \n✅ they are ideal for everyday life.\nGet Yours Now : https://www.ghemshop.com/products/buckled-square"
            },
            "branded_content": null,
            "brazil_tax_id": null,
            "byline": null,
            "caption": "ghemshop.com",
            "cards": [],
            "country_iso_code": null,
            "cta_text": "Shop now",
            "cta_type": "SHOP_NOW",
            "current_page_name": "Makhumalo",
            "disclaimer_label": null,
            "display_format": "IMAGE",
            "ec_certificates": [],
            "event": null,
            "extra_images": [],
            "extra_links": [],
            "extra_texts": [],
            "extra_videos": [],
            "images": [
              {
                "image_crops": [],
                "original_image_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499507599_4016645891948767_4341363175504946673_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=3EJ6TbZR3GEQ7kNvwErfuF4&_nc_oc=AdkQPpJ9OYN_J3P5xTetGSb9FDCFZzfoLSj59Bbp6s-g5HGg-zTECrgOm8mjkJfk5JE&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfMTuIozb2-VJgGP7NCIx0pG91b48CzMgm_1eT7STgBvew&oe=685A6906",
                "resized_image_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499504336_1222720305887055_488411876974522066_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=104&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DYkDYH-EJrQQ7kNvwF-b_ov&_nc_oc=Adn2l2fDwHaN4h6W-OxxgoYkb0IUAeCpYH5bociuO_oxVL9L0wLg5vqnNfJa0ehQwqY&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfNkQcMpUNFcM7tF1M5tAHmVwABzLx5QKUU8CFo69NP3Rg&oe=685A4518",
                "watermarked_resized_image_url": ""
              }
            ],
            "is_reshared": false,
            "link_description": "🔥Best Seller-Last Day Sale 60% OFF🔥 Buckled Square Heel Sandals for Women",
            "link_url": "https://www.ghemshop.com/products/buckled-square",
            "page_categories": [
              "Musician"
            ],
            "page_entity_type": "PERSON_PROFILE",
            "page_id": "119749581219299",
            "page_is_deleted": false,
            "page_is_profile_page": false,
            "page_like_count": 7,
            "page_name": "Makhumalo",
            "page_profile_picture_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499107970_2293645317822147_4932735414928456888_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DBNo3Z6ft4AQ7kNvwESjMWN&_nc_oc=AdnZGvglABgVlSJ6UIGIbWgFeUL2LnoBSuMbBvti20zRjb_UUDRzhGxAZ0ip3ye1EQI&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfMEXcKVf3KYJpFehTTToe8MXUZslTHE9P-xS2eyVCeGKA&oe=685A4903",
            "page_profile_uri": "https://www.facebook.com/61550737114480/",
            "root_reshared_post": null,
            "title": "🔥Best Seller-Last Day Sale 60% OFF🔥 Buckled Square Heel Sandals for Women",
            "videos": []
          },
          "spend": null,
          "start_date": 1747638000,
          "start_date_string": "2025-05-19T07:00:00.000Z",
          "total_active_time": null,
          "url": "https://www.facebook.com/ads/library?id=1378176106734781"
        }
      ],
      "searchResultsCount": 50001,
      "success": true
    }

Common questions

Which inputs identify this request?

Provide query in body (string). Keep identifiers and URLs in the formats documented for this implementation.

Which pagination or result-size inputs are exposed?

country is string; start_date is string; cursor is string. Use only the exposed inputs and the continuation metadata returned by this endpoint; a size limit is not automatically a page or cursor.

Which values can I use for sort_by?

The selected schema accepts total_impressions, relevancy_monthly_grouped. Keep the documented string type and exact spelling for this input.

Which request format should I follow?

Use POST on the documented OpenAny route with the selected implementation request content type. Do not change the method or move inputs to a different location.

Which API key should I use?

Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

Where can I check the current request price?

Check the pricing area for the selected API implementation. Follow its billing unit, quantity and any request-dependent rules before sending the request.

Use Facebook ad library search API with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.