# Meta Ads Count (`mrdoe/meta-ads-count`) Actor

Check how many active ads any Facebook Page is running in the Meta Ad Library, right now. No login needed - handles the tricky Page ID lookup for you.

- **URL**: https://apify.com/mrdoe/meta-ads-count.md
- **Developed by:** [MrDoe](https://apify.com/mrdoe) (community)
- **Categories:** Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 89.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Count Checker — see how many active ads any Facebook Page is running](./assets/hero.png)

### What does Meta Ad Library Count Checker do?

Meta Ad Library Count Checker takes a Facebook Page — by URL, username, or ID — resolves
its real advertising identity, and returns the approximate number of active ads that Page is
currently running. Give it one Page or a whole list of them to quickly see which businesses
are actively advertising on Meta right now, useful for sales prospecting, competitor
research, and qualifying leads before outreach.

### Why use Meta Ad Library Count Checker?

- **Works for any Page format** — a plain username, a full Page URL, or a numeric profile link all work the same way.
- **Handles the tricky part for you** — many modern Pages show a different ID in their own URL than the one needed to look up their ads; this Actor resolves the correct one automatically.
- **Clean, consistent output** — one record per Page, ready for a spreadsheet or CRM.
- **Batch-friendly** — check a whole list of Pages in one run.
- **Built-in retries** — temporary hiccups are retried automatically rather than silently dropped.

### What makes this different

Resolving a Page's true advertising ID reliably — especially for newer-style Pages where the
URL's own ID is not the one that works — is the part that trips up simpler tools. This Actor
handles that resolution step automatically so you can pass in whatever Page link you already
have and get a trustworthy answer.

### How it works

![How Meta Ad Library Count Checker collects active ad counts](./assets/how-it-works.png)

1. **Your input** — a Facebook Page URL, username, or a list of them.
2. **The Actor collects it** — it resolves the Page's real advertising ID, checks its current
   ad activity, and works fully logged out with automatic retries.
3. **Your output** — one structured record per Page: its resolved ID, name, and approximate
   active ad count.

### What data can you extract?

| Field | Description |
|---|---|
| `pageId` | The Page's resolved advertising ID |
| `pageName` | The Page's display name |
| `activeAds` | Approximate active ad count (e.g. `"1,500"`, `"0"`) |
| `activeAdsRaw` | The count as shown, including the approximation mark (e.g. `"~1,500 results"`) |
| `status` | `ok`, `no_ads`, `page_id_not_found`, or `error` |
| `adLibraryUrl` | A link to view this result publicly |
| `checkedAt` | When the check was made (ISO timestamp) |

### How to use Meta Ad Library Count Checker

1. Open the Actor and go to the **Input** tab.
2. Enter one or more Facebook Pages in **Facebook pages** — a username, a full URL, or both mixed (see the screenshot below).
3. Optionally set a **Country** and **Max concurrency**.
4. Click **Start**.
5. Open the **Dataset** tab, or pull results via the API, once the run finishes.

![Meta Ad Library Count Checker input form with example pages](./assets/input.png)

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `pages` | Array of strings or objects | Yes | `["ridge"]` | Page usernames, URLs, or `{url, pageId}` objects to skip re-resolving an ID you already have |
| `country` | String | No | `"ALL"` | Country filter for the ad count |
| `maxConcurrency` | Integer | No | `5` | How many Pages to check in parallel |
| `useBrowserFallback` | Boolean | No | `true` | Keep this on — it's required for the ad-count step to run at all |
| `proxyConfiguration` | Object | No | Apify Proxy (Residential) | Advanced — leave as default unless you have a reason to change it |

### Output Data

Each Page produces one dataset record. Example:

```json
{
    "inputUrl": "ridge",
    "pageId": "176366735873065",
    "pageName": "The Ridge",
    "activeAds": "1,500",
    "activeAdsRaw": "~1,500 results",
    "method": "browser",
    "status": "ok",
    "error": null,
    "adLibraryUrl": "https://www.facebook.com/ads/library/?view_all_page_id=176366735873065",
    "checkedAt": "2026-10-08T12:00:00.000Z"
}
```

![Sample dataset table from Meta Ad Library Count Checker](./assets/output.png)
![Every output field labelled on one example record](./assets/fields.png)

### Usage Examples

- **Single lookup** — `pages: ["ridge"]` to check one Page by username.
- **Prospecting list** — pass a list of Page URLs from a lead list to flag which businesses
  are actively running ads before your sales team reaches out.
- **Reusing a known ID** — pass `{"url": "ridge", "pageId": "176366735873065"}` once you have
  it cached, to skip the resolution step on later runs.
