# Scrape Facebook ads by keyword

**Use case:** 

Search the Meta Ad Library for a keyword and export the active ads: advertiser, ad text, images, videos, links, start date and platforms. Change the keyword and country to research any market.

## Input

```json
{
  "urls": [
    "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes&search_type=keyword_unordered&media_type=all"
  ],
  "searchTerms": [
    "running shoes"
  ],
  "pageIds": [
    "15087023444"
  ],
  "country": "US",
  "activeStatus": "active",
  "adType": "all",
  "mediaType": "all",
  "maxAdsPerSearch": 30,
  "includeAdDetails": false,
  "proxy": {
    "useApifyProxy": true
  }
}
```

## Output

```json
{
  "pageProfilePictureUrl": {
    "label": "Page",
    "format": "string"
  },
  "pageName": {
    "label": "Advertiser",
    "format": "string"
  },
  "body": {
    "label": "Text",
    "format": "string"
  },
  "displayFormat": {
    "label": "Format",
    "format": "string"
  },
  "isActive": {
    "label": "Active",
    "format": "boolean"
  },
  "startDate": {
    "label": "Started",
    "format": "string"
  },
  "endDate": {
    "label": "Ended",
    "format": "string"
  },
  "publisherPlatforms": {
    "label": "Platforms",
    "format": "array"
  },
  "collationCount": {
    "label": "Ads with this creative",
    "format": "integer"
  },
  "spend": {
    "label": "Spend",
    "format": "string"
  },
  "adLibraryUrl": {
    "label": "Ad",
    "format": "string"
  },
  "input": {
    "label": "Input",
    "format": "string"
  }
}
```

## How it works

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

The Facebook Ads Library Scraper Lowcost: Meta Ads, $0.30/1K Actor is ready to run with the inputs already set for "Scrape Facebook ads by keyword". [Sign up or log in](https://console.apify.com/create-task-from-example/POfs851vzk6QAdfRn) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Scrape Facebook ads by keyword" task

The Facebook Ads Library Scraper Lowcost: Meta Ads, $0.30/1K Actor will start running based on the input automatically. You can also change all the input fields, like ad library urls, search terms, and more, to match your specific use case.

### 3. Receive the "Scrape Facebook ads by keyword" 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 page, advertiser, text, 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 "Scrape Facebook ads by keyword" task via API](https://apify.com/sones/facebook-ads-library-scraper-lowcost.md).

## FAQ

### Do I need a Facebook account?

No. The task reads the public Meta Ad Library, the same page anyone can open without logging in.

### What does this task cost?

$0.30 per 1,000 ads on the Free plan, plus a small run-start fee. 30 ads cost about one cent. The task stops at a $0.50 spending limit.

### Can I search another country?

Yes. Duplicate the task and pick a country, or ALL for every country the Ad Library covers.

## About this Actor

This example demonstrates how to use [Facebook Ads Library Scraper Lowcost: Meta Ads, $0.30/1K](https://apify.com/sones/facebook-ads-library-scraper-lowcost.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/sones/facebook-ads-library-scraper-lowcost.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/sones/facebook-ads-library-scraper-lowcost.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`).
