Nexscope

Facebook Ad Library Search

Search Meta Ad Library ads by keyword with optional language filtering. Review returned ad IDs, page names, active status and creative snapshots.

CostAt least 10 credits / call
Try online
POST · https://api.nexscope.ai/social/facebook/adLibrary/search/adsMCP · social_facebook_ad_library_search_ads

What this API does

Search Meta Ad Library ads by keyword with optional language filtering. Review returned ad IDs, page names, active status and creative snapshots. The request accepts query, sort_by, search_type, ad_type, country. Its documented result includes platform, resourceStatus.

Facebook Ad Library Search API use cases

Plan a Facebook Ad Library Search request

A researcher checks the published operation description and supplies query, sort_by, search_type, ad_type, country for Facebook Ad Library Search. The request stays within the supported parameters rather than assuming other platform capabilities.

Inspect Facebook Ad Library Search results

An analyst reviews platform, resourceStatus from Facebook Ad Library Search for the requested subject. Missing values remain explicit, and the response does not establish complete platform coverage.

Document Facebook Ad Library Search observations

A researcher records the inputs and available results from Facebook Ad Library Search alongside its published description. The record supports a scoped review without inferring unsupported actions, refresh intervals or broader conclusions.

Facebook Ad Library Search API FAQ

What does the Facebook Ad Library Search API return?

Search Meta Ad Library ads by keyword with optional language filtering. Review returned ad IDs, page names, active status and creative snapshots. The documented output includes platform, resourceStatus. It corresponds to the supplied query, sort_by, search_type, ad_type, country. Optional fields can be absent; a missing value should not be interpreted as a measured zero. Example values illustrate the response shape, rather than live account results.

How many credits does the Facebook Ad Library Search API cost?

The current documented cost is At least 10 credits / call. This is the same cost shown at the top of this page. If a range or estimate is displayed, the final charge depends on the request. Review your available credits and the pricing page before calling the API, and check API usage records for the actual charge.

How do I call the Facebook Ad Library Search API from my app or an MCP client?

Send a POST request to https://api.nexscope.ai/social/facebook/adLibrary/search/ads with your API key as a Bearer token and the JSON inputs shown in API integration. In a compatible MCP client such as Claude or Cursor, connect Nexscope and call social_facebook_ad_library_search_ads. Use the MCP arguments shown in the MCP guide, or switch Online test to MCP to review its request before adding it to your app.

View plans and creditsConnect this API with MCP

Try this API
Endpoint
https://api.nexscope.ai/social/facebook/adLibrary/search/ads
MCP method
social_facebook_ad_library_search_ads

Step 1 of 3 · Authenticate

Authentication

All run endpoints require a user API key. Send it as a bearer token in the Authorization header.

Authorization: Bearer nk-xxxxxxxxxxxxxxxxx
Missing or invalid API keys return an authentication error. Manage keys from .

Step 2 of 3 · Send a request

POSThttps://api.nexscope.ai/social/facebook/adLibrary/search/ads

Run an API

Send a JSON request body using the parameters described below.

Example request

Replace YOUR_API_KEY, then run this command in your terminal.

curl -X POST 'https://api.nexscope.ai/social/facebook/adLibrary/search/ads' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "running"
}'

Code example

{
  "query": "running"
}

Step 3 of 3 · Inspect the result

Check the response

Read code for the request status and data for the result. Open the parameter and response reference for the full field definitions.

HTTP status codes

CodeDescription
200Default HTTP response for both success and many business errors. Only outer JSON code 0 indicates success or asynchronous acceptance; inspect data for the result.
429Execution admission rate limit; honor Retry-After when present.
503Execution admission is temporarily unavailable; honor Retry-After when present.
Opt-inX-Nexscope-Http-Status: semantic maps controller-handled business errors to HTTP status on run and task routes. Pre-authentication failures, such as a missing API key (code 11209), may still return HTTP 200 before this mapping. Always check the outer JSON code; malformed requests and infrastructure failures may also return non-200 HTTP responses.
All categories/ Social Data
POSThttps://api.nexscope.ai/social/facebook/adLibrary/search/ads

Run this API

Send a JSON request to execute this API and receive the documented response payload.

Endpoint

