Webinar: How to Improve Outlook Deliverability and Always Land in the Inbox Register

Facebook Ads Scraper: Check if a company is running facebook Ads

If you’ve ever wondered if a company is running Facebook Ads, this step-by-step guide shows you exactly how to find out using Clay.
Knowing whether a competitor or potential client is actively running ads gives you an immediate signal on marketing intent. Depending on your offer, this could also be your biggest filter in deciding whether or not to reach out to these companies.

Use Cases:

Marketing Consulting Companies:

  • SEO Agencies: Reach out to prospects mentioning the high CPC and ROI of Organic Ads.
  • PPC Companies: Reach out to prospects about creative ideas and mention you noticed they are running ads.
  • Digital Marketing Agencies: Another intent signal to use in your campaigns.

 

Marketing Consulting Companies:

  • Marketing Attribution Companies: Only target companies running Meta Ads.

 

What You’ll Need

  • A Clay account (or automation tool)
  • A RapidAPI account.
  • Two API subscriptions (both have free tiers.
    • Facebook Pages Scraper
    • Ad Libraries RealTimeAPI

 

The Two-Step Process (High Level)

This workflow uses two API calls inside Clay:

  1. Convert a Facebook Page URL into a Facebook Page ID
  2. Use that Page ID to fetch the number of active ads

Once set up, Clay handles everything automatically.

Step 1: Open the Clay Template Table and Understand the Key Columns

Before running anything, it’s important to understand what each column does:

  • Facebook URL
    The Facebook Page URL for each company. This is the main input.
  • Get Ad Page ID
    An HTTP API call that takes the Facebook Page URL and returns a Page ID.
  • Ad Page Id
    A plain text column that stores the Page ID returned from the API.
  • Get Ad Count
    An HTTP API call that takes the Page ID and queries Meta’s Ad Library.
  • Ad Count
    A number or text column that stores the final ad count.

 

Step 2: Import Your Dataset Into Clay

You have two options here.

Option A (Fastest): You Already Have Facebook Page URLs

If your CSV, Excel, Airtable, or Google Sheet already includes Facebook Page URLs:

  1. Import the file into Clay
  2. Map the Facebook URL column directly

This skips any scraping or enrichment steps. The workflow can run immediately.

Option B: You Don’t Have Facebook Page URLs Yet

If Facebook URLs are missing:

  1. Upload your company list to Apollo (You can upload 5K Companies in the free Tier weekly) – Create multiple accounts if needed.
  2. Download the list, and it will be enriched with Facebook URLs.
  3. Use Claygent as a backup to get more data if needed.

Pro tip:

Before running any APIs, sanity-check the URLs.

  • Good: facebook.com/companyname
  • Avoid: post URLs, group links, or shared links
    These often break API calls and waste credits.

 

Step 3: Add Your RapidAPI Credentials in Clay

Open the Get Ad Page ID column and edit its settings.

Inside the request headers:

  • Add your RapidAPI key
  • Add the host value for Facebook Pages Scraper

You can find both values directly in the RapidAPI documentation for the Facebook Pages Scraper. The headers are shown in the example code snippets.

If you’re unsure where something goes, copying the RapidAPI docs into GPT and asking it to map the fields into Clay is a reliable shortcut.

Here is the RapidAPI Scraper Link: RAPIDAPI SCRAPER

Step 4: Configure “Get Ad Page ID”

Still inside Get Ad Page ID, confirm the following:

  • The endpoint matches the Facebook Pages Scraper API
  • The Facebook URL input is mapped from Final – Facebook
  • You test the request on a few rows first

A successful request should return a JSON response with a status code of 200.

Step 5: Store the Page ID in “Ad Page Id”

The API returns a full JSON response, so you’ll need to extract the Page ID:

  1. Open a successful response
  2. Locate the Page ID field
  3. Turn that value into a column
  4. Store it in Ad Page Id

This column becomes the input for the next API call.

Step 6: Configure “Get Ad Count”

Open the Get Ad Count column and set it up as follows:

  • Input: Map from Ad Page Id
  • Endpoint: Ad Libraries RealTimeAPI endpoint
  • Headers:
    • RapidAPI key
    • Host value for Ad Libraries RealTimeAPI
  • Add any optional filters you want, such as:
    • Country
    • Language
    • Date range

 

Make sure the endpoint includes /ads and that the Page ID is dynamically inserted.

Here is the link to Rapid API Scraper: LINK

Step 7: Set the Response Value to Return (Important)

This step is critical.

Inside the Get Ad Count column:

  1. Scroll to Response value to return
  2. Enter: Data.ad_library_main.search_results_connection.count

This tells Clay to return only the ad count instead of the entire response payload, which is usually too large.

If you want to see the payload, ads count is available here : Data -> Ad Library Main -> Search Results Connection -> Count

Step 8: Run the Table

Once configured:

  • Run the table
  • Clay will output the ad count directly
  • Turn the returned value into a standalone Ad Count column

 

Step 9: Interpret the Results

  • Ad Count = 0
    The company is not running ads
  • Ad Count > 0
    The company is actively running Facebook ads
  • Blank or error
    Something failed upstream, usually:
    • Missing or invalid Facebook URL
    • Incorrect API headers
    • Wrong response path

 

Final Notes

This setup gives you a clean, repeatable signal for identifying companies actively spending on Facebook ads. Once configured, it scales easily across hundreds or thousands of rows with minimal manual work.

Follow the template exactly, test on small batches first, and you’ll have a reliable “running ads or not” indicator inside Clay.

Ready-to-download Clay
Templates.

How to Get Your Instantly API Key

Step 1 : Log in to Your Instantly Account

Go to https://app.instantly.ai/auth/login and log in to your account

Step 2 : Navigate to Settings

Click on your profile icon in the bottom-left corner, then select “Settings” from the dropdown menu.

Step 3 : Select Integration

In the Integrations page, click on the “API Keys” tab in the left sidebar.

Step 4 : Get Your API Key with all:read Scope

If you already have an API key with the all:read scope, you can use that key.


If not, click the “Create API Key” button, select the all:read scope, and make sure to save your new API key somewhere safe.

How to Get Your Smart Lead API Key

Step 1 : Log in to Your Smart Lead Account

Go to https://app.smartlead.ai/login account and log in to your account

Step 2 : Navigate to Settings

Click on the “Settings” option in the top right corner profile icon.

Step 3 : Select API Integration

In the Settings page, under your profile picture, you can see the SmartLead API Key.

Step 4 : Generate Your API Key

If you already have an API key displayed, you can use that key. If not, click the “Generate API Key” button to create a new one.