Facebook Scraper

Search Facebook Ad Library (post)

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.

1 creditNo API key needed

Endpoint

Parameters

NameTypeRequiredNote
querystring · requiredstringrequired

Keyword to search for

trimboolean · optionalbooleanoptional

Set to true for a trimmed down version of the response

limitnumber · optionalnumberoptional

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 · optionalstringoptional

Cursor to paginate through results

statusstring · optionalstringoptional

Status of the ad. Defaults to ACTIVE.

One of: ALL, ACTIVE, INACTIVE

ad_typestring · optionalstringoptional

Search for all ads or only political and issue ads

One of: all, political_and_issue_ads

countrystring · optionalstringoptional

This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.

sort_bystring · optionalstringoptional

Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.

One of: total_impressions, relevancy_monthly_grouped

end_datestring · optionalstringoptional

Impressions end date. Needs to be in YYYY-MM-DD format.

languagestring · optionalstringoptional

Language to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.

media_typestring · optionalstringoptional

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: ALL, IMAGE, VIDEO, MEME, IMAGE_AND_MEME, NONE

start_datestring · optionalstringoptional

Impressions start date. Needs to be in YYYY-MM-DD format.

search_typestring · optionalstringoptional

If you want to search by exact phrase or not

One of: keyword_unordered, keyword_exact_phrase

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
}

Get started

How to use this tool

  1. Connect your AI

    Add Connie to ChatGPT, Claude or Slack once, and this tool comes with it. There’s no API key or account to set up.

  2. Ask for the outcome

    Describe what you need in plain words. Your AI runs this tool when the job calls for it, along with any others it needs.

  3. Make it a workflow

    Add it as a step in a workflow that runs the same way every time, on a schedule or when something happens.

  4. Stay in control

    Choose whether it runs on its own or asks first. When it asks, you see an Allow or Deny card before any credits are spent.