Facebook Ads Scraper

  • apify/facebook-page-ads
  • Modified
  • Users 495
  • Runs 78k
  • Created by Author's avatarApify

Extract advertising data from one or multiple Facebook Pages. Get page details, reach estimates, publisher platforms, report count, number of impressions, ad IDs, timestamps, and more. Download Facebook ads data in JSON, CSV, and Excel and use it in apps, spreadsheets, and reports.

What is Facebook Page Ads Scraper?

It's a simple and powerful tool that allows you to scrape data from Facebook ads: page details, reach estimates, publisher platforms, report count and more. To get that data, just insert the page URL and click "Save & Start" button.

Why scrape Facebook page ads?

💪 Competition intelligence 🕵️ Market research or analysis 📈 Monitoring trends and brand sentiment 🤳 Social media analysis 🥸 Identifying hot spots of misinformation

How do I use Facebook Ads Scraper?

Facebook Page Ads Scraper was designed to be easy to start with even if you've never extracted data from the web before. Here's how you can scrape Facebook data with this tool:

  1. Create a free Apify account using your email.
  2. Open Facebook Page Ads Scraper.
  3. Add one or more Facebook page/profile URLs to scrape its ads.
  4. Click "Start" and wait for the data to be extracted.
  5. Download your data in JSON, XML, CSV, Excel, or HTML.

Please note that this scraper displays the extracted results only at the very end of the run. The rest of the time it will display 0 results. Please be patient until the end of the scraper run to see all the extracted data.

Input

The input for Facebook Ads Scraper should be either

  • Facebook Page URLs such as https://www.facebook.com/drive4quantix/
  • or Facebook Ads URLs such as https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&q=%7B%7D&sort_data[direction]=desc&sort_data[mode]=relevancy_monthly_grouped&start_date[min]=2022-10-12&start_date[max]=&search_type=keyword_unordered&media_type=video. You can find the long Facebook Ads URL in Facebook Ad Library. Before you copy&paste this URL, don't forget to include settings, filters and the amount of scrolls for ads per page.
  • Note that zero scrolls will return the initial set of ads. Each scroll is expected to return 30 ads. Facebook limits the max amount of ads displayed per page, so some older ads might not be available.

Click on the input tab for an input example in JSON.

{
  "startUrls": [
    { "url": "https://www.facebook.com/AndrejBabis" }
  ],
  "scrollsAmount": 4
}

Output

This mini-scraper will deliver results in a dataset. You can choose in which format to download it: JSON, Excel, HTML CSV, or XML. Here's an excerpt from the JSON dataset you'd get if you apply the input parameters above:

[{
  "adid": "0",
  "adArchiveID": "686299683225424",
  "archiveTypes": [
    1
  ],
  "categories": [
    1
  ],
  "collationCount": 1,
  "collationID": 1794991554233513,
  "currency": "CZK",
  "endDate": 1673337600,
  "entityType": "regular_page",
  "fevInfo": {
    "authorized_entity_text": "This information was submitted by the advertiser.",
    "email": "prchal@anobudelip.cz",
    "phone": "+420602346701",
    "website": "http://www.anobudelip.cz/",
    "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": "https://www.facebook.com/help/180607332665293?ref=infosheet",
      "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": [
    "CZ"
  ],
  "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": "https://scontent-atl3-2.xx.fbcdn.net/v/t39.35426-6/324236805_550621033654724_1514405251265970155_n.jpg?stp=dst-jpg_s60x60&_nc_cat=100&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=jSU-CXHG9wkAX_A3nLA&_nc_ht=scontent-atl3-2.xx&oh=00_AfCw2tGNp6ndic-bGa4OBkE8bi1VRqGG1NnzzFJ0_lV2fw&oe=63C3C8BC",
    "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": "https://www.facebook.com/AndrejBabis/",
    "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": "prchal@anobudelip.cz",
      "website": "www.anobudelip.cz",
      "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": [
    "facebook"
  ],
  "menuItems": [],
  "endDateFormatted": "2023-01-10T08:00:00.000Z",
  "startDateFormatted": "2023-01-09T08:00:00.000Z",
  "totalCount": 1070
},
...

Please note that startDate and endDate when-if available will be added as formatted ISO values as startDateFormatted: "2022-10-12T07:00:00.000Z" and endDateFormatted: "2022-10-12T07:00:00.000Z"

How much will it cost me to scrape Facebook Ads?

If you run the scraper on the Apify platform, for successful Facebook scraping you will need residential proxies which are included in Apify's monthly Personal plan ($49).

For more details about how our pricing works, platform credits, proxies and usage, see the platform pricing page or this video guide on ▷ how to choose the right subscription plan.

Want to scrape Facebook comments or groups?

You can use the dedicated scrapers below if you want to scrape specific Facebook data. Each of them is built particularly for the relevant Facebook scraping case be it a group, reviews, comments or photos. Feel free to browse them:

👥 Facebook Groups Scraper | 🌟 Facebook Reviews Scraper 💬 Facebook Comments Scraper | 🏞 Facebook Photos Scraper

Integrations and Facebook Ads Scraper

Last but not least, Facebook Ads Scraper can be connected with almost any cloud service or web app thanks to integrations on the Apify platform. You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, and more.

Or you can use webhooks to carry out an action whenever an event occurs, e.g. get a notification whenever Facebook Ads Scraper successfully finishes a run.

Using Facebook Ads Scraper with the Apify API

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more. To access the API using Node.js, use the apify-client NPM package. To access the API using Python, use the apify-client PyPI package.

Check out the Apify API reference docs for full details or click on the API tab for code examples.

Our Facebook scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. However, you should be aware that your results could contain personal data. You should not scrape personal data unless you have a legitimate reason to do so.

If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the legality of web scraping and ethical scraping.

Industries

See how Facebook Ads Scraper is used in industries around the world