# Facebook Ads Library Scraper: Any Brand, No Page Ids (`hydrafetch/facebook-ads-library-scraper`) Actor

Get the Facebook and Instagram ads any brand runs from its name, domain or an Ad Library link: copy, creatives, carousel cards, platforms and dates.

- **URL**: https://apify.com/hydrafetch/facebook-ads-library-scraper.md
- **Developed by:** [Hydrafetch](https://apify.com/hydrafetch) (community)
- **Categories:** Marketing, Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

<div align="center">

<img src="https://hydrafetch.com/brand/mark-512.png" alt="Hydrafetch" height="64" />

## Facebook Ads Library Scraper: Any Brand, No Page Ids

**Get the Facebook and Instagram ads any brand runs from its name, domain or an Ad Library link: copy, creatives, carousel cards, platforms and dates.**

`Pay per result` · `$1 per 1,000 ads` · `No API key` · Powered by [Hydrafetch](https://hydrafetch.com?utm_source=apify\&utm_medium=readme\&utm_content=facebook-ads-library-scraper)

</div>

***

### Facebook Ads Library Scraper at a glance

- **Input:** Company names like Nike, domains like nike.com, Facebook page links or ids, or links copied from the Meta Ad Library, plus how many ads to return for each, a country and whether to include stopped ads.
- **Output:** one row per ad with 19 fields, including pageName, format, body, cta.
- **Price:** $1 per 1,000 ads, charged only for results.
- **You need:** nothing else. No cookies, no logins, no proxies and no API keys.
- **Export:** JSON, CSV, Excel or XML, or straight into your own tools with the Apify API and MCP.

### What is Facebook Ads Library Scraper?

Returns ads from Meta's public Ad Library for Facebook, Instagram, Messenger and Threads. Give it a company name, a domain, a Facebook page, or any Ad Library link, including keyword searches, and it finds the right page for you. Each ad comes with its copy, headline, button, landing page, images, videos, every carousel card, the platforms it runs on and its start date, plus the end date for ads that have stopped. Filter by country and by active or all ads. Lines with no ads are skipped and not charged. Built for competitor research, creative inspiration and ad monitoring.

- **A company's ads from its name or domain.** No page ids to look up: give it nike.com or Nike and it finds the right Facebook page.
- **Or any Ad Library search.** Paste a keyword search or page link from the Meta Ad Library and get every ad it shows.
- **The whole creative.** Copy, headline, button, landing page, images, videos and every carousel card.
- **Where and when.** Platforms, start dates, and end dates for ads that have stopped.

### What data can I extract with Facebook Ads Library Scraper?

Every result is one row per ad, with these fields:

| Field | What it holds |
| --- | --- |
| `query` | The company or search you gave |
| `pageId` | The advertiser's Facebook page id, when the line was a company |
| `pageName` | The Facebook page that ran the ad |
| `adArchiveId` | The ad's id in the Meta Ad Library |
| `adUrl` | Link to the ad in the Meta Ad Library |
| `isActive` | Whether the ad is running now |
| `startDate` | The day the ad started running |
| `endDate` | The day it stopped, for ads that have stopped |
| `platforms` | Where it runs: facebook, instagram, messenger, audience\_network, threads |
| `format` | image, video, carousel, dco or dpa |
| `title` | The headline |
| `body` | The ad copy |
| `caption` | The display link under the creative |
| `cta` | The button text, such as Shop now |
| `linkUrl` | Where the ad sends people |
| `images` | Links to the ad images |
| `videos` | Links to the ad videos, in HD and SD, with a preview image |
| `cards` | Each card of a carousel or catalog ad, with its own title, link and image |
| `versions` | How many versions of this ad the library groups together |

The table view in Apify shows Advertiser, Format, Copy, Button, Started, Active, Ad. The full record is in the JSON, CSV, Excel and XML exports, and over the API.

### How to use Facebook Ads Library Scraper

1. Open Facebook Ads Library Scraper in the Apify Console. A free Apify account is enough to try it.
2. Paste your companies or searches, one per line, or upload a list.
3. Click **Start**. Each company or search is processed on its own, so one bad entry never loses the batch.
4. Download the results as JSON, CSV or Excel, or send them to your own tools with an integration.

### Input

One field: **companies or searches**. Company names like Nike, domains like nike.com, Facebook page links or ids, or links copied from the Meta Ad Library.

A second field, **maxAdsPerCompany**, caps how many ads are returned for each line (default 10, at most 1,000).

**country** keeps only ads shown in one country, as a two-letter code like `US` (default `ALL`).

**activeOnly** returns only ads running now (default on). Turn it off to include ads that have stopped, with their end dates.

Every line is checked before the run starts. Each must be a company name, a domain, a Facebook page or a Meta Ad Library link; a run with any other line is refused with that line named, so a typo never costs you anything.

```json
{
  "companies": [
    "nike.com"
  ],
  "maxAdsPerCompany": 10,
  "country": "ALL",
  "activeOnly": true
}
```

### Output

A company with no ads in the library, or one we cannot match to a Facebook page, is skipped and costs nothing. The run log names every one that was skipped, so a short result is never a mystery.

```json
{
  "query": "nike.com",
  "pageId": "15087023444",
  "pageName": "Nike",
  "adArchiveId": "1702938977100376",
  "adUrl": "https://www.facebook.com/ads/library/?id=1702938977100376",
  "isActive": true,
  "startDate": "2025-04-07",
  "endDate": null,
  "platforms": [
    "facebook",
    "instagram",
    "audience_network",
    "messenger"
  ],
  "format": "dpa",
  "body": "Bring sports more fully into your day with the Nike App.",
  "caption": "itunes.apple.com",
  "cta": "Install now",
  "linkUrl": "http://itunes.apple.com/app/id1095459556",
  "cards": [
    {
      "title": "Nike Invincible 3 Women's Road Running Shoes",
      "linkUrl": "https://www.nike.com/t/invincible-3-road-running-shoes-LL61DX/DR2660-001"
    }
  ],
  "versions": 1
}
```

### How much does Facebook Ads Library Scraper cost?

Facebook Ads Library Scraper costs **$1 per 1,000 ads** returned, which is $0.001 each, with no separate compute charge. 10,000 ads cost $10.

- **You pay only for results.** A company with no ads in the library, or one we cannot match to a Facebook page, is skipped and costs nothing.
- **Try it on the free plan.** On Apify's free plan you get 50 ads from this Actor in total, not per month, to try it out. After that a run stops and asks you to move to a paid Apify plan. Paid plans have no limit. On a paid plan, $5 covers about 5,000 ads.
- **Volume discounts.** Scale plans pay 5% less per result and Business plans 10% less.
- **Cap any run.** Set a maximum cost per run in the run options and the Actor stops cleanly when it is reached.

### Common use cases

- **Competitor research.** See every ad a rival runs on Facebook and Instagram, and what each one sells.
- **Creative inspiration.** Collect hooks, formats and offers from a whole market.
- **E-commerce research.** Find the products brands push hardest through catalog and carousel ads.
- **Monitoring.** Schedule a task to catch new ads from the brands you watch.

### Integrate Facebook Ads Library Scraper with other apps

Facebook Ads Library Scraper works with the integrations on the Apify platform, including [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [n8n](https://apify.com/integrations/n8n), [Google Sheets](https://apify.com/integrations/google-sheets), [Slack](https://apify.com/integrations/slack), [Airbyte](https://apify.com/integrations/airbyte), [Google Sheets](https://apify.com/integrations/google-sheets), [Slack](https://apify.com/integrations/slack), [Airtable](https://apify.com/integrations/airtable). Results can also go anywhere with a [webhook](https://docs.apify.com/platform/integrations/webhooks) when a run finishes.

To keep a list current, save your input as a task and put it on a [schedule](https://docs.apify.com/platform/schedules).

### Facebook Ads Library Scraper API

Run Facebook Ads Library Scraper from your own code with the Apify API clients.

**JavaScript**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('hydrafetch/facebook-ads-library-scraper').call({ companies: ["nike.com"] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("hydrafetch/facebook-ads-library-scraper").call(run_input={"companies": ["nike.com"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

AI agents can call it too. Connect Claude, Cursor or any MCP client to the [Apify MCP server](https://mcp.apify.com) and add `hydrafetch/facebook-ads-library-scraper` as a tool.

### FAQ

#### What can I give it?

A company name like Nike, a domain like nike.com, a Facebook page link, a page id, or any link copied from the Meta Ad Library, including keyword searches.

#### Do I get spend and reach?

No. Meta publishes spend and reach only for political and issue ads, and in the EU on each ad's own page. This returns the ads themselves.

#### Does a name match similar pages?

It picks the Facebook page whose name fits yours best and returns that page only. Paste the page link or id to be exact.

#### What if a company runs no ads?

It is skipped and you are not charged.

#### Is there a free trial?

Yes. On Apify's free plan you get 50 ads from this Actor in total to try it, charged to your free Apify credit. After that, runs stop and ask you to move to a paid Apify plan, which has no limit.

#### Do I need cookies, a login or proxies?

No. Facebook Ads Library Scraper works without cookies, accounts, proxies or API keys. Paste your companies or searches and run it; everything else is handled for you.

#### Is it legal to use Facebook Ads Library Scraper?

Facebook Ads Library Scraper collects only publicly available ads from Meta's public Ad Library. As with any data collection, you are responsible for how you use the results: follow the terms of the websites you work with and data protection laws such as GDPR wherever personal data is involved. If you are unsure about your use case, check with a lawyer.

#### Does Facebook Ads Library Scraper have an API?

Yes. Every run is available through the Apify API, with the JavaScript and Python examples above, and through the Apify MCP server for AI agents.

### Other Actors by Hydrafetch

- [Company Enrichment API](https://apify.com/hydrafetch/company-enrichment-api): turn a list of domains into full company records: name, description, logo, brand colors, fonts, socials and industry.
- [Bulk Company Logo Finder](https://apify.com/hydrafetch/bulk-company-logo-finder): give it a list of domains and get a direct image URL for each company logo, with dimensions and dominant color.
- [Website Color Palette Extractor](https://apify.com/hydrafetch/website-color-palette-extractor): read a site's real design system: colors by role with contrast ratios, the type scale, corner radius and button styling.
- [AI SEO & GEO Audit](https://apify.com/hydrafetch/ai-seo-geo-audit): check whether an LLM or AI agent can actually read your pages, and get the specific reasons when it cannot.
- [Website to Markdown](https://apify.com/hydrafetch/website-to-markdown): turn a list of URLs into clean markdown for LLMs, RAG and AI agents, with navigation, banners and boilerplate removed.
- [Article Extractor](https://apify.com/hydrafetch/article-extractor): extract the full text, author, publish date and site details from any article or blog post URL.
- [Company Social Links Finder](https://apify.com/hydrafetch/company-social-links-finder): find the LinkedIn company page and every social profile a company links from its own website, from just the domain.
- [LinkedIn Company Scraper](https://apify.com/hydrafetch/linkedin-company-scraper): get industry, company size, headcount, followers, headquarters and more from LinkedIn company pages, by URL or by domain.
- [Tech Stack Detector](https://apify.com/hydrafetch/website-tech-stack-detector): find the CMS, ecommerce platform, analytics, frameworks, hosting and payment tools any website runs, from just the domain.
- [PDF to Markdown](https://apify.com/hydrafetch/pdf-to-markdown): convert PDF links into clean markdown with headings and tables intact, ready for LLMs, RAG and search.
- [Website Crawler to Markdown](https://apify.com/hydrafetch/website-crawler-to-markdown): crawl a whole website or docs section into clean markdown for LLMs, RAG and AI agents, one row per page.
- [Company Jobs Scraper](https://apify.com/hydrafetch/company-jobs-scraper): get every open job at a company from just its domain: titles, teams, locations, pay and full descriptions, from the hiring platform it uses.
- [YouTube Transcript Scraper](https://apify.com/hydrafetch/youtube-transcript-scraper): get the full transcript of any YouTube video with timestamps, title and channel, ready for AI summaries, RAG and search.
- [Google Ads Library Scraper](https://apify.com/hydrafetch/google-ads-library-scraper): get every Google ad a company runs from just its domain: creatives, formats and first and last shown dates, from the public Ads Transparency Center.
- [LinkedIn Ad Library Scraper](https://apify.com/hydrafetch/linkedin-ad-library-scraper): get every LinkedIn ad a company runs from its domain, name or LinkedIn page, with the full copy, creative, run dates, impressions by country and targeting.
- [Website Contact Details Scraper](https://apify.com/hydrafetch/website-contact-details-scraper): get the emails, phone numbers, social profiles and address a company publishes on its own website, from just its domain.
- [App Store and Google Play Scraper](https://apify.com/hydrafetch/app-store-google-play-scraper): get app details and the newest reviews from the Apple App Store and Google Play in one run: ratings, installs, versions, and review text with developer replies.
- [Trustpilot Reviews Scraper](https://apify.com/hydrafetch/trustpilot-reviews-scraper): get any company's TrustScore, star breakdown and newest Trustpilot reviews from just its domain, with company replies and without reviewer names.
- [Shopify Store Products Scraper](https://apify.com/hydrafetch/shopify-store-products-scraper): get every product from any Shopify store by its domain: titles, prices, variants, SKUs, stock and images, including stores that hide their product feed.
- [LinkedIn Jobs Scraper](https://apify.com/hydrafetch/linkedin-jobs-scraper): search LinkedIn jobs by terms, location and filters and get every posting with its full description, applicants, seniority and listed pay. No login, no cookies.
- [Google Maps Scraper with Emails](https://apify.com/hydrafetch/google-maps-scraper-emails): search Google Maps like you would in the app and get every place with its address, phone, website, rating and reviews, plus emails from its own website when you want them.
- [Amazon Product Scraper](https://apify.com/hydrafetch/amazon-product-scraper): search Amazon.com like you would in the app, or paste product links and ASINs, and get every product with its US price, rating, reviews and sales signals, plus the full product page when you want it.
- [News Scraper with Full Article Text](https://apify.com/hydrafetch/news-scraper-full-text): search the news for any topic and get recent articles with their full text as clean markdown, real publisher links and publish dates.
- [Company Ads Across Google, LinkedIn and Meta](https://apify.com/hydrafetch/company-ads-all-platforms): get the Google, LinkedIn and Facebook and Instagram ads a company runs from just its domain, in one dataset with the same columns for every platform.
- [Company Website Finder](https://apify.com/hydrafetch/company-website-finder): turn a list of company names into their official websites and domains, each checked against the company homepage so directories never slip through.
- [Website Screenshot API](https://apify.com/hydrafetch/website-screenshot-api): capture screenshots of any web pages as hosted PNG links, full page or first screen, rendered in a real browser and priced per screenshot.

### Terms of use

**Your results are yours.** We claim no rights in the inputs you submit or the data you get back. Full terms: [hydrafetch.com/terms](https://hydrafetch.com/terms?utm_source=apify\&utm_medium=readme\&utm_content=facebook-ads-library-scraper)

### Your feedback

Something not working, or a field you need? Open an issue on the Issues tab with the input you used, and we read every one.

***

<div align="center">
Built by <a href="https://hydrafetch.com?utm_source=apify&utm_medium=readme&utm_content=facebook-ads-library-scraper">Hydrafetch</a>. Clean web data for developers and agents.
</div>

# Actor input Schema

## `companies` (type: `array`):

The companies or searches to process, one per line. Company names like Nike, domains like nike.com, Facebook page links or ids, or links copied from the Meta Ad Library.

## `maxAdsPerCompany` (type: `integer`):

How many ads to return for each line, at most 1000. You are charged per ad returned.

## `country` (type: `string`):

Only ads shown in this country, as a two-letter code like US or GB. Leave as ALL for every country. A country inside an Ad Library link you paste wins over this.

## `activeOnly` (type: `boolean`):

On: only ads running now. Off: include ads that have stopped.

## Actor input object example

```json
{
  "companies": [
    "nike.com"
  ],
  "maxAdsPerCompany": 10,
  "country": "ALL",
  "activeOnly": true
}
```

# Actor output Schema

## `results` (type: `string`):

Facebook Ads Library Scraper: Any Brand, No Page Ids records (the run's default dataset).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "companies": [
        "nike.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydrafetch/facebook-ads-library-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "companies": ["nike.com"] }

# Run the Actor and wait for it to finish
run = client.actor("hydrafetch/facebook-ads-library-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "companies": [
    "nike.com"
  ]
}' |
apify call hydrafetch/facebook-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hydrafetch/facebook-ads-library-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lnNBI0nPJ4WdBJxUm/builds/mA4JhJR9osSydJfRG/openapi.json
