Facebook Scraper
Search Facebook Ad Library
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.
Endpoint
Parameters
| Name | Type | Required | Note |
|---|---|---|---|
| querystring · required | string | required | Keyword to search for |
| trimboolean · optional | boolean | optional | Set to true for a trimmed down version of the response |
| limitnumber · optional | number | optional | Maximum number of results to return from this request. Leave empty for everything this request returns. This trims the response — it does not fetch more; use the returned cursor for the next batch. The price is the same either way. |
| cursorstring · optional | string | optional | Cursor to paginate through results |
| statusstring · optional | string | optional | Status of the ad. Defaults to ACTIVE. One of: |
| ad_typestring · optional | string | optional | Search for all ads or only political and issue ads One of: |
| countrystring · optional | string | optional | This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL. |
| sort_bystring · optional | string | optional | Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions. One of: |
| end_datestring · optional | string | optional | Impressions end date. Needs to be in YYYY-MM-DD format. |
| languagestring · optional | string | optional | Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR. |
| media_typestring · optional | string | optional | 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. One of: |
| start_datestring · optional | string | optional | Impressions start date. Needs to be in YYYY-MM-DD format. |
| search_typestring · optional | string | optional | If you want to search by exact phrase or not One of: |
Response schema
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"cursor": {
"type": "string"
},
"limitApplied": {
"type": "boolean",
"description": "True when a Limit trimmed the results; there were more in this response."
},
"searchResults": {
"type": "array"
},
"searchResultsCount": {
"type": "number"
}
},
"additionalProperties": true
}