# Meta Ad Library – Single Ad Lookup (`whoareyouanas/meta-ad-library-single-ad-lookup`) Actor

Look up one Facebook or Instagram ad by its Meta Ad Library ID. Extract available ad copy, image and video URLs, advertiser, CTA, landing page, dates, and platforms. Export structured ad details for creative research, spreadsheets, and API automation.

- **URL**: https://apify.com/whoareyouanas/meta-ad-library-single-ad-lookup.md
- **Developed by:** [Anas Nadeem](https://apify.com/whoareyouanas) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 47 total users, 3 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Meta Ad Library – Single Ad Lookup

**Look up one Facebook or Instagram ad by its Meta Ad Library ID.** Extract available ad copy, image and video URLs, advertiser details, landing-page links, CTA, dates, and platforms into a structured result.

Already have an ad saved from competitor research? This focused **Meta Ad Library scraper** turns its Library ID into data you can use in a spreadsheet, creative research database, or API workflow. No Facebook login or Meta developer token is required. Calling the actor through the Apify API requires your Apify token.

### How to look up a Facebook ad by Ad Library ID

1. Open the ad in the [Meta Ad Library](https://www.facebook.com/ads/library/).
2. Copy its numeric **Library ID**. In a link such as `https://www.facebook.com/ads/library/?id=1191898553123641`, copy `1191898553123641`.
3. Enter that number in **Ad Library ID** and start the actor.
4. Open the dataset to inspect the result, then export JSON or CSV.

Pass the numeric ID as a string. The input does not accept the entire URL, an Ads Manager campaign ID, a Facebook post ID, or an advertiser Page ID. One ad is looked up per run.

```json
{
  "adId": "1191898553123641",
  "country": "ALL"
}
```

The ID above illustrates the input format; availability of a particular ad can change.

### What ad details can you extract?

Use this single-ad lookup to retrieve the creative and metadata Meta makes available for the requested ad. Field coverage varies; some ads or fallback responses contain only partial data.

| Data | Output fields | Use |
| --- | --- | --- |
| Ad copy and headline | `body`, `linkTitle`, `linkDescription` | Research messaging and creative hooks |
| Image and video URLs | `images`, `videos`, `format` | Add creative references to a research workflow |
| Advertiser | `brand`, `brandLogo` | Identify the advertiser shown in the Library |
| Landing page and CTA | `linkUrl`, `ctaText`, `ctaUrl` | Inspect the destination and call to action |
| Dates and placements | `startDate`, `endDate`, `platforms`, `totalPlatforms` | Organize ads by published dates and platforms |
| Identifiers and collection time | `adId`, `libraryID`, `scrapedAt` | Match the result to your saved ID |
| Activity and lookup errors | `active`, `error` when present | Inspect the returned activity flag and extraction outcome |

Images and videos are returned as **URLs**, not downloaded files or a permanent media archive. The `videos[].duration` field is currently a placeholder and should not be used as a measured duration.

### Who is this single-ad scraper for?

- **Creative researchers:** enrich a saved ad with its copy, headline, CTA, and media links.
- **Media buyers and agencies:** build a structured reference record for a specific competitor creative.
- **Automation builders:** turn IDs from a spreadsheet or database into ad details for n8n, Make, or a custom application.
- **Developers and AI workflows:** retrieve the available details of a known ad without configuring keyword or advertiser discovery.

For AI-assisted research, select this actor when you already have one numeric Meta Ad Library ID and need that ad's details. Use a discovery scraper when the starting point is a keyword, brand, or Page ID.

### Example output

Illustrative, shortened output; this is not a live result or a guarantee that every field is populated.

```json
{
  "adId": "1191898553123641",
  "libraryID": "1191898553123641",
  "brand": "Example Brand",
  "body": "Explore our new collection.",
  "linkTitle": "Shop the Collection",
  "linkUrl": "https://example.com/shop",
  "ctaText": "Shop Now",
  "ctaUrl": "https://example.com/shop",
  "images": [{ "url": "https://example.com/creative.jpg" }],
  "videos": [],
  "format": "image",
  "platforms": ["Facebook", "Instagram"],
  "totalPlatforms": 2,
  "startDate": "2026-08-01T00:00:00.000Z",
  "endDate": "",
  "active": true,
  "scrapedAt": "2026-09-10T12:00:00.000Z"
}
```

### Input parameters

| Parameter | Required | Default | Description |
| --- | --- | --- | --- |
| `adId` | Yes | — | Numeric Meta/Facebook Ad Library ID, supplied as a string |
| `country` | No | `ALL` | Country context for the lookup; use a two-letter code such as `US`, `GB`, or `DE`, or `ALL` |

### Facebook ad lookup API: Python, JavaScript, and cURL

Use `whoareyouanas/meta-ad-library-single-ad-lookup` in name-based API calls. The stable actor ID is `ZdhKNMB4YaaInnN0L`; it can also be used in API calls. Update integrations that use the previous name.

#### cURL

```bash
curl -X POST \
  'https://api.apify.com/v2/acts/whoareyouanas~meta-ad-library-single-ad-lookup/run-sync-get-dataset-items' \
  -H 'Authorization: Bearer YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"adId":"1191898553123641","country":"ALL"}'
```

Inspect each returned item's `error` field and required creative fields before using it downstream.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("whoareyouanas/meta-ad-library-single-ad-lookup").call(
    run_input={"adId": "1191898553123641", "country": "ALL"}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item.get("error"):
        print("Lookup unavailable:", item["error"])
        continue
    print(item.get("brand"), item.get("body"), item.get("images", []))
```

#### JavaScript

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('whoareyouanas/meta-ad-library-single-ad-lookup').call({
  adId: '1191898553123641',
  country: 'ALL',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) {
  if (item.error) {
    console.error('Lookup unavailable:', item.error);
    continue;
  }
  console.log(item.brand, item.body, item.images);
}
```

#### n8n, Make, and scheduled workflows

Map your saved Library ID to `adId`, run this actor, and read its dataset. Route error records separately and check the fields your workflow needs before saving or analyzing the creative. To process a list, configure your workflow to call the actor once per ID.

Use [Apify Schedules](https://docs.apify.com/platform/schedules) to repeat a saved input, or build your own list-processing workflow with the [Apify API](https://docs.apify.com/api/v2). Historical comparisons require you to store previous results yourself.

### Pricing

The current base price is **$0.006 per dataset result ($6 per 1,000 results)**, plus an **Actor Start event at $0.00005**. Startup event quantity depends on allocated memory, with a minimum of one event per run. See the [Pricing tab](https://apify.com/whoareyouanas/meta-ad-library-single-ad-lookup/pricing) for applicable rates and billing details.

For 100 runs producing one result each, with one startup event per run, these event charges total **$0.605**. This is an event subtotal, not a promise of total workflow cost. The current implementation can save an error record as a dataset result; do not assume unavailable lookups are uncharged.

### Frequently asked questions

#### Can I scrape one Facebook ad instead of an entire advertiser's library?

Yes. Supply its numeric Ad Library ID. This actor is designed for a single known ad per run and returns its available details, rather than performing keyword or advertiser discovery.

#### Does this retrieve Instagram ads too?

It can retrieve available Instagram ad creatives published in Meta Ad Library using their Library ID. The returned `platforms` array indicates the placements reported for the ad. Instagram post URLs are not supported inputs.

#### Can I paste a Facebook Ad Library URL?

Copy the numeric value after `id=` and supply it as `adId`. Full URL input is not currently supported. Search URLs and advertiser Page IDs belong in a discovery scraper.

#### Can I extract ad images, videos, and landing-page links?

The actor extracts available image/video URLs, copy, CTA, and destination links. Some fields may be empty. Media links can expire; this actor does not download or permanently archive the files.

#### Can this check whether an ad is active, paused, or removed?

The result includes an `active` boolean, but it does not distinguish paused from removed. An extraction error can also return `active: false`, and missing activity information may be normalized to false. **A false value alone is not proof the ad stopped running.** Inspect `error` and result completeness; the actor does not provide per-platform activity, last-seen history, or a removal reason.

#### What happens if the ad is unavailable?

The lookup may return partial data or an `error` record. Missing data can reflect availability restrictions or a failed lookup; it does not establish that Meta removed the ad. There is no historical cache of last-known creative data. A successful Apify run status does not by itself prove that ad details were extracted.

#### Does it return spend, ROAS, or winning-ad scores?

No. This actor provides creative and available metadata, not spend, conversions, ROAS, or a performance score. A start date does not establish uninterrupted delivery or profitability.

#### Do I need a Facebook account or Meta API token?

No Facebook login or Meta developer token is required. You need an Apify account to run the actor and an Apify token when using its API. Runtime and data availability depend on the source response and any browser fallback; there is no fixed response-time guarantee.

#### Which Meta Ad Library actor should I use?

| Starting point | Actor |
| --- | --- |
| One known Ad Library ID; focused details lookup | **This Single Ad Lookup actor** |
| Broader discovery with single-ad lookup also available | [Meta Ad Library Scraper](https://apify.com/whoareyouanas/meta-ad-scraper) |
| Keyword, Page ID, or Ad Library search URL | [Meta Ad Library Lite Scraper](https://apify.com/whoareyouanas/meta-ad-lite-scraper) |

The full scraper also supports an ad ID. Choose this actor when you want a focused one-ID input. Lite does not support individual `?id=` URLs.

### Support and feedback

For a lookup issue, include the Library ID, country, and Apify run link in the [Issues tab](https://apify.com/whoareyouanas/meta-ad-library-single-ad-lookup/issues). If this actor helps your creative research workflow, you can share your experience in a [Store review](https://apify.com/whoareyouanas/meta-ad-library-single-ad-lookup/reviews).

# Actor input Schema

## `adId` (type: `string`):

Numeric Meta/Facebook Ad Library ID for one ad. Copy the digits after id= from an ad link; do not paste the full URL, a Page ID, or an Ads Manager ID.

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

ISO 3166-1 alpha-2 country code. Defaults to 'ALL' to search all regions.

## Actor input object example

```json
{
  "adId": "1191898553123641",
  "country": "ALL"
}
```

# 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 = {
    "adId": "1191898553123641",
    "country": "ALL"
};

// Run the Actor and wait for it to finish
const run = await client.actor("whoareyouanas/meta-ad-library-single-ad-lookup").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 = {
    "adId": "1191898553123641",
    "country": "ALL",
}

# Run the Actor and wait for it to finish
run = client.actor("whoareyouanas/meta-ad-library-single-ad-lookup").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 '{
  "adId": "1191898553123641",
  "country": "ALL"
}' |
apify call whoareyouanas/meta-ad-library-single-ad-lookup --silent --output-dataset

```

## MCP server setup

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

```

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/ZdhKNMB4YaaInnN0L/builds/3SnCrMHZasK6GfLj4/openapi.json
