# Instagram Ads Library Scraper - Meta Ad Library (`s-r/instagram-ads-library`) Actor

Scrape Instagram ads from Meta's Ad Library by brand, page ID or Ad Library URL. Filters to Instagram placements and flags the ads that ran on Instagram and nowhere else, with creative text, images, videos, CTA, run dates and placement spread.

- **URL**: https://apify.com/s-r/instagram-ads-library.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** Marketing, Business
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Instagram Ads Library Scraper

Pull the ads a brand is running **on Instagram**, with the creative text, the
images and videos, the call to action, the run dates and the full placement
spread. Search by brand name, by Meta page ID, or by pasting an Ad Library URL.

The one thing to know before you start: **Instagram does not publish an ad
library of its own.** There is no instagram.com/ads/library. Every Instagram ad
is disclosed through *Meta's* Ad Library, mixed in with Facebook, Messenger,
Audience Network and Threads placements, and the only thing that separates them
is a `publisher_platform` field on each ad. This Actor is that separation, done
properly. Nothing here comes from a source that does not exist.

### Why not just use a Facebook Ad Library scraper

Because a Meta-wide scraper hands you one undifferentiated list and leaves the
interesting question unanswered: *which of these were made for Instagram?*

:

| Advertiser | Market | Live ads | Ran on Instagram | Instagram and nowhere else |
|---|---|---|---|---|
| Nike | US | 59 | 59 | **20** |
| Zalando | NL | 51 | 51 | **10** |

Nearly everything a big brand runs touches Instagram, so "is it on Instagram"
is barely a filter. The signal is the third column. Those 20 Nike creatives are
ads someone deliberately built for the Instagram format and shipped nowhere
else, and in a combined list they are indistinguishable from a Facebook banner
that happened to get an Instagram placement.

This Actor puts that on every row as `is_instagram_only`, with `also_on` naming
the other surfaces and `platform_count` giving the breadth at a glance. An ad on
five placements is a budget decision. An Instagram-only ad is a creative one.

### What you get

One row per ad creative. The fields worth knowing about:

- **`is_instagram_only`** — true when Instagram was the ad's only placement.
- **`also_on`** — the other placements the same creative ran on, `null` when
  Instagram-only. Meta added `THREADS` to this list without announcement, and
  unrecognised surfaces are passed through as themselves rather than dropped.
- **`platform_count`** — how many surfaces the ad ran on.
- **`body_text`, `title`, `caption`, `link_description`** — the creative copy.
- **`images`, `videos`** — media URLs.
- **`cta_text`, `cta_type`, `link_url`** — the call to action and destination.
- **`start_date`, `end_date`, `total_active_time`** — how long it has run. A
  creative still live after months is one that is working.
- **`page_name`, `page_id`, `page_like_count`, `page_categories`** — the
  advertiser.
- **`collation_id`, `collation_count`** — Meta groups the variants of one
  creative; this is how you tell a 12-variant test from 12 separate ads.
- **`contains_digital_created_media`** — Meta's AI-generated-content
  disclosure.
- **`byline`, `disclaimer_label`, `state_media_run_label`** — the regulatory
  labels, on ads that carry them.

### What you do not get, and why

**Spend and impressions are empty for commercial ads.** This is Meta's policy,
not a gap in the scraper: `spend`, `currency` and `reach_estimate` are published
for political and issue ads only. Every commercial ad returns `null` there. Any
tool promising you Instagram ad spend for an ordinary brand is either guessing
or reselling an estimate. The fields are present and populate correctly when the
ad is political.

**Targeting is not published either.** Meta discloses `targeted_or_reached_countries`
and nothing finer for commercial advertising.

### Input

