How to extract all data from Facebook Ads

Ever wondered why Facebook shows you this particular ad? Facebook advertisers keep their cards open: Facebook Ads Library is open for anyone to check, browse, and scrape. See this guide on how you can export Facebook Ads data on any brand and location.

Content

Hey, we're Apify. The Apify platform gives you access to over 2,000 data extraction tools and unofficial APIs for popular websites. Check us out.

Read this to learn how to extract advertising data from Facebook Ads on scale by using Facebook Ads Scraper ๐Ÿ”—. Youโ€™ll discover how to extract page details, reach estimates, publisher platforms, report count, and more.

๐Ÿงข What are Facebook Ads for?

Social media ads are the most straightforward way for brands to promote their products or services, with the ads becoming more targeted and personalized every year.

The Meta Ad Library was initially created to ensure transparency in political advertising and combat misinformation. It is basically a public archive of all ads that run on Facebook and its associated platforms, including Instagram. You can freely find information on who paid for the ad, how much they spent, the demographics of the audience who saw the ad, and the ad's content.

โ˜‘๏ธ What can a scraper get from Facebook Ads?

๐Ÿงฒ Get all the details. You can grab all the important details about ads, like when they end, who's advertising, where the ad is coming from, and more.

๐Ÿ”ฆ Filter your search. You can narrow down your search by applying filters, so you only get the results you want.

๐Ÿงญ Find specific advertisers. If you're interested in a particular advertiser, you can search just for their ads.

๐Ÿ— Search by keyword. Looking for something specific? You can use any keyword you want, or even target a specific country or type of ad.

๐Ÿช› How do I use data from Facebook Ads?

On the scale of a single user, the availability of ad data makes it easier for Facebook users to understand why they are seeing a particular ad and who is trying to influence their opinions. On the scale of a researcher or business, data analysis of the information in Facebook Ad Library can tell you a lot about the overall tactics, messaging, and even spending of campaigns - political, marketing or otherwise.

๐ŸฅŠ Check out the competition. See what your competition is up to on Facebook by getting all the info on their ads.

๐Ÿงช Analyze data and make your own ads better. Get the Facebook Ads data you need, and analyze it any way you want for any country, category, or keyword. This data can significantly enhance your social media analytics report, making it your ultimate tool for analyzing Facebook ads.

โฐ Get alerts. Stay up-to-date on new ads in the categories, countries, or keywords you're interested in by getting notifications.

๐Ÿฅพ Step-by-step guide to scraping Facebook Ads

Step 1. Find a scraper for Facebook Ads

In Apify Store, head over to the Facebook Ads Scraper ๐Ÿ”— page, and click the Try for free button. You will be redirected to Apify Console - your workspace to run web scraping tasks for any website, including Facebook.

Step 1. Find a scraper for Facebook Ads
Step 1. Find a scraper for Facebook Ads

Log in or sign up for free using your email address or GitHub account. No strings attached and no credit card needed.

Log in or sign up for free using your email address or GitHub account
Log in or sign up for free using your email address or GitHub account

Step 2. Configure the scraper

Decide which Facebook Page you want to extract advertising data from. Input the page URL or page name into the scraper's input fields.

๐Ÿ‘ How to scrape all Facebook Ads from a Facebook page?

The simplest way would be to head over to facebook.com, find the Facebook page of the brand or public figure whose ads youโ€™re interested in, and copy-paste their page URL into the scraper. This method is the easiest since you donโ€™t have to find the ads themselves, just the page. Donโ€™t forget to set up how many ads you want to scrape.

Shein Facebook Page
Find Shein Facebook Page
Copypaste the page URL into the field
Copypaste the page URL into the field

๐Ÿ“” How to scrape Facebook Ads data from Facebook Ads Library?

Alternatively, head over to https://www.facebook.com/ads/library/. Facebook ads are publicly available so you donโ€™t need any special access to see the ads running presently for any brand. Pick the location, ad type, and brand youโ€™re interested in. Now copy the URL on top of the page and paste it into the scraper. In our case, weโ€™ve picked American SHEIN.

