# Facebook Ads Library Scraper 🎯📈 - Fast & cheap 💬⭐ (`scrapestorm/facebook-ads-library-scraper---fast-cheap`) Actor

🚀 Extract Facebook (Meta) Ads Data 📊 from one or multiple Pages! Gather page details, reach estimates, impressions, ad IDs, and more 📅. Download in JSON, CSV, or Excel formats 🔽 for seamless integration into apps, spreadsheets, and reports. Perfect for analysis and insights 📈💻.

- **URL**: https://apify.com/scrapestorm/facebook-ads-library-scraper---fast-cheap.md
- **Developed by:** [Storm_Scraper](https://apify.com/scrapestorm) (community)
- **Categories:** Social media, E-commerce
- **Security:** Limited permissions
- **Stats:** 935 total users, 0 monthly users, 100.0% runs succeeded, 69 bookmarks
- **User rating**: 4.31 out of 5 stars

## Pricing

from $0.00005 / actor start

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Advanced Facebook Ads Library Scraper 🎯📈

The Facebook Ads Library Scraper is a powerful tool 💪 for extracting detailed ad data from the Facebook Ad Library 📚.

Just provide parameters like Keyword 🔑, Country 🌍, Ad Type 🎯, and more, and the scraper will fetch comprehensive information about the ads, including:

```
 All ads that match the selected parameters, with the option to limit the maximum number of items 📝.
 Detailed ad information such as:
    Ad Archive ID 🔢
    Page Name 👤
    Page ID 🆔
    Page Like Count 👍
    Ad Text ✍️
    Call-to-Action (CTA) Text 💬
    Media Types (Images/Videos) 🎥📸
    Impressions Data 📊
    Start and End Dates 📅
    And more 🔍.
```

### Description 💯

This scraper 💪 excels in retrieving detailed ad data from Facebook's Ad Library, with the ability to filter ads by various criteria.
It can scrape ads across different countries, ad types, media types, and platforms.
Even if authentication is required 🔒 to access the content!

### Key Features ✨

```
💪 Customizable Search Parameters: Filter ads based on multiple parameters such as country, ad status, ad type, media type, publisher platforms, and more.
🔍 Comprehensive Ad Information: Get detailed insights into each ad, including the ad archive ID, page info, ad text, media URLs, and more.
🔒 Handling Authentication: Supports authentication to scrape ads that require login to access restricted content.
🆔 Max Item Control: Set a limit on the number of items scraped with the maxitems parameter to tailor your results.
✍️ Publisher Platforms: Retrieve data from specific platforms (e.g., Facebook, Instagram) based on your selected parameters.
```

### How to Use Facebook Ads Scraper?

Using the Facebook Ads Library Scraper is straightforward! It's designed to be user-friendly and accessible for all skill levels. Here's how you can use it:

1. **Sign up** for an account on **Apify**.
2. Open the **Facebook Ads Library Scraper** on the Apify platform.
3. Input the Facebook post URL for which you want to scrape ads.
4. Click the **"Start"** button and wait for the scraping process to complete.
5. Download the extracted data in various formats:
   - JSON
   - CSV
   - XML
   - Excel
   - HTML

### Pricing for Facebook Ads Library Scraper 💰

This scraper operates on a **pay-per-month** basis. You only pay for the successful results returned by the scraper.

- **Price**: $18.99 per month.

### Why scrape Facebook Ads Library ? ✨

🚨 Detect and Analyze Social Media Trends: Stay ahead of emerging trends, uncover potential misinformation, or identify harmful content by analyzing the ads being run across various regions and platforms.

📊 Perform Market Research: Gain valuable insights into what types of ads are resonating with audiences, the strategies brands are using, and the effectiveness of different ad formats and targeting.

🏁 Monitor Competitors: Track your competitors' ad campaigns to understand their marketing strategies, identify gaps in your approach, and discover new opportunities.

💬 Measure Brand Sentiment: Analyze ad text, media types, and engagement data to gauge public perception of brands, track customer sentiment, and monitor shifts in customer engagement over time.

### Input for Facebook Ads Library Scraper 👌

The scraper accepts a variety of parameters to customize the scraping process. Here's how you can structure the input JSON for the Facebook Ads Library Scraper:

```
{
    "country_name": "United States 🇺🇸",
    "active_status": "active",
    "ad_type": "all",
    "media_type": "all",
    "publisher_platforms": "all",
    "start_date_min": "2023-01-01",
    "start_date_max": "2024-01-01",
    "keyword": "marketing",
    "maxitems": 30
}


```

### Output for Facebook Ads Library Scraper 👌

```
    {
        "ad archive ID": "1558115924841774",
        "Page Name": "Israr Ahmed Digital",
        "Page ID": "513604698500641",
        "Page Like count": 37,
        "Page Categories": [
            "Digital Creator",
            "Business",
            "Business"
        ],
        "CTA Type": "LIKE_PAGE",
        "link_url": "https://www.facebook.com/513604698500641",
        "Impressions text": "N/A",
        "start_date": 1734681600,
        "end_date": 1734854400,
        "ad_text": "Your growth starts with the right decisions! 🌟\nTake your business to the next level with expert Digital Marketing, Web Development, and Graphic Design solutions.\n💡 Like my Facebook page to learn how we can help you achieve your goals!",
        "image_urls": "N/A",
        "video_urls": "N/A",
        "categories": [
            "UNKNOWN"
        ],
        "publisher_platforms": [
            "FACEBOOK"
        ],
        "collation_count": 1,
        "entity_type": "PERSON_PROFILE",
        "total_active_time": "N/A",
        "has_images": true,
        "has_videos": true,
        "has_clickable_link": true,
        "is_active": true,
        "contains_sensitive_content": false,
        "contains_digital_created_media": false,
        "is_aaa_eligible": false,
        "start_date_formatted": "2024-12-20",
        "end_date_formatted": "2024-12-22"
    }
```

### Related Actors

If you're interested in other social media scraper or real estate Actors:

- [Facebook Group Members Scraper 📊👥 - Fast & cheap 💬⭐](https://apify.com/scrapestorm/my-actor-1)
- [Facebook Ads Library Scraper 🎯📈 - Fast & cheap 💬⭐](https://apify.com/scrapestorm/facebook-ads-library-scraper---fast-cheap)
- [Facebook Followers & Following Scraper 📊👥 - Fast & cheap 💬⭐](https://apify.com/scrapestorm/facebook-followers-following-scraper---fast-cheap)
- [Facebook Groups Search Scraper 👥 - Cheap](https://apify.com/scrapestorm/facebook-groups-search-scraper---cheap)
- [Facebook Pages Search Scraper 📄](https://apify.com/scrapestorm/facebook-pages-search-scraper)
- [Facebook Comments Scraper (All-in-One) 💬](https://apify.com/scrapestorm/facebook-comments-scraper-all-in-one)
- [Facebook Likes Scraper (Fast & Cheap) 👍 🌟](https://apify.com/scrapestorm/facebook-likes-scraper-fast-cheap)
- [LinkedIn Ads Scraper 🔍🌍 (Advanced & Cheaper 💰)](https://apify.com/scrapestorm/linkedin-ads-scraper-advanced-cheaper)
- [Pinterest Profiles Search Scraper 🖼️👥🔍](https://apify.com/scrapestorm/pinterest-profiles-search-scraper)
- [Pinterest Boards Search Scraper 🎨🔍](https://apify.com/scrapestorm/pinterest-boards-search-scraper)
- [Pinterest Pins/Videos Search Scraper 🎨🔍](https://apify.com/scrapestorm/pinterest-pins-videos-search-scraper)
- [YouTube Scraper (By Keyword) - ⭐⭐⭐⭐⭐ Fast & cheap](https://apify.com/scrapestorm/youtube)
- [Youtube Channel Scraper](https://apify.com/scrapestorm/youtube-channel-scraper)
- [Youtube Shorts Scraper 📺 (Rental) - Fast & cheap](https://apify.com/scrapestorm/youtube-shorts-scraper-rental---fast-cheap)
- [YouTube Transcript Video Scraper 📝 (⚡ Fast & 💸 Cheap)](https://apify.com/scrapestorm/youtube-transcript-videos)
- [Youtube Playlist Scraper 🎵 - Rental (Fast & cheap)](https://apify.com/scrapestorm/youtube-playlist-scraper---rental-fast-cheap)

***

You can even apply sentiment analysis on the contents text we've extracted! 😃📊:

- [Sentiment Analysis Text Classification 📈](https://apify.com/scrapestorm/sentiment-analysis-text-classification)

### Countries Included 🌍

```
United States 🇺🇸
United Kingdom 🇬🇧
India 🇮🇳
Aland Islands 🇦🇽
Albania 🇦🇱
Algeria 🇩🇿
American Samoa 🇦🇸
Andorra 🇦🇩
Argentina 🇦🇷
Australia 🇦🇺
Austria 🇦🇹
Belgium 🇧🇪
Brazil 🇧🇷
Canada 🇨🇦
Chile 🇨🇱
Colombia 🇨🇴
Ivory Coast 🇨🇮
Croatia 🇭🇷
Czechia 🇨🇿
Denmark 🇩🇰
Egypt 🇪🇬
Finland 🇫🇮
France 🇫🇷
Germany 🇩🇪
Indonesia 🇮🇩
Italy 🇮🇹
Luxembourg 🇱🇺
Malaysia 🇲🇾
Mexico 🇲🇽
Monaco 🇲🇨
Morocco 🇲🇦
Netherlands 🇳🇱
Nigeria 🇳🇬
Norway 🇳🇴
Pakistan 🇵🇰
Palestine 🇵🇸
Philippines 🇵🇭
Poland 🇵🇱
Portugal 🇵🇹
Qatar 🇶🇦
Saudi Arabia 🇸🇦
Senegal 🇸🇳
Singapore 🇸🇬
South Africa 🇿🇦
Spain 🇪🇸
Sweden 🇸🇪
Switzerland 🇨🇭
Thailand 🇹🇭
Turkey 🇹🇷
Russia 🇷🇺
China 🇨🇳
Ukraine 🇺🇦
United Arab Emirates 🇦🇪
Vietnam 🇻🇳
ALL 🌍
```

If you'd like to add a specific country not listed here, feel free to contact us 📩, and we'd be happy to assist!

### 📫 Support

😊 Leave us a star ⭐ if you are satisfied with the product!
🌍 For any questions, specific needs or issues, please reach out through Apify's platform or via email - [Storm_Scraper 🌪️🌩️](https://apify.com/scrapestorm)

# Actor input Schema

## `email` (type: `string`):

Your Facebook account email address 📧

## `password` (type: `string`):

Your Facebook account password 🔒

## `bulk_keywords` (type: `string`):

Enter one keyword per line to scrape ads for multiple keywords ✍️🔍

## `max_items_per_keyword` (type: `integer`):

The maximum number of ads to fetch for each keyword 🔢

## `country_name` (type: `string`):

Select country to scrape ads from 🌍

## `active_status` (type: `string`):

The type of the active_status 🟢🔴⚪

## `ad_type` (type: `string`):

The type of the ads (credit_ads = financials services) 🎯

## `media_type` (type: `string`):

The type of the media (none means no image or video)

## `publisher_platforms` (type: `string`):

Choose a social media plateforme 🌐

## `start_date_min` (type: `string`):

Date of start_date min search 📅

## `start_date_max` (type: `string`):

Date of start_date max search 📅

## Actor input object example

```json
{
  "email": "youremail@gmail.com",
  "bulk_keywords": "fashion\nbusiness\nfitness",
  "max_items_per_keyword": 100,
  "country_name": "ALL 🌍",
  "active_status": "all",
  "ad_type": "all",
  "media_type": "all",
  "publisher_platforms": "all",
  "start_date_min": "2018-05-09",
  "start_date_max": "2026-04-15"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "email": "youremail@gmail.com",
    "bulk_keywords": `fashion
business
fitness`,
    "max_items_per_keyword": 100,
    "country_name": "ALL 🌍",
    "active_status": "all",
    "ad_type": "all",
    "media_type": "all",
    "publisher_platforms": "all",
    "start_date_min": "2018-05-09",
    "start_date_max": "2026-04-15"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapestorm/facebook-ads-library-scraper---fast-cheap").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 = {
    "email": "youremail@gmail.com",
    "bulk_keywords": """fashion
business
fitness""",
    "max_items_per_keyword": 100,
    "country_name": "ALL 🌍",
    "active_status": "all",
    "ad_type": "all",
    "media_type": "all",
    "publisher_platforms": "all",
    "start_date_min": "2018-05-09",
    "start_date_max": "2026-04-15",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapestorm/facebook-ads-library-scraper---fast-cheap").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 '{
  "email": "youremail@gmail.com",
  "bulk_keywords": "fashion\\nbusiness\\nfitness",
  "max_items_per_keyword": 100,
  "country_name": "ALL 🌍",
  "active_status": "all",
  "ad_type": "all",
  "media_type": "all",
  "publisher_platforms": "all",
  "start_date_min": "2018-05-09",
  "start_date_max": "2026-04-15"
}' |
apify call scrapestorm/facebook-ads-library-scraper---fast-cheap --silent --output-dataset

```

## MCP server setup

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

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/KpvfEqrLeYfLLtgai/builds/smAl0TXakcrK5h46Z/openapi.json
