# Meta Ad Library Active Ad Counter (`kingly_contest_7cb/meta-ad-library-active-ad-counter`) Actor

Paste a list of brands, domains or Facebook pages and get one row each: matched page, active ad count, newest ad date, platforms and a qualifies flag. Built for agencies and sales teams sorting prospect lists by who is spending on Meta. No login.

- **URL**: https://apify.com/kingly_contest_7cb/meta-ad-library-active-ad-counter.md
- **Developed by:** [Carina Hatton](https://apify.com/kingly_contest_7cb) (community)
- **Categories:** Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 brand checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Meta Ad Library Active Ad Counter

Paste a list of brands and find out which ones are actually spending on Meta. For every brand name, website domain or Facebook page URL you get one row: the Facebook page it matched, how many ads it's running right now on Facebook, Instagram, Messenger, Audience Network, Threads and WhatsApp, when its newest ad started, and a `qualifies` flag you set the bar for.

The count is the same number Meta's public [Ad Library](https://www.facebook.com/ads/library/) shows for that page. No Facebook login, no cookies, no Meta developer token.

### Who it's for

- **Agencies qualifying leads.** A brand running 4 ads and a brand running 400 are very different sales calls. Set `minActiveAds` to your cutoff and filter on `qualifies`.
- **Competitor checks.** See how hard each rival is pushing on Meta this week, and whether they launched anything new in the last few days.
- **Market maps.** Run a whole category list and sort by active ads to see who is buying the most attention.
- **Cleaning prospect lists.** Pages with zero active ads come back as `activeAdCount: 0` with a note, so you can drop them before anyone writes a cold email.

This is a counter, not a creative analysis tool. It won't download ads or grade how tired a brand's creative is. It answers the question that comes before all of that, fast and in bulk: is this brand advertising on Meta right now, and how much? If you need the ads themselves (copy, images, videos), use an Ad Library scraper.

### Quick start

1. Add your brands, one per line. Mix and match:
   - a brand name: `Gymshark`
   - a domain: `skims.com`
   - a Facebook page URL: `https://www.facebook.com/nike`
   - a numeric page ID: `15087023444`
2. Leave **Country** on `ALL`, or pick one (for example `US`) to count only ads shown there.
3. Set **Minimum active ads to qualify** (default 25).
4. Run it. The three-brand example below finished in about 7 seconds of run time in our test.

```json
{
    "brands": ["Gymshark", "skims.com", "https://www.facebook.com/nike"],
    "country": "ALL",
    "minActiveAds": 25
}
```

### What you get

One dataset row per input line. Rows are saved as each brand finishes, so the order can differ from your list; `input` tells you which line each row belongs to.

```json
{
    "input": "skims.com",
    "inputType": "domain",
    "status": "ok",
    "pageName": "SKIMS",
    "pageId": "2054164264892387",
    "pageUrl": "https://www.facebook.com/SKIMSbody",
    "pageCategory": "Clothing (Brand)",
    "pageVerification": "BLUE_VERIFIED",
    "instagramUsername": "skims",
    "matchMethod": "domain_in_ads",
    "matchConfidence": "high",
    "activeAdCount": 1053,
    "qualifies": true,
    "minActiveAds": 25,
    "country": "ALL",
    "newestAdStartDate": "2026-11-13",
    "oldestAdStartDate": null,
    "oldestAdStartDateInSample": "2026-05-01",
    "datesScope": "newest_exact_oldest_sampled",
    "adsSampled": 40,
    "platforms": ["Facebook", "Instagram", "Audience Network", "Threads", "Messenger", "WhatsApp"],
    "platformAdsInSample": { "Facebook": 40, "Instagram": 40, "Audience Network": 28, "Threads": 15, "Messenger": 10, "WhatsApp": 3 },
    "countries": ["GB", "US"],
    "activeAdsByCountry": { "US": 184, "GB": 136 },
    "domainSeenInAds": true,
    "adLibraryUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&is_targeted_country=false&media_type=all&search_type=page&view_all_page_id=2054164264892387",
    "otherCandidates": [{ "pageName": "SkimSafe", "pageId": "290593874641827", "likes": 7208, "verification": "BLUE_VERIFIED" }]
}
```

(Output from a test run on 16 Nov 2026 with `countryBreakdown: ["US", "GB"]`. Counts change daily.)

| Field | What it means |
|---|---|
| `status` | `ok` (counted), `no_match` (no Facebook page found for the input) or `error` (Meta blocked the lookup after retries). Every row explains itself in `statusReason`. |
| `activeAdCount` | Active ads for the page in the chosen country, as the Ad Library reports it. `0` means the page exists but isn't running ads. |
| `qualifies` | `activeAdCount >= minActiveAds` |
| `matchMethod` / `matchConfidence` | How the page was picked. `domain_in_ads` means the page's own ads link to your domain. `exact_name`, `facebook_handle` and `page_id` are strong. `name_prefix` is marked `medium`, so give those a glance. |
| `newestAdStartDate` | Start date of the most recently launched active ad, read from Meta's newest-first sort. If Meta rate-limits that one call, the count is still returned and this date comes from the first ads sample (`datesScope: sampled`). |
| `oldestAdStartDate` | Start date of the longest-running active ad. Filled only when the Actor read every active ad (`datesScope: all_active_ads`), which happens for pages with up to `fullScanMaxAds` ads (default 100). |
| `oldestAdStartDateInSample` | Oldest start date among the ads the Actor read. For big advertisers this is a sample, not the true oldest. |
| `platforms` | Placements seen in the sampled ads, most common first. `platformAdsInSample` has the counts. |
| `countries` | Countries with active ads, from `countryBreakdown` and from any EU reach data Meta publishes. Meta doesn't list target countries for most non-EU ads, so leave `countryBreakdown` on if you need this. |
| `activeAdsByCountry` | One count per country in `countryBreakdown`. |
| `otherCandidates` | The next best page matches, so you can rerun with a page ID if the pick was wrong. |

A `RUN_SUMMARY` record in the key-value store has totals: brands checked, matches, no matches, errors and how many qualify.

### How matching works

- **Facebook URL or page ID:** used directly. Handle URLs like `facebook.com/SKIMSbody` are resolved through the Ad Library page search, then the page itself if needed.
- **Domain:** the Actor searches for the brand name in the domain, then checks which candidate page's ads actually link to that domain.
- **Brand name:** the Ad Library page search, ranked by exact name, Instagram handle, verification badge and audience size. Coupon and fan pages are pushed down.
- **Zero-ad safety net:** brands often have duplicate or regional pages. When the best match has no active ads, the Actor checks the other close matches and the pages running ads for that name before it reports 0.

### Limits you should know

- **The count is Meta's number.** The Ad Library shows "~N results" and this Actor returns that N. Meta counts each ad version separately and its own number can move a little between two lookups a few seconds apart (we saw 874 and 875 for the same page in one run).
- **One page per brand.** Big brands run ads from several pages (Nike Football, Nike Basketball and so on). You get the best-matching main page and the runners-up in `otherCandidates`. Add the extra pages as separate lines if you want them counted.
- **Oldest start date for big advertisers is a sample.** Meta only sorts newest first, so finding the true oldest ad means reading every active ad. Raise `fullScanMaxAds` (max 500) if you need exact dates for bigger pages. It takes longer.
- **Name matching isn't magic.** Short or generic names ("AG1", "Away") can match the wrong page. Use a domain or the Facebook URL for those, and check rows marked `medium` or `low`.
- **Meta rate-limits.** The Actor uses residential proxies, rotates IPs and retries. A brand that still fails comes back as `status: error` and isn't charged.

### Pricing

Pay per event. Compute and proxy are included.

- **Run start:** each run has one small start event (Apify's standard Actor start charge, one per GB of memory; the default 256 MB counts as one).
- **Each brand counted** (`status: ok`, including pages with 0 active ads) is one `brand-checked` event.
- **Each extra country** in `countryBreakdown` is one `country-count` event.
- **No match and error rows are free.**

Current prices are on the Pricing tab. Paid Apify plans get a lower per-brand price. Set a maximum cost per run in the run options and the Actor stops cleanly when it gets there.

### FAQ

**Do I need a Facebook account or a Meta API token?**
No. The Actor reads the public Ad Library the same way a logged-out visitor does.

**Why does a famous brand show 0 active ads?**
Either it isn't running ads from that page right now, or its ads run from a different page. Check `otherCandidates`, or rerun with the page URL you know they advertise from.

**Can I get spend or impressions?**
Meta publishes spend and impressions only for political and issue ads, and reach only for ads shown in the EU. This Actor doesn't report spend.

**What happens if Meta blocks everything?**
If every brand in a run fails, the run is marked failed with the reason instead of finishing as an empty success. Nothing is charged for failed rows.

**Can I schedule it?**
Yes. Schedule it weekly on your lead list and compare `activeAdCount` and `newestAdStartDate` between runs to see who's ramping up.

### Is it legal?

This is an independent tool. It isn't affiliated with, endorsed by or sponsored by Meta. It reads only Meta's public Ad Library, which Meta publishes so anyone can see who is advertising. It doesn't log in and collects no personal data beyond the page details advertisers publish. Check your local laws and Meta's terms for your use case.

# Actor input Schema

## `brands` (type: `array`):

One per line. Mix brand names (Gymshark), website domains (skims.com), Facebook page URLs (https://www.facebook.com/nike) or numeric Facebook page IDs. You get one result row per line.

## `country` (type: `string`):

Count ads shown in this country. ALL counts every country, the same as the Ad Library default. Use a 2-letter code such as US, GB, CA or AU.

## `minActiveAds` (type: `integer`):

Rows with at least this many active ads get qualifies = true. Handy for filtering a lead list down to brands that spend real money on Meta.

## `countryBreakdown` (type: `array`):

Also count active ads in each of these countries (2-letter codes, e.g. US, GB, CA, AU). Each country is one extra Ad Library lookup and is billed as a separate country-count event. Leave empty to skip.

## `fullScanMaxAds` (type: `integer`):

For pages with this many active ads or fewer, the Actor reads every active ad so the oldest start date is exact. Bigger pages get the exact newest date and the oldest date from a sample (see datesScope). Max 500.

## `maxBrands` (type: `integer`):

Safety cap on how many lines are checked in one run.

## `maxConcurrency` (type: `integer`):

How many brands are checked at the same time (1 to 5).

## `proxyConfiguration` (type: `object`):

Meta blocks most datacenter IPs, so residential proxies are the default.

## Actor input object example

```json
{
  "brands": [
    "Gymshark",
    "skims.com",
    "https://www.facebook.com/nike"
  ],
  "country": "ALL",
  "minActiveAds": 25,
  "countryBreakdown": [],
  "fullScanMaxAds": 100,
  "maxBrands": 1000,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "brands": [
        "Gymshark",
        "skims.com",
        "https://www.facebook.com/nike"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kingly_contest_7cb/meta-ad-library-active-ad-counter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "brands": [
        "Gymshark",
        "skims.com",
        "https://www.facebook.com/nike",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("kingly_contest_7cb/meta-ad-library-active-ad-counter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "brands": [
    "Gymshark",
    "skims.com",
    "https://www.facebook.com/nike"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call kingly_contest_7cb/meta-ad-library-active-ad-counter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kingly_contest_7cb/meta-ad-library-active-ad-counter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LRkdin2SzFmHi5DTv/builds/Ro6RfAJ1HhCnQHFYN/openapi.json