The advantages of Facebook Ads Library ๐Ÿ”— method over the previous one (just going to SHEINโ€™s Facebook page) are:

๐Ÿ‘ Overview: you can browse all available brands and their branches in the drop-down list without having to search for them on Facebook specifically.

๐ŸŽฏ Accuracy: you get to pick the country, type, and filter the results by keyword before scraping them, so youโ€™d get exactly what you need.

โš–๏ธ Managing expectations: you see how many results there are in total and what kind of information you can expect in the output.

Step 3. Run the scraper by clicking Start โ–ถ๏ธ

Once you're ready, click the Start button to begin the data extraction from Facebook. The task will change to Running ๐Ÿƒโ€โ™‚๏ธ status, so wait for the scraper to finish. It may take a few minutes.

Step 3. Run the scraper by clicking Start โ–ถ๏ธ
Step 3. Run the scraper by clicking Start โ–ถ๏ธ

Step 4. Download your Facebook Ads data

Once you see that the run shows Succeeded ๐Ÿ, you can check the results in the Storage tab ๐Ÿ“ฆ.

Step 4. Download your Facebook Ads data
Step 4. Download your Facebook Ads data

You can preview the data by clicking the Preview ๐Ÿ‘ button or view it in a new tab. You can download the data in various formats such as JSON, CSV, and Excel to use it in your apps, reports, and data projects.

A visualization of the scraped dataset containing Shein's Ads on Facebook
A visualization of the scraped dataset containing Shein's Ads on Facebook

๐ŸŒˆ Need more Facebook scraping tools?

If you're trying to get specific Facebook data such as comments or page reviews, explore these scrapers below. Each one is built for a certain scraping case and are free to try out:

๐Ÿ—“ Facebook Events Scraper: extracts Facebook events data.

๐Ÿ“œ Facebook Pages Scraper: scrapes basic info about the page.

๐ŸŒŸ Facebook Reviews Scraper: extracts Facebook reviews data from the page (text and reviewer).

๐Ÿ’ฌ Facebook Comments Scraper: extracts comments from the posts.

๐Ÿ•ต๏ธโ€โ™€๏ธ Facebook Search Scraper: scrapes Facebook search by keyword.

๐Ÿž Facebook Photos Scraper: extracts Facebook images and their data.

๐Ÿ‘ Facebook Likes Scraper: extracts Facebook reactions and likes.

๐Ÿ‘ฅ Facebook Groups Scraper: extracts Facebook data posts in public groups.

๐Ÿ“ Facebook Posts Scraper: extracts data from each post on the page and its details.

๐Ÿ—“ Facebook Events Scraper: extracts Facebook events data.

๐ŸŽฎFacebook Games Scraper: extracts info about Facebook games and live streams.

โ“ FAQ

๐Ÿ›ก Do you need proxies to scrape Facebook Ads?

Nowadays, that's the case. Since 2021, Facebook has doubled down on anti-scraping and you now require a proxy to scrape Facebook effectively. Although datacenter proxies can still bring you some data (like reviews, for instance), residential proxies are the most reliable way to go for Facebook scraping in 2023. Fortunately, our free plan offers a free trial of residential proxies, so you can fully test this scraper tool on a few Facebook pages.

Scraping Facebook Ads data is legal, as long as it's done ethically and personal data is not extracted. The golden rule is: personal data should only be scraped if you have a valid reason to do so. If in doubt, seek legal advice. A good place to start exploring this subject is our Is web scraping legal? blog post.

๐Ÿ‘ท This scraper doesnโ€™t do the job for me. Can I build my own Facebook scraper?

Yes, you can and weโ€™ll be happy to provide the environment for your Facebook scraping tools of any complexity. You can build your own Facebook scraper on the Apify cloud โ€” either just for deployment or for full production โ€” and make good use of built-in proxies, infrastructure, and storage.


Natasha Lekh
Natasha Lekh
Crafting content that charms both readers and Googleโ€™s algorithms: readmes, blogs, and SEO secrets.

Get started now

Step up your web scraping and automation