Facebook ad library scraper avatar
Facebook ad library scraper
Try for free

3 days trial then $30.00/month - No credit card required now

View all Actors
Facebook ad library scraper

Facebook ad library scraper

curious_coder/facebook-ads-library-scraper
Try for free

3 days trial then $30.00/month - No credit card required now

Scrape facebook ads search and ads run by facebook pages - Fast and lightweight

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode

Node.js

Python

curl

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "action": "scrapeSearchResults",
11    "searchUrl": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=IN&q=linkedin&search_type=keyword_unordered&media_type=all",
12    "urls": [
13        "https://www.facebook.com/ZapierApp"
14    ],
15    "count": 30,
16    "proxy": {
17        "useApifyProxy": true,
18        "apifyProxyGroups": [
19            "RESIDENTIAL"
20        ],
21        "apifyProxyCountry": "US"
22    }
23};
24
25(async () => {
26    // Run the Actor and wait for it to finish
27    const run = await client.actor("curious_coder/facebook-ads-library-scraper").call(input);
28
29    // Fetch and print Actor results from the run's dataset (if any)
30    console.log('Results from dataset');
31    const { items } = await client.dataset(run.defaultDatasetId).listItems();
32    items.forEach((item) => {
33        console.dir(item);
34    });
35})();
Developer
Maintained by Community
Actor metrics
  • 147 monthly users
  • 93.0% runs succeeded
  • 13.7 days response time
  • Created in Aug 2023
  • Modified about 23 hours ago