Facebook Ads Library

No-Code Facebook Ads Library API Scraper

Download Data to Excel & CSV Files

Legally scrape Facebook Ads Library data from the Official Website without violating its Terms of Service using HAR Files.

🚫 This means no wasting time with broken screen scrapers, installing software, getting blocked or overpriced proxies.

HkP4rAhnmLQ ▶️
Steve Spagnola
Written by Steve Spagnola
Last updated April 25, 2024

Scraping the Facebook Ads Library API

Scrape Facebook Ads Library data legally without violating Meta’s Terms of Service using a little-known technique involving web scraping with HAR files with our Facebook Ads scraper.

c2aGI7Kgm7I ▶️

This can be very useful if you need to Download Videos from the Facebook Ads Library for competitive research or just “borrow” some creative inspiration from the social media platform.

Scrape Any Facebook Page's Ads

You’ll be able to download the public ad creatives, videos & landing pages for any Facebook advertiser without waiting to be approved for the extremely limited Facebook Ads Library API, which is limited to only political advertising, requires you to manually be approved for an API key and is useless for most Facebook and Instagram advertisers.

This Facebook data can save you thousands of dollars in wasted ad spend by understanding what messages are working for your competitors (if the same ad has been running for a long time, it’s probably working) and see exactly which landing page URLs they are directing traffic to.

1. Browse Facebook Ads

Go to the Facebook Ads Library (or Meta Ads Library) and use the “Search Ads” form to find ads you’re interested in scraping data about. Unlike using the Facebook Ad Library API, you can select from any ad category, not just political ads:

Facebook Ad Library Search

To narrow down your search even more, you can apply filters (look for the button on the upper right part of the page). Review and apply the filters that make sense for you, then the results will reload.

Apply Filters if Needed

On your web browser (we’ll assume you’re using Google Chrome, but these instructions should be similar for any browser), right click anywhere on the page and hit Inspect to open up developer tools (this will allow you to record your web traffic with the Facebook Ads data in it). You can then click on the “Network” tab to see your web traffic with the data in it.

Open Developer Tools on Facebook Ads Results

Now that developer tools are open, we’re “recording” the raw data that Facebook sends back to our browser that we want to scrape. This is the key reason our approach is totally legal, as we scrape the data from your recording instead of the actual Facebook website.

In order to capture the initial results that were sent, we need to first refresh the page (so Facebook sends the data again while we’re recording). Once you refresh the page, begin to scroll down and you’ll see in your browser’s “Network Tab” Facebook send more and more data we’re recording.

Web Traffic Recording of GraphQL Endpoints

2. Export a HAR File

Once you’re done scrolling, look for a download arrow in your browser’s developer tools (Network Tab) that’s labeled something along the lines of “Export HAR…” Click this and save the HAR file somewhere you can access quickly, like your Desktop:

Click Export HAR File

Now that we have the data inside this large file, the trick is to get the data out of this file. For this, we suggest using our HAR File Web Scraper where you can upload the file here, and the software will parse everything out for you and group together all the different requests with the Facebook Ads data in it:

Combined Facebook Ads Library Data

3. Download Ads Data

You can click the disk icon next to the individual requests and download the raw JSON for each individual request for free. However, if you have a budget then you may want to consider using the “Parse” feature of the HAR File Web Scraper.

If you click the “Parse Group” button on the top of the grouped responses, you’ll see combined results of all the ads you scrolled through. For example, the first collection shows the 193 ads we scrolled through in a single table we can download as a CSV file:

Ad Copy & Page Stats

You’ll also see other features of the ads in the extracted data, like Facebook page name & ID, call out extensions & image URLs you can download:

Additional Ad Fields

You can explore more collections to get even more data back - like seeing the exact date and time the ad was created (long-running ads are a sign that the ad works). Unfortunately though the raw stats for these ads aren’t included in the response and this data is better suited for helping to understand the creative landscape of the market you’re advertising in.

Downloading Videos

If you want to know how to download video from Facebook Ads library, we’ll walk through an additional collection you can look for in the HAR File Web scraper that will contain links to the image previews and full HD versions of the videos used in ads, so you can download video ads locally for your own analysis & discussion.

Look for the Collection Ending in Videos

Simply look for the collection(s) ending in “Videos” and click the “Download CSV” button. The result will contain references to the parent ads on the right side of the CSV file, this way you not only have a link to download the videos, but also a reference to the parent ad objects and metadata:

Expanded Video Ad CSV Download

Why Scrape Facebook Ads?

If you’re running social media ads on Facebook & Instagram (or an ad agency looking to Find Clients for Your SMMA), a crucial component for success is understanding what ads are working for your competitors and similar advertisers who are reaching your target audience.

This can save you thousands of dollars in wasted ad spend and will also help you understand how to position your messaging to stand out from your competitors ads and the hundreds of other active ads your audience sees.

Sign Up to Scrape Data from Facebook Ads Library