| Field | What it does |
|---|---|
| `search` | Advertiser name, e.g. `nike` |
| `placement` | `instagram` (default), `instagram_only`, or `all` |
| `country` | Two-letter market code, e.g. `US`, `NL`. Inventory differs per country |
| `page_id` | Meta page ID, more precise than a name when brands share one |
| `url` | Paste an Ad Library URL; advertiser, country and status are read from it |
| `active_only` | Only ads running right now. Off includes stopped ads |
| `max_ads` | Ceiling on ads fetched **before** filtering, so ask for more than you need |

`max_ads` is worth a second look. The Instagram filter runs after fetching, so
requesting 100 ads with `placement: instagram_only` returns however many of
those 100 were Instagram-exclusive, not 100 Instagram-exclusive ads.

### Typical uses

- **Creative research.** Pull a competitor's Instagram-only ads and see what
  they build for the format: aspect ratios, hook length, whether they run Reels
  creative or repurposed feed assets.
- **Longevity as a proxy for performance.** Sort by `total_active_time`. Brands
  kill ads that do not work, so the creative still running after ninety days is
  the one that earned its budget.
- **Placement strategy.** Compare `platform_count` across competitors. A brand
  running everything cross-placement is buying reach; one with a large
  Instagram-only share is treating Instagram as its own channel.
- **Variant testing.** Group on `collation_id` to see how many versions of a
  creative a brand is testing at once.
- **Compliance and disclosure monitoring.** `contains_digital_created_media`,
  `byline` and `state_media_run_label` are how Meta labels AI-generated
  creative, paid-for-by lines and state media.

### Notes on behaviour

An empty result is a successful run, not a failure. When an advertiser is live
on Meta but runs nothing on the placement you asked for, the run reports a
`no_instagram_ads` note saying exactly that, rather than handing you an empty
dataset that looks like a broken scrape.

Ad inventory is per country. Searching `US` and `NL` for the same brand returns
different ads, and often different creative for the same campaign, so set
`country` deliberately rather than leaving it at the default.

### Related Actors

If you want the whole Meta library rather than the Instagram slice, use the
**Facebook Ads Scraper - Meta Ad Library** Actor instead. For Instagram organic
content, profiles, posts, hashtags and locations, see the Instagram scrapers in
the same account.

# Actor input Schema

## `search` (type: `string`):

Advertiser name to look up in Meta's Ad Library, for example 'nike'. Leave empty when you supply a page ID or an Ad Library URL instead.

## `placement` (type: `string`):

Which ads to keep. 'Instagram' keeps every ad that ran on Instagram, including those that also ran on Facebook. 'Instagram only' keeps just the ads made for Instagram and nothing else. 'All placements' keeps everything the advertiser runs, Instagram or not.

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

Two-letter country code for the market to search, for example US or NL. Ad inventory differs per country.

## `page_id` (type: `string`):

Meta page ID of the advertiser. More precise than a name search when two brands share a name.

## `url` (type: `string`):

Paste a Meta Ad Library URL and its advertiser, country and status are read from it.

## `active_only` (type: `boolean`):

Return only ads that are running right now. Turn this off to include ads that have stopped.

## `max_ads` (type: `integer`):

Upper bound on ads fetched before filtering. The Instagram filter is applied afterwards, so ask for more than you need.

## Actor input object example

```json
{
  "search": "nike",
  "placement": "instagram",
  "country": "US",
  "active_only": true,
  "max_ads": 100
}
```

# Actor output Schema

## `ads` (type: `string`):

One row per Instagram ad with creative, media, CTA, run dates and placement spread.

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

Counts, Instagram-only total and the placement spread for the run.

# 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 = {
    "search": "nike",
    "country": "US",
    "max_ads": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/instagram-ads-library").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 = {
    "search": "nike",
    "country": "US",
    "max_ads": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("s-r/instagram-ads-library").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 '{
  "search": "nike",
  "country": "US",
  "max_ads": 100
}' |
apify call s-r/instagram-ads-library --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/instagram-ads-library"
        }
    }
}
```

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/q7FwpJGQiCBDc6xch/builds/DB6iJKxTfsq0uEyel/openapi.json
