APIDataScrapers

Facebook ad library search

Search for ad library with the Facebook API. Supply a search query. Sample fields include captions and images. Use it in developer research or a documentation workflow. Choose an implementation and check its published request fields, examples, and usage pricing before integrating.

Selected price
$0.00188 / callPublished pricing
Sellers / APIs
1 / 2
Requests · 30d
—Loading...
Success rate · 30d
—Loading...
USE THIS API

Facebook ad library search

Prepare your request, then continue with your agent.

Selected price

$0.00188 / call

Provider
API
Pricing
Connect your agent
On this page

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

"credits_charged": 1
"credits_remaining": 1000000
"cursor": "AQHRLKHyzb3ZNTn1O3qr6lG7ncS9gfboI0HWGSDETVUnipTSXVY8E4Wb-568JBicOvYS"
searchResults [1]
[0] {}
"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 {}
textString · text preview
searchResults[0].snapshot.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.👍👍👍
❤️These orthopedic shoes provide great comfort and ease foot and knee pain! 😍
✅ Ideal for wide feet 
✅ comfortable 
✅ they are ideal for everyday life.
Get 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

Response result

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

Sellers

SellerPricingRequests · 30dPerformanceAccess
Facebook Ad Library — Search · POST · View API reference
$0.00188 / call—Select to load statistics
—successP50—
Current
Facebook Ad Library — Search · GET · View API reference
$0.00188 / call—
—successP50—
Loading...
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: 3. Price update time: not supplied.

calls

Total $0.188

API

Method
GET
Endpoint
https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
  'https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads?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' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'

Input parameters

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

ParameterLocationTypeRequiredDescription
queryURL query parametersquerystringYesKeyword to search for
sort_byURL query parametersquerystringNoSort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.

enum: "total_impressions", "relevancy_monthly_grouped"

search_typeURL query parametersquerystringNoIf you want to search by exact phrase or not

enum: "keyword_unordered", "keyword_exact_phrase"

ad_typeURL query parametersquerystringNoSearch for all ads or only political and issue ads

enum: "all", "political_and_issue_ads"

countryURL query parametersquerystringNoThis can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
languageURL query parametersquerystringNoLanguage to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.
statusURL query parametersquerystringNoStatus of the ad. Defaults to ACTIVE.

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

media_typeURL query parametersquerystringNoMedia 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_dateURL query parametersquerystringNoImpressions start date. Needs to be in YYYY-MM-DD format.
end_dateURL query parametersquerystringNoImpressions end date. Needs to be in YYYY-MM-DD format.
cursorURL query parametersquerystringNoCursor to paginate through results
trimURL query parametersquerybooleanNoSet 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.

Sample response

Sample response · Documented HTTP 200 Example from the provider's documentation. Field values in your results will differ.

Official example
{
  "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
}

Agent integration

Copy the resource contract without sharing an API key.

View API Markdown
API Markdown
# Facebook ad library search

Search for ad library with the Facebook API. Supply a search query. Sample fields include captions and images. Use it in developer research or a documentation workflow. Choose an implementation and check its published request fields, examples, and usage pricing before integrating.
## Available implementations
scrapecreators · Facebook Ad Library — Search: https://openany.si/markets/apis/capabilities/facebook-ad-library-search?offering=4b03c3ee-347f-4608-b9cd-607e061a282b · $0.00188 / call
scrapecreators · Facebook Ad Library — Search: https://openany.si/markets/apis/capabilities/facebook-ad-library-search?offering=52ed6918-8929-46c3-a507-f0982c7e6a04 · $0.00188 / call

## Selected API contract
Documentation: https://openany.si/markets/apis/capabilities/facebook-ad-library-search
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads
Price: $0.00188 / call
Provider: scrapecreators
Contract revision: 3
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.

Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.

## Prepared request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads?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' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## API contract
```json
{
  "resource_type": "api",
  "name": "Facebook Ad Library — Search",
  "endpoint": "https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads",
  "method": "GET",
  "content_type": "none",
  "execution_mode": "sync",
  "authentication": {
    "type": "bearer",
    "environment_variable": "OPENANY_API_KEY"
  },
  "inputs": [
    {
      "description": "Keyword to search for",
      "location": "query",
      "name": "query",
      "nullable": false,
      "required": true,
      "type": "string"
    },
    {
      "description": "Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.",
      "enum_values": [
        "total_impressions",
        "relevancy_monthly_grouped"
      ],
      "location": "query",
      "name": "sort_by",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "If you want to search by exact phrase or not",
      "enum_values": [
        "keyword_unordered",
        "keyword_exact_phrase"
      ],
      "location": "query",
      "name": "search_type",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Search for all ads or only political and issue ads",
      "enum_values": [
        "all",
        "political_and_issue_ads"
      ],
      "location": "query",
      "name": "ad_type",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.",
      "location": "query",
      "name": "country",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.",
      "location": "query",
      "name": "language",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Status of the ad. Defaults to ACTIVE.",
      "enum_values": [
        "ALL",
        "ACTIVE",
        "INACTIVE"
      ],
      "location": "query",
      "name": "status",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "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_values": [
        "ALL",
        "IMAGE",
        "VIDEO",
        "MEME",
        "IMAGE_AND_MEME",
        "NONE"
      ],
      "location": "query",
      "name": "media_type",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Impressions start date. Needs to be in YYYY-MM-DD format.",
      "location": "query",
      "name": "start_date",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Impressions end date. Needs to be in YYYY-MM-DD format.",
      "location": "query",
      "name": "end_date",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Cursor to paginate through results",
      "location": "query",
      "name": "cursor",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Set to true for a trimmed down version of the response",
      "location": "query",
      "name": "trim",
      "nullable": false,
      "required": false,
      "type": "boolean"
    }
  ],
  "billing": {
    "currency": "USD",
    "mode": "fixed",
    "priceMicroUsd": "1880",
    "rounding": null,
    "unit": "call",
    "unitQuantity": null
  },
  "examples": [
    {
      "http_status": 200,
      "name": "Official example",
      "request": {
        "body": null,
        "headers": {},
        "path": {},
        "query": {
          "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"
        }
      },
      "response_body": {
        "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
      }
    }
  ]
}
```

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?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' \
      -X GET \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json'
  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

Do I need a separate key for every provider?

Use your OpenAny API key for standard API access. Read it from OPENANY_API_KEY in your environment and keep it out of prompts, source code and logs.

Are these providers interchangeable?

No. Each offering has its own inputs, pricing and response contract. Selecting a catalog offering does not establish automatic routing or fallback. Confirm the service contract before calling.

How is this API billed?

API-key calls use your shared balance at the selected implementation's published rate. Check the billing unit and request-specific pricing rules before making a paid call. Recorded usage determines the final charge under that contract.

Where do the price and contract come from?

The selected implementation publishes its provider, request contract, revision and billing rules through OpenAny's public API catalog. A revision number identifies a contract version, not a price update date. A price update timestamp is not supplied; do not treat a page date as one.

How do OpenAny Balance and x402 differ?

OpenAny Balance uses an API key and one shared balance. Card, USDC and x402 top-ups, card auto top-up and USDC subscriptions fund that balance; available routes appear on the Credits page. Direct x402 is a separate pay-per-request flow, available only on listings that show it and requiring an authorized payment client.

Does Playground send a paid request?

Yes. After you sign in, Run sends a real API request using an active OpenAny API key. Charges follow the published API contract and use your shared balance. Selecting an implementation, editing inputs and viewing sample responses do not send requests.

Use Facebook ad library search with your agent

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