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
Facebook ad library search API
Prepare your request, then continue with your agent.
Selected price
$0.00188 / call
- Provider
- API
- Pricing
On this page
Overview
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
- Set OPENANY_API_KEY to your OpenAny API key.
- Review the JSON body and supported fields shown in the request template.
- Check the HTTP response and business result before reading optional fields.
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
Related APIs
Playground
Run sends a real API request. Charges follow the published API contract.
Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
Current Facebook Ad Library — Search · POST · View API reference | $0.00188 / call | 0 | —successP50— | |
| Facebook Ad Library — Search · GET · View API reference | $0.00188 / call | —Select to load statistics | —successP50— |
- 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.
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
Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
query | JSON request bodybody | string | Yes | Keyword to search for |
sort_by | JSON request bodybody | string | No | Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions. enum: "total_impressions", "relevancy_monthly_grouped" |
search_type | JSON request bodybody | string | No | If you want to search by exact phrase or not enum: "keyword_unordered", "keyword_exact_phrase" |
ad_type | JSON request bodybody | string | No | Search for all ads or only political and issue ads enum: "all", "political_and_issue_ads" |
country | JSON request bodybody | string | No | This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL. |
language | JSON request bodybody | string | No | Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR. |
status | JSON request bodybody | string | No | Status of the ad. Defaults to ACTIVE. enum: "ALL", "ACTIVE", "INACTIVE" |
media_type | JSON request bodybody | string | No | 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 | JSON request bodybody | string | No | Impressions start date. Needs to be in YYYY-MM-DD format. |
end_date | JSON request bodybody | string | No | Impressions end date. Needs to be in YYYY-MM-DD format. |
cursor | JSON request bodybody | string | No | Cursor to paginate through results |
trim | JSON request bodybody | boolean | No | 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
credits_chargedintegercredits_remainingintegercursorstringsearchResultsobject[]ad_archive_idstringend_dateintegerend_date_stringstringis_aaa_eligiblebooleanis_activebooleanpage_idstringpage_namestringpolitical_countriesunknown[]publisher_platformstring[]reach_estimatenullsnapshotobjectadditional_infonullbodyobjecttextstring
branded_contentnullbrazil_tax_idnullbylinenullcaptionstringcardsunknown[]country_iso_codenullcta_textstringcta_typestringcurrent_page_namestringdisclaimer_labelnulldisplay_formatstringec_certificatesunknown[]eventnullextra_imagesunknown[]extra_linksunknown[]extra_textsunknown[]extra_videosunknown[]imagesobject[]image_cropsunknown[]original_image_urlstringresized_image_urlstringwatermarked_resized_image_urlstring
is_resharedbooleanlink_descriptionstringlink_urlstringpage_categoriesstring[]page_entity_typestringpage_idstringpage_is_deletedbooleanpage_is_profile_pagebooleanpage_like_countintegerpage_namestringpage_profile_picture_urlstringpage_profile_uristringroot_reshared_postnulltitlestringvideosunknown[]
spendnullstart_dateintegerstart_date_stringstringtotal_active_timenullurlstring
searchResultsCountintegersuccessboolean
Agent integration
Copy the resource contract without sharing an API key.
Error handling
| Status | Next step |
|---|---|
400 | Check the offering and request fields. |
401 / 403 | Verify your credentials and access permissions. |
402 | Inspect the selected access mode and returned payment requirements. |
429 | Respect the returned rate limit and retry guidance. |
5xx | Inspect 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.
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 / Linuxprintf 'OpenAny API key: ' read -r -s OPENANY_API_KEY export OPENANY_API_KEY printf '\n'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 · cURLcurl \ '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 }'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 }