MethodPOST
Pathhttps://api.nexscope.ai/social/facebook/adLibrary/search/ads
AuthBearer API key
Content-Typeapplication/json

Request parameters

NameTypeRequiredDescription
querystringrequired
Keyword to search for
Example: running
sort_bystringoptional
Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
search_typestringoptional
If you want to search by exact phrase or not
ad_typestringoptional
Search for all ads or only political and issue ads
countrystringoptional
This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
languagestringoptional
Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.
statusstringoptional
Status of the ad. Defaults to ACTIVE.
media_typestringoptional
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_datestringoptional
Impressions start date. Needs to be in YYYY-MM-DD format.
end_datestringoptional
Impressions end date. Needs to be in YYYY-MM-DD format.
trimbooleanoptional
Set to true for a trimmed down version of the response
cursorstringoptional
Cursor to paginate through results

Social data contract

Use your Nexscope API key. No supplier credentials are required. Requests reject unknown fields, including pageSize. URLs require HTTPS and an exact supported platform host and resource path. Documented YouTube video URLs may use youtu.be; other short links are unsupported. Check the request schema for supported fields and defaults.

Each request fetches one page. Continue manually with the returned nextCursor, or nextPage for Instagram Reels (pages 1–11). Cursors are opaque, unchanged strings up to 65536 UTF-8 bytes. No automatic pagination, retry, media download or transcription is performed. Repeated requests may purchase data again.

Resource status is independent of HTTP and billing: AVAILABLE, PARTIAL, PRIVATE, RESTRICTED, NOT_FOUND, NO_TRANSCRIPT or UNKNOWN can accompany code 0. Unknown values remain null; arrays remain empty arrays. fetchedAt is the response observation time; sourceFetchedAt is null without source evidence.

usage.billingStatus is NOT_CHARGED, SETTLED or UNKNOWN; chargedCredits is null when unconfirmed. Unknown charges never mean free. Completed lookups have a minimum charge of 10 credits, including cached, no-caption and unavailable-resource results; check API usage records for the actual charge. Parameter errors and unpublished APIs use the standard error envelope; upstream failures use code 13007, rate limits 429 and timeouts 408. Always check code and msg.

Response example

Platform response envelope. code 0 indicates success or acceptance; data contains the business result.

{
  "code": 0,
  "cost": "-1",
  "data": {
    "data": {
      "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
    },
    "platform": "facebook-ad-library",
    "resourceStatus": "AVAILABLE",
    "usage": {
      "billingStatus": "UNKNOWN"
    }
  },
  "msg": null,
  "time": "2026-01-01 00:00:00",
  "traceId": null,
  "ts": "0"
}

Response fields

NameTypeRequiredDescription
codeintegerrequired
0 means accepted or successful; nonzero is a platform error.
coststringrequired
Elapsed milliseconds, never credits; -1 outside web requests.
dataanyrequired
Data value used by this API operation.
msgstring | nullrequired
Msg value used by this API operation.
timestringrequired
Server local time: yyyy-MM-dd HH:mm:ss.
traceIdstring | nullrequired
Trace id value used by this API operation.
tsstringrequired
Epoch milliseconds.

Any of option 1 — requires platform, resourceStatus, data, usage

NameTypeRequiredDescription
dataobjectrequired
Data value used by this API operation.
data.dataobjectrequired
Data value used by this API operation.
data.platformstringrequired
Platform value used by this API operation.
data.resourceStatusstringrequired
Resource status value used by this API operation.
data.usageobjectrequired
Usage value used by this API operation.

Any of option 2

NameTypeRequiredDescription
datanullrequired
Data value used by this API operation.

Responses

CodeDescription
200Default HTTP response for both success and many business errors. Only outer JSON code 0 indicates success or asynchronous acceptance; inspect data for the result.
429Execution admission rate limit; honor Retry-After when present.
503Execution admission is temporarily unavailable; honor Retry-After when present.
Opt-inX-Nexscope-Http-Status: semantic maps controller-handled business errors to HTTP status on run and task routes. Pre-authentication failures, such as a missing API key (code 11209), may still return HTTP 200 before this mapping. Always check the outer JSON code; malformed requests and infrastructure failures may also return non-200 HTTP responses.

Data source, freshness, and limitations

