RealdataAPI Store - Browse tools published by our community and use them for your projects right away

Facebook Ads Scraper

RealdataAPI / facebook-ads-data-product-scraper

Scrape advertising data from multiple Facebook pages in a single click. Get reach estimates, report count, ad IDs, page details, publisher platforms, and timestamps. Download the scraped Facebook ads data in Excel, JSON, and CSV format, and use it anywhere you need.

What is Facebook Ads Data Extractor?

It is a powerful and straightforward actor that allows you to extract Facebook ads data like reach estimates, page information, publisher platform, report analytics, and more. To collect that data, place the page link and click on the save and start option.

Why extract Facebook ads data?

It will help you in market research, trend monitoring, competitor intelligence, social media study, brand sentiment, etc.

How to use Facebook Ads Scraper?

We've designed this scraper to collect Facebook ads data to quickly start the process even if you are beginning to scrape the data. Here is the process to scrape information using this API.

  • Create a free Real Data API account with your email.
  • Open Facebook ads data scraper on our platform.
  • Place multiple URLs of Facebook pages to scrape ad data.
  • Click the Start button and allow some time for the scraper to get you the required data.
  • Export the data in any usable format of your choice.

Note that this actor shows the scraped outputs only at the end of execution. While running, the scraper won't update outputs. You can allow the scraper to finish the execution to see the output.


It would help if you fed the input to this scraper as below.

  • URL of the page like
  • Or the URL of the advertisement, like try=ALL&q=%7B%7D&sort_data[direction]=desc&sort_data[mode]=relevan cy_monthly_grouped&start_date[min]=2022-10- 12&start_date[max]=&search_type=keyword_unordered&media_type=vid You can get a longer URL in the ads library of Facebook. Before pasting the link, mention filters, settings, and amounts per page.
  • Keep in mind that zero scrolls reflect the first few ad sets. Every scroll can deliver 30 advertisements. Facebook restricted the maximum number of ads shown per page, so you may not see all the ads.

