# Facebook Meta Ads Library Search Export

**Use case:** 

Searches the Meta Ad Library for a keyword in a country you choose and returns the live ads as structured data. Each row has the ad ID, headline, ad copy, format, advertiser page name and likes, images, videos, start and end dates, the Meta platforms it runs on and whether it is active. Good for competitor and creative research.

## Input

```json
{
  "queries": [
    "iphone"
  ],
  "countries": [
    "US"
  ],
  "item_limit": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

## Output

```json
{
  "ad_archive_id": {
    "label": "Ad ID",
    "format": "string"
  },
  "page_name": {
    "label": "Advertiser",
    "format": "string"
  },
  "title": {
    "label": "Headline",
    "format": "string"
  },
  "body_text": {
    "label": "Ad text",
    "format": "string"
  },
  "display_format": {
    "label": "Format",
    "format": "string"
  },
  "page_profile_uri": {
    "label": "Page",
    "format": "string"
  },
  "page_like_count": {
    "label": "Page likes",
    "format": "integer"
  },
  "publisher_platform": {
    "label": "Platforms",
    "format": "array"
  },
  "start_date": {
    "label": "Start",
    "format": "integer"
  },
  "is_active": {
    "label": "Active",
    "format": "boolean"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Facebook(Meta) Ad Scraper Actor is ready to run with the inputs already set for "Facebook Meta Ads Library Search Export". [Sign up or log in](https://console.apify.com/create-task-from-example/gh2vBaqnfLC4l2d9p) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Facebook Meta Ads Library Search Export" task

The Facebook(Meta) Ad Scraper Actor will start running based on the input automatically. You can also change all the input fields, like list of facebook ad search queries, list of facebook ad search country codes, and more, to match your specific use case.

### 3. Receive the "Facebook Meta Ads Library Search Export" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as ad id, advertiser, headline, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Facebook Meta Ads Library Search Export" task via API](https://apify.com/getdataforme/facebook-ad-scraper.md).

## FAQ

### What data does this task return?

For every ad it returns the ad ID, headline, ad copy, format, advertiser page name, likes and categories, images, videos, start and end dates, the Meta platforms and whether the ad is active.

### Which fields do I change?

Change queries for the keywords, countries for two-letter country codes such as US or GB, and item_limit for how many ads you want.

### How many ads and how fast?

A run with 10 ads takes a few seconds. Raise item_limit for more; the run stops once that many ads were collected.

### Do I need a Facebook login or a proxy?

No login is needed, it reads the public Ad Library. The residential proxy default should stay on because datacenter IPs are rate limited.

### Which export formats are available?

Download the dataset as JSON, CSV, Excel, XML or HTML, or read it through the Apify API.

## About this Actor

This example demonstrates how to use [Facebook(Meta) Ad Scraper](https://apify.com/getdataforme/facebook-ad-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/getdataforme/facebook-ad-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/getdataforme/facebook-ad-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