Source, freshness, coverage, rate limits, and estimation notes are not specified in this API definition unless they appear in the request or response field documentation above. Do not assume official marketplace data or real-time freshness when it is not explicitly documented.

Step 1 of 2 · Connect your MCP client

MCP

V2 recommended

Connect remote agents through the standard MCP 2025-11-25 Streamable HTTP endpoint. Use OAuth 2.1 Authorization Code with PKCE, or an API key for compatibility.

POST https://api.nexscope.ai/mcp
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
Authentication

OAuth clients request the mcp:tools scope. The endpoint's 401 response advertises protected-resource metadata for authorization discovery.

Step 2 of 2 · Call the tool

Call a tool

{
  "jsonrpc": "2.0",
  "id": "tool-call-1",
  "method": "tools/call",
  "params": {
    "name": "social_facebook_ad_library_search_ads",
    "arguments": {
      "query": "running"
    }
  }
}

Legacy MCP v1

Existing API-key clients can continue using the compatibility endpoint. New integrations should use MCP v2.

GET / POST /mcp/legacy

What can you do with this API?

Data explained and practical use cases

AI Guide

Question

What data can Facebook Ad Library Search provide, and how might I use it?

AI answer

Searches the Meta Ad Library by keyword and returns matching ads. Supports filtering by language with a 2-letter code such as EN or ES. Each result includes ad_archive_id, page_name, is_active, publisher_platform, and a snapshot with body text, images, videos, and cta_text. Both GET and POST are supported. Use GET for normal requests. If the cursor becomes too large after extensive pagination, use POST and send the same parameters in the JSON body.

Data categoryDocumented fieldsHow to use them
Requestquery, cursor, start_date, end_date, sort_byProvide the required identifiers, filters, or paging inputs listed in the API document.
Responsedata.data, data.platform, data.resourceStatusInspect returned values and source references; availability depends on the request and upstream source.
  • Review Facebook Ad Library Search.
    • Prompt example: “Retrieve Facebook Ad Library Search for [search phrase]. Summarize only the information actually returned and preserve source links when available. Report private, restricted, missing or partial results explicitly; missing values are not zero.”
  • Collect a Bounded Set of Results.
    • Prompt example: “Retrieve Facebook Ad Library Search for [search phrase] across at most two pages within my approved credit budget. Use only the continuation information actually returned, with the same query and filters. Stop at the documented page limit, an absent continuation, an end indicator or a repeated page. Keep source references and report that the collection is bounded, not exhaustive.”
  • Focus the Review on a Selected Period.
    • Prompt example: “Retrieve Facebook Ad Library Search for [search phrase] for [a period supported by this tool]. Use the documented date meaning, format and limits, and show that scope with the results. Keep required date pairs together. Do not treat a search-index window as an exact publication-time filter or infer a complete historical archive.”
  • Prioritize Results for Review.
    • Prompt example: “Retrieve Facebook Ad Library Search for [search phrase] using [my preferred documented sort order]. Preserve the source order and identify pinned or promoted items if the response labels them. Do not infer a platform-wide ranking from this returned sample.”

These are suggested workflows, not completed lookups. Report missing, restricted, or partial data explicitly; verify the live response before making a decision.

Online test

Execute the current API with your API key and JSON payload. Online tests use this site's configured API environment; the Endpoint and copyable examples use the public integration address.

One request fetches one page. Copy nextCursor into cursor, or nextPage into page (1–11 for Reels), then run manually. Repeated requests may purchase data again. Completed lookups have a minimum charge of 10 credits, including cached, no-caption, private, restricted and not-found results. Resource status and actual billing status are independent; null credits are unknown, never free. Check usage.billingStatus, usage.chargedCredits and API usage records for the actual charge.

Try it

Send a real request with the same contract shown in the reference.

Endpoint
/social/facebook/adLibrary/search/ads
MCP method
social_facebook_ad_library_search_ads
cURL
curl -X POST \
  https://api.nexscope.ai/social/facebook/adLibrary/search/ads \
  -H "Authorization: Bearer nk-..." \
  -H "Content-Type: application/json" \
  -d '{ "query": "running" }'
Request estimate: Estimating…Usage based. The final charge depends on actual usage. Estimating does not run the API or charge credits.API usage records
Response
No response yet. Run the request to see the response here.

Related APIs