# Facebook Ad Library — Search

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.

Documentation: https://openany.si/facebook/facebook-ad-library-search/52ed6918-8929-46c3-a507-f0982c7e6a04/
API ID: 52ed6918-8929-46c3-a507-f0982c7e6a04
Provider: scrapecreators
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/scrapecreators/v1/facebook/adLibrary/search/ads
Page update time: 2026-12-03T02:50:43.747Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.00188 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:50:43.084Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "1880",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Facebook Ad Library — Search API

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

## 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 |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Facebook Ad Library — Search request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "Keyword to search for"
        },
        "sort_by": {
          "type": "string",
          "description": "Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.",
          "enum": [
            "total_impressions",
            "relevancy_monthly_grouped"
          ]
        },
        "search_type": {
          "type": "string",
          "description": "If you want to search by exact phrase or not",
          "enum": [
            "keyword_unordered",
            "keyword_exact_phrase"
          ]
        },
        "ad_type": {
          "type": "string",
          "description": "Search for all ads or only political and issue ads",
          "enum": [
            "all",
            "political_and_issue_ads"
          ]
        },
        "country": {
          "type": "string",
          "description": "This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL."
        },
        "language": {
          "type": "string",
          "description": "Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR."
        },
        "status": {
          "type": "string",
          "description": "Status of the ad. Defaults to ACTIVE.",
          "enum": [
            "ALL",
            "ACTIVE",
            "INACTIVE"
          ]
        },
        "media_type": {
          "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": [
            "ALL",
            "IMAGE",
            "VIDEO",
            "MEME",
            "IMAGE_AND_MEME",
            "NONE"
          ]
        },
        "start_date": {
          "type": "string",
          "description": "Impressions start date. Needs to be in YYYY-MM-DD format."
        },
        "end_date": {
          "type": "string",
          "description": "Impressions end date. Needs to be in YYYY-MM-DD format."
        },
        "cursor": {
          "type": "string",
          "description": "Cursor to paginate through results"
        },
        "trim": {
          "type": "boolean",
          "description": "Set to true for a trimmed down version of the response"
        }
      },
      "required": [
        "query"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "credits_charged": {
      "type": "integer"
    },
    "credits_remaining": {
      "type": "integer"
    },
    "cursor": {
      "type": "string"
    },
    "searchResults": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ad_archive_id": {
            "type": "string"
          },
          "end_date": {
            "type": "integer"
          },
          "end_date_string": {
            "type": "string"
          },
          "is_aaa_eligible": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "page_id": {
            "type": "string"
          },
          "page_name": {
            "type": "string"
          },
          "political_countries": {
            "type": "array",
            "items": {}
          },
          "publisher_platform": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reach_estimate": {
            "type": "null"
          },
          "snapshot": {
            "type": "object",
            "properties": {
              "additional_info": {
                "type": "null"
              },
              "body": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                }
              },
              "branded_content": {
                "type": "null"
              },
              "brazil_tax_id": {
                "type": "null"
              },
              "byline": {
                "type": "null"
              },
              "caption": {
                "type": "string"
              },
              "cards": {
                "type": "array",
                "items": {}
              },
              "country_iso_code": {
                "type": "null"
              },
              "cta_text": {
                "type": "string"
              },
              "cta_type": {
                "type": "string"
              },
              "current_page_name": {
                "type": "string"
              },
              "disclaimer_label": {
                "type": "null"
              },
              "display_format": {
                "type": "string"
              },
              "ec_certificates": {
                "type": "array",
                "items": {}
              },
              "event": {
                "type": "null"
              },
              "extra_images": {
                "type": "array",
                "items": {}
              },
              "extra_links": {
                "type": "array",
                "items": {}
              },
              "extra_texts": {
                "type": "array",
                "items": {}
              },
              "extra_videos": {
                "type": "array",
                "items": {}
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "image_crops": {
                      "type": "array",
                      "items": {}
                    },
                    "original_image_url": {
                      "type": "string"
                    },
                    "resized_image_url": {
                      "type": "string"
                    },
                    "watermarked_resized_image_url": {
                      "type": "string"
                    }
                  }
                }
              },
              "is_reshared": {
                "type": "boolean"
              },
              "link_description": {
                "type": "string"
              },
              "link_url": {
                "type": "string"
              },
              "page_categories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "page_entity_type": {
                "type": "string"
              },
              "page_id": {
                "type": "string"
              },
              "page_is_deleted": {
                "type": "boolean"
              },
              "page_is_profile_page": {
                "type": "boolean"
              },
              "page_like_count": {
                "type": "integer"
              },
              "page_name": {
                "type": "string"
              },
              "page_profile_picture_url": {
                "type": "string"
              },
              "page_profile_uri": {
                "type": "string"
              },
              "root_reshared_post": {
                "type": "null"
              },
              "title": {
                "type": "string"
              },
              "videos": {
                "type": "array",
                "items": {}
              }
            }
          },
          "spend": {
            "type": "null"
          },
          "start_date": {
            "type": "integer"
          },
          "start_date_string": {
            "type": "string"
          },
          "total_active_time": {
            "type": "null"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "searchResultsCount": {
      "type": "integer"
    },
    "success": {
      "type": "boolean"
    }
  }
}
```

## Request example
Scenario: Official example
```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'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "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
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Which inputs identify this request?
Provide query in query (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.

### Where do URL parameters belong?
Use the documented path and query inputs. This GET implementation does not use a JSON request body; keep path values and URL query values in their declared locations.

### 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.

## Available implementations
- scrapecreators: https://openany.si/facebook/facebook-ad-library-search/4b03c3ee-347f-4608-b9cd-607e061a282b/
- scrapecreators: https://openany.si/facebook/facebook-ad-library-search/52ed6918-8929-46c3-a507-f0982c7e6a04/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
