# Facebook Ads Library & Creative Change Monitor (`solidscrape/facebook-ads-change-monitor`) Actor

Monitor Facebook and Instagram ad creative changes with stable IDs, before/after copy, variants and spend caps. Collection is a separately billed, capped Apify run; existing exports also work.

- **URL**: https://apify.com/solidscrape/facebook-ads-change-monitor.md
- **Developed by:** [SolidScrape](https://apify.com/solidscrape) (community)
- **Categories:** Social media, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 89.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 observed changes

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

## Facebook Ads Library & Creative Change Monitor

Compare ad copy, calls to action, landing URLs, active status and carousel/dynamic creative variants. Output each observed edit with before and after values. Rotating CDN signatures and the moving end date of an active ad do not create false creative edits.

Use it for a small recurring watchlist, agency reporting or an AI workflow that needs explainable changes instead of repeatedly receiving the same full export.

**Live collection is separately billed.** Collect and monitor starts [curious_coder/facebook-ads-library-scraper](https://apify.com/curious_coder/facebook-ads-library-scraper), pinned to tested build `2.7.28`, in your Apify account. This Actor adds normalization, comparison, portable snapshots, cost controls and clear partial-coverage reporting. Your combined ceiling reserves the entire collector cap before a child run is created. Existing exported rows or a specified accessible Apify dataset can be compared without starting a collector.

[Step-by-step tutorial and runnable monitoring client](https://solidscrape-monitoring-guides.techmuhafiz.chatgpt.site/facebook-ad-changes/)

### Quick start

```json
{
  "sourceMode": "collect",
  "targets": ["https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&view_all_page_id=15087023444&search_type=page&media_type=all"],
  "monitorKey": "my-watchlist",
  "maxItems": 10,
  "totalBudgetUsd": 0.05,
  "collectorMaxChargeUsd": 0.02
}
```

1. Run the example. Inspect the changes dataset and `SUMMARY`.
2. Download the complete `SNAPSHOT` record.
3. Run again with the same `monitorKey` and sources, putting that JSON into `previousSnapshot`.
4. Use `changed` rows for updates. An unchanged record produces no change-row fee. Save the new snapshot after every completed run.

An Apify schedule with fixed input compares against a fixed baseline. To compare consecutive runs, the supplied client or your integration must pass the last returned snapshot each time. No global state is shared between customers. Keep your own snapshots if you need them beyond your account’s data retention period.

### Pricing and caps

This monitoring Actor charges:

| Event | Price |
|---|---:|
| Run start, fixed 512 MB | $0.003 |
| One bounded batch, including unchanged or unsuccessful collection | $0.004 |
| Initial, first-seen or changed record emitted | $0.00075 |

The pinned collector currently lists $0.00075 per ad and $0.00005 per run at 512 MB. Ten delivered ads therefore add about **$0.00755** in separately billed collection charges. Ten initial monitoring rows cost **$0.01450**, making the combined example about **$0.02205**. The collector needs a 10-record minimum input, so live mode requires `maxItems >= 10` and at least a $0.01 collector cap.

`totalBudgetUsd` covers the parent Actor event budget **plus the reserved child collection cap**. `collectorMaxChargeUsd` is a separate cap passed to that child. The lower of the remaining parent budget and Apify’s parent run cap applies to this Actor. Apify’s Run options cap alone does not cap a separate child run. Unused collection reservation is not billed by this Actor; the source charges according to its own events. `SUMMARY` reports the parent modeled charges, child run ID, separate cap, events available at read time and combined reserved maximum. Source billing can settle later, so its final total is not fabricated.

We refuse collection if source pricing or permissions drift from the tested configuration. Both Actors run with limited permissions. Collection is limited to one child run, 512 MB, a 45-second child timeout and a fixed output cap. No automatic fallback starts a second provider, and no expensive source add-ons are enabled. A platform start fee can apply before invalid input is rejected. Failed collection can incur its start/partial-result charges and this Actor’s bounded batch fee.

### Import an existing export

```json
{
  "sourceMode": "rows",
  "monitorKey": "my-watchlist",
  "rows": [],
  "maxItems": 10,
  "totalBudgetUsd": 0.02
}
```

Replace the empty list with up to 100 records in the selected collector’s documented output shape. Empty input is an honest no-observations result. For an existing dataset, set `sourceMode` to `dataset` and `datasetId` to its 17-character ID. The input grants read access only to that dataset; if access is denied, use an exported list. Import sources are not independently verified for freshness or ownership. There is no new collector charge in either import mode.

### Output

Every change row includes `event`, exact `itemId`, source `url`, `label`, `observedAt`, `previousObservedAt`, `before`, `after`, `changes`, `metricDeltas` and source/run provenance.

| Event | Meaning |
|---|---|
| `initial` | First baseline observation |
| `first_seen` | This ID was not in the supplied baseline; not a claim that it was just published |
| `changed` | One or more normalized fields differ from the last observation |

`SUMMARY` distinguishes a bounded live sample, a complete supplied batch and a clipped import. `DIAGNOSTICS` keeps malformed, conflicting and error-only source records out of the customer dataset. `SNAPSHOT` retains prior records that were not observed this time. It acknowledges changed data only after the result was saved and charged. A budget-pending edit stays eligible for the next run. Snapshots are bounded to 1,000 records / 2 MB; capacity is reported instead of silently discarding old records.

A failed or missing source never becomes a deletion. If a source produces only errors, the Actor fails with diagnostics and preserves the baseline. A partial source with valid records is explicitly partial. Do not resurrect a half-finished run: its stored guard prevents duplicate child runs and duplicate result charges. Start a fresh run with the saved snapshot instead.

### Source coverage and limitations

Use advertiser-specific Ad Library URLs containing `view_all_page_id`, or public Facebook Page URLs. Keyword search URLs are rejected because they can mix unrelated advertisers. The raw collector can occasionally overshoot its requested count; this Actor reads at most `maxItems`, while the separate collector charge cap remains authoritative. Advertiser checks are sampled; missing ads are not labeled stopped. An explicit source `is_active=false` is an observed status change.

Creative media can be unavailable, restricted or represented by templates. Missing text/media has a status rather than fabricated content. `mediaLinks` contains expiring public links. `imageRefs` and `videoRefs` are normalized comparison references, not download links. Media links are not downloaded or followed. Spend, ROAS and revenue are not inferred, and long-running ads are not labeled winners.

Collection is provided by the linked independent/Apify source Actor; this monitor is not affiliated with Meta. Public data availability and platform rules can change. Use only data you are entitled to process. The Actor never asks for Instagram/Facebook passwords or session cookies.

### API example

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("solidscrape/facebook-ads-change-monitor").call(
    run_input={"targets": ["https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&view_all_page_id=15087023444&search_type=page&media_type=all"], "maxItems": 10,
               "totalBudgetUsd": 0.05, "collectorMaxChargeUsd": 0.02},
    max_total_charge_usd=0.05,
)
if run["status"] != "SUCCEEDED":
    raise RuntimeError("Read SUMMARY and DIAGNOSTICS before retrying")
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["event"], row["itemId"], row["changes"])
snapshot = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("SNAPSHOT")["value"]
```

The same JSON input works through Apify’s REST API and MCP tools. n8n or Make can run the Actor, read `SUMMARY`, store `SNAPSHOT` and route `changed` records to your existing workflow. Failures and `partial` summaries require explicit handling rather than replacing your entire source dataset.

# Actor input Schema

## `sourceMode` (type: `string`):

Collect starts the named fixed collector in your Apify account and bills its bounded run separately. Pasted records and datasets do not start a collector.

## `targets` (type: `array`):

Collect mode only. Up to 5 public Meta Ad Library or Facebook Page URLs.

## `monitorKey` (type: `string`):

Use the same name and source list for a continuing watchlist. The previous snapshot must use this name.

## `maxItems` (type: `integer`):

Read and compare no more than this many rows across sources. Live Facebook collection requires at least 10. Collection can be partial. Missing records are never treated as deleted.

## `totalBudgetUsd` (type: `number`):

Combined ceiling for this monitoring run plus its separately billed collection run. Parent starts at $0.003, batch $0.004, each emitted change $0.00075. The full collector cap is reserved before collection. The Apify run spending cap applies only to this parent Actor.

## `collectorMaxChargeUsd` (type: `number`):

Collect mode only. This amount is reserved inside Total spending ceiling and passed as the collector run cap. Unused reserved collection budget is not billed by this Actor. Collector curious_coder/facebook-ads-library-scraper build 2.7.28. No expensive add-ons are enabled.

## `rows` (type: `array`):

Rows mode only. Paste up to 100 records from the documented collector output format. Error-only rows do not count as observations. No fetching occurs.

## `datasetId` (type: `string`):

Dataset mode only. Grants read access to this specific 17-character dataset ID. If access is denied, export records and use pasted records mode. This Actor does not request broader account permissions.

## `previousSnapshot` (type: `object`):

Paste the full SNAPSHOT record from your prior run (up to 2 MiB, 1,000 retained records). Missing or failed inputs preserve their last observations. A fixed scheduled input is a fixed baseline; update it to compare consecutive runs.

## Actor input object example

```json
{
  "sourceMode": "collect",
  "targets": [
    "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&view_all_page_id=15087023444&search_type=page&media_type=all"
  ],
  "monitorKey": "default",
  "maxItems": 10,
  "totalBudgetUsd": 0.05,
  "collectorMaxChargeUsd": 0.02
}
```

# Actor output Schema

## `changes` (type: `string`):

No description

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

No description

## `snapshot` (type: `string`):

No description

## `diagnostics` (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 = {
    "targets": [
        "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&view_all_page_id=15087023444&search_type=page&media_type=all"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidscrape/facebook-ads-change-monitor").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 = { "targets": ["https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&view_all_page_id=15087023444&search_type=page&media_type=all"] }

# Run the Actor and wait for it to finish
run = client.actor("solidscrape/facebook-ads-change-monitor").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 '{
  "targets": [
    "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&view_all_page_id=15087023444&search_type=page&media_type=all"
  ]
}' |
apify call solidscrape/facebook-ads-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,solidscrape/facebook-ads-change-monitor"
        }
    }
}
```

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/UjLwTKTX3pKGnr5Hc/builds/kpEKJuUeYBY193r20/openapi.json
