Facebook Ads Scraper avatar
Facebook Ads Scraper
Try for free

Pay $5.00 for 1,000 Campaigns

View all Actors
Facebook Ads Scraper

Facebook Ads Scraper

apify/facebook-ads-scraper
Try for free

Pay $5.00 for 1,000 Campaigns

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 extract data from Facebook ads. To get that data, just insert the Facebook page URL and click "Save & Start" button.

What Facebook pages ads data can I extract?

With this Facebook API, you will be able to extract the following data from Facebook:

📝 Page details🔗 Page URL
🛍 Ad text, type, URL and title 💸 Ad spend
⏱ Timestamps 🌄 Images
🖱 CTA type🧮 Report count
👀 Reach estimates📢 Publisher platforms

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 URLs to scrape its ads or Ads URLs.
  4. Click "Start" and wait for the data to be extracted.
  5. Download your data in JSON, XML, CSV, Excel, or HTML.

For a step-by-step guide on how to scrape Facebook Page Ads, follow our Facebook Page Ads Scraper tutorial 📝.

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 a full explanation of input in JSON.

1{
2  "startUrls": [
3    { "url": "https://www.facebook.com/SHEINOFFICIAL" }
4  ],
5  "scrollsAmount": 4
6}

Output sample

The results will be wrapped into a dataset which you can find in the Storage tab. Here's an excerpt from the JSON dataset you'd get if you apply the input parameters above. You can choose in which format to download your Facebook data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