- **Mixed input** — usernames, full URLs, and profile-link formats can all be in the same list.

### Tips for Best Results

- If you already know a Page's resolved ID from a previous run, pass it in via the
  `{url, pageId}` object form — it's faster and skips a step.
- `status: "no_ads"` is a real answer (the Page isn't currently advertising), not a failure.
- `status: "page_id_not_found"` means the Page couldn't be resolved while logged out — some
  Pages (age-restricted or region-limited categories) aren't visible this way at all. This is
  never reported as `"0"` ads, since that would be a different, false answer.

### Known Limitations

- The count is **approximate**, exactly as the Ad Library itself presents it.
- Some Pages (age-restricted categories, certain regional restrictions) can't be viewed
  while logged out and will come back as `page_id_not_found` rather than a count.
- This reflects a snapshot at the time of the check; ad activity changes day to day.
- The ad-count step needs `useBrowserFallback` left on — it is not an optional fallback for
  this particular check.

### Integrations

Connect Meta Ad Library Count Checker to the rest of your stack via the
[Apify API](https://docs.apify.com/api/v2), [webhooks](https://docs.apify.com/platform/integrations/webhooks),
scheduled runs, or directly to Google Sheets, Make, and Zapier through Apify's built-in integrations.

### Export Formats

Download results as **JSON, CSV, Excel, or XML** from the Dataset tab, or fetch them
programmatically via the Apify API.

### Frequently Asked Questions

#### How many Pages can I check in one run?

There's no fixed cap — pass as many as you like in `pages`. Larger batches take longer;
`maxConcurrency` controls how many run in parallel.

#### Do I need a Facebook account or to log in?

No. Every lookup works fully logged out.

#### What's the difference between a Page's URL and its advertising ID?

Many modern Pages display one ID in their own URL, but the Ad Library uses a different,
underlying ID for that same Page. This Actor resolves the correct one for you automatically
— you never need to find it yourself.

#### Why did I get `page_id_not_found` instead of a count?

That Page couldn't be viewed while logged out at all (commonly age-restricted categories or
regional limits) — it's a different situation from "zero ads" and is reported separately so
you don't mistake one for the other.

#### Can I reuse a Page ID I already looked up?

Yes — pass it back in as `{"url": "...", "pageId": "..."}` and the resolution step is skipped
entirely on that run.

#### Can I schedule this to run automatically?

Yes, use Apify's built-in [Scheduler](https://docs.apify.com/platform/schedules) to re-check
the same Pages daily, weekly, or on any interval you choose.

#### Am I charged for failed lookups?

No — you're only charged for a lookup that returns a real result (an ad count, or a
confirmed zero).

### Support

Found an issue or have a request? Open it on the Actor's **Issues** tab in the Apify Console.

### Legal / Responsible Use

You're responsible for using this Actor in compliance with applicable laws and the target
platform's terms of service. This Actor retrieves publicly available ad-count information
only; it does not collect personal data.

# Actor input Schema

## `pages` (type: `array`):

Facebook page URLs (e.g. "https://www.facebook.com/ridge", a bare slug "ridge", or "profile.php?id=..."). To skip page-ID resolution for a page you've already cached the ID for, use the object form {"url": "...", "pageId": "176366735873065"} in Input JSON / API mode.

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

Ad Library country filter, e.g. "ALL" or a 2-letter country code.

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

How many pages to resolve/check in parallel. The ad-count step opens one browser session per concurrent slot, so keep this modest.

## `useBrowserFallback` (type: `boolean`):

The Ad Library's active-ad count has no plain-HTTP path at all (Facebook requires a real browser there) — leave this on unless you only need page-ID resolution.

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

The Ad Library step needs a residential proxy; page-ID resolution works on any proxy tier.

## Actor input object example

```json
{
  "pages": [
    "ridge"
  ],
  "country": "ALL",
  "maxConcurrency": 5,
  "useBrowserFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "pages": [
        "ridge"
    ],
    "country": "ALL"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrdoe/meta-ads-count").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 = {
    "pages": ["ridge"],
    "country": "ALL",
}

# Run the Actor and wait for it to finish
run = client.actor("mrdoe/meta-ads-count").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 '{
  "pages": [
    "ridge"
  ],
  "country": "ALL"
}' |
apify call mrdoe/meta-ads-count --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mrdoe/meta-ads-count"
        }
    }
}
```

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/SpBKY7KRAu6DXwiH4/builds/bYWdLC21IlAyd2ynM/openapi.json