Open the input tab to see the JSON example.

  "startUrls": [
    { "url": "" }
  "scrollsAmount": 4

This mini-actor will give you dataset outputs. You can select any format to download them, like Excel, CSV, HTML, JSON, etc. To get a JSON dataset, follow the above input parameters.

  "adid": "0",
  "adArchiveID": "686299683225424",
  "archiveTypes": [
  "categories": [
  "collationCount": 1,
  "collationID": 1794991554233513,
  "currency": "CZK",
  "endDate": 1673337600,
  "entityType": "regular_page",
  "fevInfo": {
    "authorized_entity_text": "This information was submitted by the advertiser.",
    "email": "",
    "phone": "+420602346701",
    "website": "",
    "submitted_on": "Submitted May 3, 2019",
    "address": "Babická 2, Praha 4 14000, CZ",
    "fec_additional_info": null,
    "learn_more_content": {
      "help_center_text": "Visit the Help Center to learn about what we require from advertisers to run ads about social issues, elections or politics.",
      "help_center_url": "",
      "learn_more_text": "Learn more"
    "free_form_additional_info": {
      "committee_id": null,
      "cnpj_or_cpf": null,
      "director_name": null,
      "ec_certificates": [],
      "gst_number": null,
      "point_of_contact": null,
      "treasurer_name": null,
      "agent_name": null,
      "corporate_purpose": null,
      "promoter_name": null
    "page_admin_additional_info": null,
    "page_name_additional_info": null
  "gatedType": "eligible",
  "hasUserReported": false,
  "hiddenSafetyData": false,
  "hideDataStatus": "NONE",
  "impressionsWithIndex": {
    "impressionsText": "10K - 15K",
    "impressionsIndex": 10
  "isActive": false,
  "isProfilePage": false,
  "pageID": "214827221987263",
  "pageInfo": null,
  "pageIsDeleted": false,
  "pageName": "Andrej Babiš",
  "politicalCountries": [
  "reachEstimate": "500K - 1M people",
  "reportCount": null,
  "snapshot": {
    "ad_creative_id": "23853021782190015",
    "cards": [],
    "body_translations": {},
    "byline": "ANO",
    "caption": null,
    "cta_text": null,
    "dynamic_item_flags": {},
    "dynamic_versions": null,
    "edited_snapshots": [],
    "effective_authorization_category": "POLITICAL",
    "event": [],
    "extra_images": [],
    "extra_links": [],
    "extra_texts": [],
    "extra_videos": [],
    "instagram_shopping_products": [],
    "display_format": "text",
    "title": null,
    "link_description": null,
    "link_url": null,
    "page_welcome_message": null,
    "images": [],
    "videos": [],
    "creation_time": 1673253887,
    "page_id": 214827221987263,
    "page_name": "Andrej Babiš",
    "page_profile_picture_url": "",
    "page_categories": {
      "1700": "Politician"
    "page_entity_type": "regular_page",
    "page_is_profile_page": false,
    "instagram_actor_name": "",
    "instagram_profile_pic_url": "",
    "instagram_url": "",
    "instagram_handle": "",
    "is_reshared": false,
    "version": 3,
    "body": {
      "context": {},
      "markup": {
        "__html": "NEVINEN! Jsem velmi rád, že máme nezávislou justici a soud potvrdil, co jsem od začátku tvrdil. Že jsem nevinný a nic nezákonného jsem neudělal."
      "callerHash": "28f7aabaed78ac1e72dad4d68c033c9f"
    "brazil_tax_id": "",
    "branded_content": null,
    "current_page_name": "Andrej Babiš",
    "disclaimer_label": 1,
    "page_like_count": 252691,
    "page_profile_uri": "",
    "page_is_deleted": false,
    "root_reshared_post": null,
    "cta_type": null,
    "additional_info": {
      "treasurer_name": null,
      "director_name": null,
      "point_of_contact": null,
      "committee_id": null,
      "phone_number": "+420602346701",
      "email": "",
      "website": "",
      "street_address_1": "Babická 2",
      "street_address_2": null,
      "city": "Praha 4",
      "state": null,
      "zipcode": "14000",
      "corporate_purpose": null
    "ec_certificates": null,
    "country_iso_code": "CZ",
    "instagram_branded_content": null
  "spend": "CZK900 - CZK999",
  "startDate": 1673251200,
  "stateMediaRunLabel": null,
  "publisherPlatform": [
  "menuItems": [],
  "endDateFormatted": "2023-01-10T08:00:00.000Z",
  "startDateFormatted": "2023-01-09T08:00:00.000Z",
  "totalCount": 1070

Note: you'll see the start and end dates below in the ISO value format. startDateFormatted: "2022-10-12T07:00:00.000Z" and endDateFormatted: "2022- 10-12T07:00:00.000Z".

What is the cost of using a Facebook Ads scraper?

Suppose you use this scraper on the Real Data API platform for result-oriented Facebook data extraction. In that case, you need residential proxy servers in the monthly personal plan of Real Data API, which is around 50 USD per month.

To know more about how we offer pricing, proxies and usages, and platform credits, check the pricing page on our platform.

Do you want to collect Facebook groups or comments data?

If you want to collect detailed Facebook data, we've dedicated a scraper for them below.

  • Facebook Groups Scraper
  • Facebook Reviews Scraper
  • Facebook Comments Scraper
  • Facebook Photos Scraper
Facebook Ads scraper with Integrations

Lastly, you can connect this actor with any web application or cloud service with Real Data API integrations. You can connect with Slack, Zapier, GitHub, Make, Google Drives, Airbyte, Google Drive, etc.

You can also use Webhooks to commence the action at the time of the event, like getting an alert in the successful execution of this API.

Using Facebook Ads Scraper with the Real Data API

The Real Data API allows you to access actors programmatically. It also allows you to use datasets, track API performances, generate results, update and develop versions, etc. To use the actor in Python, use our client PyPl package, and to use in Node.js, use our client NPM package.

See the Real Data API actor reference document for details, or open the API tab for codes.

Can I extract Facebook Ads data legally?

We follow all the rules and regulations to maintain ethics and don't scrape any private data like location, gender, or email ids of personal accounts. But the scraped data may contain some personal information unintentionally, so be aware and don't scrape any personal data without genuine reason.

You can consult advocates if you are confused about whether your reason is legal.


Check out how industries are using Facebook Ads Scraper around the world.


eCommerce & Retail


Marketing & Media


Fintech & Insurance

You should have a Real Data API account to execute the program examples. Replace <YOUR_API_TOKEN> in the program using the token of your actor. Read about the live APIs with Real Data API docs for more explanation.

import { RealdataAPIClient } from 'RealDataAPI-Client';

// Initialize the RealdataAPIClient with API token
const client = new RealdataAPIClient({
    token: '<YOUR_API_TOKEN>',

// Prepare actor input
const input = {
    "startUrls": [
            "url": ""
    "scrollsAmount": 0,
    "proxyConfig": {
        "useRealdataAPIProxy": true,
        "RealdataAPIProxyGroups": [

(async () => {
    // Run the actor and wait for it to finish
    const run = await"RealdataAPI/facebook-page-ads").call(input);

    // Fetch and print actor results from the run's dataset (if any)
    console.log('Results from dataset');
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    items.forEach((item) => {
from RealdataAPI_client import RealdataAPIClient

# Initialize the RealdataAPIClient with your API token
client = RealdataAPIClient("<YOUR_API_TOKEN>")

# Prepare the actor input
run_input = {
    "startUrls": [{ "url": "" }],
    "scrollsAmount": 0,
    "proxyConfig": {
        "useRealdataAPIProxy": True,
        "RealdataAPIProxyGroups": ["RESIDENTIAL"],

# Run the actor and wait for it to finish
run ="RealdataAPI/facebook-page-ads").call(run_input=run_input)

# Fetch and print actor results from the run's dataset (if there are any)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
# Set API token

# Prepare actor input
cat > input.json <<'EOF'
  "startUrls": [
      "url": ""
  "scrollsAmount": 0,
  "proxyConfig": {
    "useRealdataAPIProxy": true,
    "RealdataAPIProxyGroups": [

# Run the actor
curl "$API_TOKEN" /
  -X POST /
  -d @input.json /
  -H 'Content-Type: application/json'

Which Facebook page or ads do you want to extract?

startUrls Required Array

Links for the API, to begin with- you should use these category or product

How many per page scrolls do you want?

scrollsAmount Optional Integer

Each page ads scroll must have 30 advertisements where the count starts with zero.

I want to scrape only the full ads count on every page.

onlyTotal Optional Boolean

If you use this feature, you'll get only the total count of scrolls per page, where you'll get a single dataset per page as your output.

Proxy configuration

proxyConfig Optional Object

It would help if you had a proxy server to execute this scraper. You can use our residential proxies or your servers.

Max retries

maxRequestRetries Optional Integer

When scraping fails, get maximum retries.

  "startUrls": [
      "url": ""
  "scrollsAmount": 0,
  "proxyConfig": {
    "useRealdataAPIProxy": true,
    "RealdataAPIProxyGroups": [
  "maxRequestRetries": 2