1[{
2      "adid": "0",
3      "adArchiveID": "1298602714065085",
4      "archiveTypes": [
5        1
6      ],
7      "categories": [
8        0
9      ],
10      "collationCount": 1,
11      "collationID": 1535040990319522,
12      "currency": "",
13      "endDate": 1680764400,
14      "entityType": "regular_page",
15      "fevInfo": null,
16      "gatedType": "eligible",
17      "hasUserReported": false,
18      "hiddenSafetyData": false,
19      "hideDataStatus": "NONE",
20      "impressionsWithIndex": {
21        "impressionsText": null,
22        "impressionsIndex": -1
23      },
24      "isAAAEligible": false,
25      "isActive": true,
26      "isProfilePage": false,
27      "pageID": "380039845369159",
28      "pageInfo": null,
29      "pageIsDeleted": false,
30      "pageName": "SHEIN",
31      "politicalCountries": [],
32      "reachEstimate": null,
33      "reportCount": null,
34      "snapshot": {
35        "ad_creative_id": "23853501580290642",
36        "cards": [],
37        "body_translations": {},
38        "byline": null,
39        "caption": "play.google.com",
40        "cta_text": "Install now",
41        "dynamic_item_flags": {},
42        "dynamic_versions": null,
43        "edited_snapshots": [],
44        "effective_authorization_category": "NONE",
45        "event": [],
46        "extra_images": [],
47        "extra_links": [],
48        "extra_texts": [],
49        "extra_videos": [],
50        "instagram_shopping_products": [],
51        "display_format": "image",
52        "title": "Celebramos DÍA S del 5 al 7 de cada mes",
53        "link_description": "Meet the SHEIN app - Your one-stop shop at prices you'll Love!",
54        "link_url": "http://play.google.com/store/apps/details?id=com.zzkko",
55        "page_welcome_message": null,
56        "images": [
57          {
58            "original_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/339909067_1366281674149524_839016310171111822_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=ohKvhxvZu9wAX95Ssh6&_nc_ht=scontent-dfw5-1.xx&oh=00_AfAZ2JiQY_pYM6wrqP0Y6TJvrcYaP1VtswOes0rYvFF1Qg&oe=64334A64",
59            "resized_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/339572809_1631465734038300_7692943675119564941_n.jpg?stp=dst-jpg_s600x600&_nc_cat=111&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=xkUyRyowgOAAX_1X381&_nc_ht=scontent-dfw5-1.xx&oh=00_AfCF5JG9JiuBQAlcVoHf99HVB0QPPGfHNn9xk8xbXNvrDA&oe=64336E86",
60            "image_crops": {}
61          }
62        ],
63        "videos": [],
64        "creation_time": 1680780538,
65        "page_id": 380039845369159,
66        "page_name": "SHEIN",
67        "page_profile_picture_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/339829931_549860997278610_316256852917459443_n.jpg?stp=dst-jpg_s60x60&_nc_cat=109&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=qYjLVyCauxoAX-F-uKG&_nc_ht=scontent-dfw5-1.xx&oh=00_AfBOn8V7BWyFcJ3cQp3ZNwKH0AhNe1bv7MV4UqHfTnftbA&oe=64332DC4",
68        "page_categories": {
69          "2209": "Clothing (Brand)"
70        },
71        "page_entity_type": "regular_page",
72        "page_is_profile_page": false,
73        "instagram_actor_name": "SHEIN.COM",
74        "instagram_profile_pic_url": "https://scontent-dfw5-2.xx.fbcdn.net/v/t39.35426-6/339893279_6031633613587805_5406372930440883094_n.jpg?_nc_cat=102&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=KR8ikQE-xdYAX_VESro&_nc_ht=scontent-dfw5-2.xx&oh=00_AfARBT4xR7FxAbzjRFrjG3iOam8JSyXbMxGDRpgKB5yitg&oe=6433FD0B",
75        "instagram_url": "",
76        "instagram_handle": "",
77        "is_reshared": false,
78        "version": 3,
79        "body": {
80          "context": {},
81          "markup": {
82            "__html": "Una campaña especial llamada “DÍA S” se realizará del 5 al 7 de cada mes para agradecerles su apoyo."
83          },
84          "callerHash": "91584ef3e37183a71399c913ead7a8c2"
85        },
86        "brazil_tax_id": null,
87        "branded_content": null,
88        "current_page_name": "SHEIN",
89        "disclaimer_label": null,
90        "page_like_count": 27827577,
91        "page_profile_uri": "https://www.facebook.com/SHEINOFFICIAL/",
92        "page_is_deleted": false,
93        "root_reshared_post": null,
94        "cta_type": "INSTALL_MOBILE_APP",
95        "additional_info": null,
96        "ec_certificates": null,
97        "country_iso_code": null,
98        "instagram_branded_content": null
99      },
100      "spend": null,
101      "startDate": 1680764400,
102      "stateMediaRunLabel": null,
103      "publisherPlatform": [
104        "facebook",
105        "instagram",
106        "audience_network",
107        "messenger"
108      ],
109      "menuItems": [],
110      "endDateFormatted": "2023-04-06T07:00:00.000Z",
111      "startDateFormatted": "2023-04-06T07:00:00.000Z"
112    },
113    {
114      "adid": "0",
115      "adArchiveID": "255511376905800",
116      "archiveTypes": [
117        1
118      ],
119      "categories": [
120        0
121      ],
122      "collationCount": 2,
123      "collationID": 3368857446776324,
124      "currency": "",
125      "endDate": 1680764400,
126      "entityType": "regular_page",
127      "fevInfo": null,
128      "gatedType": "eligible",
129      "hasUserReported": false,
130      "hiddenSafetyData": false,
131      "hideDataStatus": "NONE",
132      "impressionsWithIndex": {
133        "impressionsText": null,
134        "impressionsIndex": -1
135      },
136      "isAAAEligible": false,
137      "isActive": true,
138      "isProfilePage": false,
139      "pageID": "380039845369159",
140      "pageInfo": null,
141      "pageIsDeleted": false,
142      "pageName": "SHEIN",
143      "politicalCountries": [],
144      "reachEstimate": null,
145      "reportCount": null,
146      "snapshot": {
147        "ad_creative_id": "23854209337050318",
148        "cards": [
149          {
150            "original_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/340085024_900467907842792_2058670623938543832_n.jpg?_nc_cat=103&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=fQdFXh1oMVUAX8L3ZAZ&_nc_ht=scontent-dfw5-1.xx&oh=00_AfD-uo3EJJC9cvyQZL1NEpRVGVtJqKKqD8HWxCIA2aWvFw&oe=6434B334",
151            "resized_image_url": "https://scontent-dfw5-2.xx.fbcdn.net/v/t39.35426-6/339997754_914287486443941_556512467268781020_n.jpg?stp=dst-jpg_s600x600&_nc_cat=108&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=OFUkkZwekA4AX87ND8l&_nc_ht=scontent-dfw5-2.xx&oh=00_AfDt20etbNFo4K0C3g76ElSG0T3U0ygwMZ4J1A0bkzRUoQ&oe=64332195",
152            "image_crops": {},
153            "body": " ",
154            "caption": "m.shein.co.uk",
155            "cta_type": "INSTALL_MOBILE_APP",
156            "cta_text": "Install Now",
157            "title": "So Many Options",
158            "link_description": " ",
159            "link_url": "http://play.google.com/store/apps/details?id=com.zzkko"
160          },
161          {
162            "original_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/340085355_514770540860988_4018281338420390688_n.jpg?_nc_cat=110&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=fROHXKPeMYUAX9nebEN&_nc_ht=scontent-dfw5-1.xx&oh=00_AfCCMhCjFASYSf_wWDLe6uqleEwp9cW5vGYnnQF_n_AjOw&oe=6432F668",
163            "resized_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/340236375_909027907007839_6770418461945907370_n.jpg?stp=dst-jpg_s600x600&_nc_cat=103&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=nCu05B76AHcAX-_dp1I&_nc_ht=scontent-dfw5-1.xx&oh=00_AfCD1zWavbIBJtt2oX6rCZS8rw4ERnBtX-eKne8Q__Z8qQ&oe=6433BF7C",
164            "image_crops": {},
165            "body": " ",
166            "caption": "m.shein.co.uk",
167            "cta_type": "INSTALL_MOBILE_APP",
168            "cta_text": "Install Now",
169            "title": "Make A Difference",
170            "link_description": " ",
171            "link_url": "http://play.google.com/store/apps/details?id=com.zzkko"
172          },
173          {
174            "original_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/339110630_1224693641500600_1903506660817988699_n.jpg?_nc_cat=110&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=jwe3ks2kf64AX83rkFs&_nc_ht=scontent-dfw5-1.xx&oh=00_AfDwfamjO8_TFEYJ1aDB-1GF38akOJ-WEwFwCsEBOJw2Eg&oe=64340DB0",
175            "resized_image_url": "https://scontent-dfw5-2.xx.fbcdn.net/v/t39.35426-6/340087272_2408407416003995_8671815936920715800_n.jpg?stp=dst-jpg_s600x600&_nc_cat=106&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=aY9pCNC8LwIAX_jx_kp&_nc_ht=scontent-dfw5-2.xx&oh=00_AfAvr8Fd574sanAS-aPXz8PXo_TNEnFXgpUDPwdbzkpmsQ&oe=64339AF9",
176            "image_crops": {},
177            "body": " ",
178            "caption": "m.shein.co.uk",
179            "cta_type": "INSTALL_MOBILE_APP",
180            "cta_text": "Install Now",
181            "title": "Shop New Arrivals",
182            "link_description": " ",
183            "link_url": "http://play.google.com/store/apps/details?id=com.zzkko"
184          },
185          {
186            "original_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/339135641_783137396218248_6756980895657331924_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=K2wFcGVfClsAX9sLtZl&_nc_ht=scontent-dfw5-1.xx&oh=00_AfB6UIHUZnRPe9ezziilTttDpvaQ3gmAjANy34K7pHJiWw&oe=6433B68D",
187            "resized_image_url": "https://scontent-dfw5-2.xx.fbcdn.net/v/t39.35426-6/339994838_904640110847987_4448732498877358855_n.jpg?stp=dst-jpg_s600x600&_nc_cat=104&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=7Z11TUyV1UgAX-2knpe&_nc_ht=scontent-dfw5-2.xx&oh=00_AfCq82AClxL1wn6Uap922zDRZK59VKsuuCLlxmABf4jYKA&oe=6433C7E3",
188            "image_crops": {},
189            "body": " ",
190            "caption": "m.shein.co.uk",
191            "cta_type": "INSTALL_MOBILE_APP",
192            "cta_text": "Install Now",
193            "title": "View More",
194            "link_description": " ",
195            "link_url": "http://play.google.com/store/apps/details?id=com.zzkko"
196          },
197          {
198            "original_image_url": "https://scontent-dfw5-2.xx.fbcdn.net/v/t39.35426-6/339926963_714868850337086_3255916530856347542_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=jqWr9xYKyYQAX9HhrjK&_nc_ht=scontent-dfw5-2.xx&oh=00_AfAaXYxRcuCEA_z6Xdk0ba-29vM7j9uLikqI5uwepfqBFg&oe=64346260",
199            "resized_image_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/340124563_948685596155243_3341265228868994529_n.jpg?stp=dst-jpg_s600x600&_nc_cat=105&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=sXQ6MB1KK28AX-HN8no&_nc_ht=scontent-dfw5-1.xx&oh=00_AfBmUOvNT-ZOjIGg9SX2duqXXMB7sJ7lQgyn6K3IQDU-Eg&oe=6432EE3A",
200            "image_crops": {},
201            "body": " ",
202            "caption": "m.shein.co.uk",
203            "cta_type": "INSTALL_MOBILE_APP",
204            "cta_text": "Install Now",
205            "title": "Wait There's More",
206            "link_description": " ",
207            "link_url": "http://play.google.com/store/apps/details?id=com.zzkko"
208          }
209        ],
210        "body_translations": {},
211        "byline": null,
212        "caption": "play.google.com",
213        "cta_text": "Install now",
214        "dynamic_item_flags": {},
215        "dynamic_versions": null,
216        "edited_snapshots": [],
217        "effective_authorization_category": "NONE",
218        "event": [],
219        "extra_images": [],
220        "extra_links": [],
221        "extra_texts": [],
222        "extra_videos": [],
223        "instagram_shopping_products": [],
224        "display_format": "carousel",
225        "title": "New Fashion Experience",
226        "link_description": null,
227        "link_url": "http://play.google.com/store/apps/details?id=com.zzkko",
228        "page_welcome_message": null,
229        "images": [],
230        "videos": [],
231        "creation_time": 1680775116,
232        "page_id": 380039845369159,
233        "page_name": "SHEIN",
234        "page_profile_picture_url": "https://scontent-dfw5-2.xx.fbcdn.net/v/t39.35426-6/340029473_944543710307195_3023501245840356205_n.jpg?stp=dst-jpg_s60x60&_nc_cat=108&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=V8nD8UhK7IkAX-xOAL4&_nc_ht=scontent-dfw5-2.xx&oh=00_AfDCazll-RanJWkfoDfAp3-fNL1kHiVAIQx4MYmwIo9qGA&oe=6432EFBD",
235        "page_categories": {
236          "2209": "Clothing (Brand)"
237        },
238        "page_entity_type": "regular_page",
239        "page_is_profile_page": false,
240        "instagram_actor_name": "SHEIN.COM",
241        "instagram_profile_pic_url": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/340140663_137615865764776_3134383454797964740_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=cf96c8&_nc_ohc=frG_Ik-gtzkAX8dtble&_nc_ht=scontent-dfw5-1.xx&oh=00_AfA-7CpSUfWi7yg97PmaTQ3Kud0qc4f6u4GJu8mXxmLTBg&oe=6434094E",
242        "instagram_url": "",
243        "instagram_handle": "",
244        "is_reshared": false,
245        "version": 3,
246        "body": {
247          "context": {},
248          "markup": {
249            "__html": "Be Your Own Stylist!<br /> New Clothing Arrivals<br /> Create Your Own Style"
250          },
251          "callerHash": "91584ef3e37183a71399c913ead7a8c2"
252        },
253        "brazil_tax_id": null,
254        "branded_content": null,
255        "current_page_name": "SHEIN",
256        "disclaimer_label": null,
257        "page_like_count": 27827577,
258        "page_profile_uri": "https://www.facebook.com/SHEINOFFICIAL/",
259        "page_is_deleted": false,
260        "root_reshared_post": null,
261        "cta_type": "INSTALL_MOBILE_APP",
262        "additional_info": null,
263        "ec_certificates": null,
264        "country_iso_code": null,
265        "instagram_branded_content": null
266      },
267      "spend": null,
268      "startDate": 1680764400,
269      "stateMediaRunLabel": null,
270      "publisherPlatform": [
271        "facebook",
272        "instagram",
273        "audience_network",
274        "messenger"
275      ],
276      "menuItems": [],
277      "endDateFormatted": "2023-04-06T07:00:00.000Z",
278      "startDateFormatted": "2023-04-06T07:00:00.000Z"
279    },
280...

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 many results can you scrape with Facebook Ads Scraper?

Facebook Ads Scraper can return hundreds of results on average. However, you have to keep in mind that scraping facebook.com has many variables to it and may cause the results to fluctuate case by case. There’s no one-size-fits-all-use-cases number. The maximum number of results may vary depending on the complexity of the input, location, and other factors. Some of the most frequent cases are:

  • website gives a different number of results depending on the type/value of the input
  • website has an internal limit that no scraper can cross
  • scraper has a limit that we are working on improving

Therefore, while we regularly run Actor tests to keep the benchmarks in check, the results may also fluctuate without our knowing. The best way to know for sure for your particular use case is to do a test run yourself.

How much will scraping Facebook Ads cost you?

When it comes to scraping, it can be challenging to estimate the resources needed to extract data as use cases may vary significantly. That's why the best course of action is to run a test scrape with a small sample of input data and limited output. You’ll get your price per scrape, which you’ll then multiply by the number of scrapes you intend to do.

Watch this video for a few helpful tips. And don't forget that choosing a higher plan will save you money in the long run.

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 Search Scraper👍 Facebook Likes and Reactions Scraper
🚩 Facebook Pages Scraper🌟 Facebook Reviews Scraper
👥 Facebook Groups Scraper🏞 Facebook Photos Scraper
🗓 Facebook Events Scraper📝 Facebook Posts Scraper
💬 Facebook Comments Scraper📱 Facebook Pages Info Scraper
#️⃣ Facebook Hashtag Scraperℹ️ Facebook Page Posts Checker

Not your cup of tea? Build your own scraper

Facebook Ads Scraper doesn’t exactly do what you need? You can always build your own! We have various scraper templates in Python, JavaScript, and TypeScript to get you started. Alternatively, you can write it from scratch using our open-source library Crawlee. You can keep the scraper to yourself or make it public by adding it to Apify Store (and find users for it).

Or let us know if you need a custom scraping solution.

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, Asana, GitHub, Google Sheets, Google Drive, and more.

You can also 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.

Your feedback

We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for Facebook Ads Scraper or simply found a bug, please create an issue on the Actor’s Issues tab in Apify Console.

Developer
Maintained by Apify
Actor metrics
  • 340 monthly users
  • 99.4% runs succeeded
  • 2.6 days response time
  • Created in Apr 2023
  • Modified 3 days ago