Facebook Scraper
Search Facebook Ad Library (post)
Search the Meta Ad Library by keyword for ads, with page name, status, platforms, text, images and videos.
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
}