# Ad Library Export - Meta & Microsoft Official APIs (`digivibetech/meta-ad-library-api-export`) Actor

Export Microsoft (Bing) Ad Library ads with no token: advertiser, ad text, landing page, served dates, EU impression ranges by country. Meta Ad Library too, with your own Meta token (no Meta proof run on our side yet). Official APIs only. $0.0008 per ad + $0.02 per run.

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

## Pricing

from $0.80 / 1,000 ad exporteds

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

## Ad Library Export - Meta & Microsoft Official APIs

Export ads from **Microsoft's official Ad Library API** (Bing ads shown in the EU/EEA) with **no token and no login**: advertiser, ad title and text, landing page, first and last served dates, EU impression range and impression share per country. The same actor can also query the **official Meta Ad Library API**, but only with **your own Meta access token** (see below).

> **Try it free, no token:** press **Start**. The prefilled input searches the Microsoft Ad Library for real ads (20 ads cost about $0.036). Apify's free plan includes monthly platform credit, and you can set a maximum cost per run.

- **Microsoft Ad Library, ready now:** real ads from Microsoft's public transparency API, one clean row per ad, JSON / CSV / Excel.
- **Official APIs only:** no scraping of ad pages, no proxies, no cookies, no anti-bot workarounds.
- **Fair billing:** one charge per unique ad plus a small start fee. Duplicate ads and failed queries are not charged.

### What is Ad Library Export?

A small, official-API exporter for ad transparency libraries. It turns Microsoft's Ad Library (and Meta's, if you bring a token) into one clean table with the same columns plus a `platform` field, so you can compare advertisers, landing pages and how long ads have run, without opening each ad by hand.

### 🎯 Use cases

- See which advertisers bid on your brand or product keywords on Bing in the EU/EEA, and where they send traffic.
- Check how long a competitor's ads have been running (first and last served dates) and in which countries.
- Build a dated archive of ads for a keyword by scheduling the actor.

### 📸 Real run: Microsoft Ad Library (22 Nov 2026)

Real Apify run `pmY2kXwh9iYfBd6xB` (build 1.1.3): `sources: ["microsoft"]`, search term `nike`, `maxAds` 5, no token. Images are rendered from the run's own input, dataset and charged events.

![Input of the real run](https://api.apify.com/v2/key-value-stores/8dx7mDMr71NbvtKdp/records/meta-ad-library-api-export-ms-2026-11-22-01-input.png)
![Results table: 5 Microsoft Ad Library ads](https://api.apify.com/v2/key-value-stores/8dx7mDMr71NbvtKdp/records/meta-ad-library-api-export-ms-2026-11-22-02-results-table.png)
![One result item with impressions by country](https://api.apify.com/v2/key-value-stores/8dx7mDMr71NbvtKdp/records/meta-ad-library-api-export-ms-2026-11-22-03-result-item.png)
![Run cost at the list price: $0.024 for 5 ads](https://api.apify.com/v2/key-value-stores/8dx7mDMr71NbvtKdp/records/meta-ad-library-api-export-ms-2026-11-22-04-run-cost.png)

### ▶️ How to use (Microsoft, no token)

1. Keep `microsoft` in `sources` (the default is `meta` + `microsoft`; with no Meta token the Meta part is skipped and nothing is charged for it).
2. Enter `searchTerms` (for example a brand or product) or `microsoftAdvertiserIds`, optionally EU/EEA `adReachedCountries` such as `NL` or `DE` and delivery dates. Set `maxAds` to control the cost.
3. Press **Start**. Open the **Microsoft (Bing) ads** view in the Output tab, or download JSON, CSV or Excel.

#### Output example (Microsoft row from the run above, shortened)

```json
{ "platform": "microsoft", "adArchiveId": "71124924488316",
  "advertiserName": "Sports Emotion Hub S.L.",
  "adTitle": "Nike - Sneakers Air Force 1 '07 Premium Mujer, Mujer, Bleached Lilac-Bleached Lilac-White, 10,5 USA",
  "adDescription": "139.99 EUR", "displayUrl": "Futbol Emotion",
  "adDeliveryStartTime": "2024-11-07", "adDeliveryStopTime": "2026-11-21",
  "publisherPlatforms": ["BING"], "totalImpressionsRange": "25M - 50M",
  "impressionsByCountry": [{"country": "Ireland", "share": 0.2}, {"country": "Spain", "share": 99.8}],
  "topCountry": "Spain", "targetTypes": ["Age", "Location"], "isSample": false }
```

### ⬇️ What data you get

Microsoft rows fill `adArchiveId`, `pageName` / `advertiserName`, `advertiserId`, `adTitle`, `adDescription`, `firstBody`, `displayUrl`, `destinationUrl`, `adDeliveryStartTime` / `adDeliveryStopTime` (first and last served), `publisherPlatforms: ["BING"]`, `paidForBy`, `totalImpressionsRange`, `impressionsByCountry`, `topCountry`, `targetTypes`, `restrictionReason` and `adApiUrl`. Meta-only columns (spend, demographics, snapshot link) stay `null` on Microsoft rows.

### ⚙️ Input

Main fields: `sources` (`microsoft`, `meta` or both), `searchTerms`, `microsoftAdvertiserIds`, `adReachedCountries`, `deliveryDateMin` / `deliveryDateMax`, `maxAds`, `microsoftAdDetails`, and for Meta the secret `accessToken`.

```json
{ "sources": ["microsoft"], "searchTerms": ["nike"], "adReachedCountries": ["ES", "FR"], "maxAds": 50 }
```

### 🟪 Meta Ad Library (needs your own Meta access token)

The Meta part calls Meta's official Ad Library API (Graph API `ads_archive`) with **your own access token**, put in the secret `accessToken` field. Without a token the Meta part does not run.

**Honest status:** we have **not yet made a real Meta run on our side**, so this page shows **no Meta results** and makes no claim about them. The Meta code path validates your token first: a wrong, expired or unapproved token stops the run before any ad is charged (only the $0.02 start fee applies).

Getting a token (Meta's process, can take a day or more):

1. Confirm your identity and location at [facebook.com/ID](https://www.facebook.com/ID).
2. Accept the Ad Library API terms at [facebook.com/ads/library/api](https://www.facebook.com/ads/library/api) and create an app at [developers.facebook.com](https://developers.facebook.com).
3. Generate a user access token in the Graph API Explorer (or a long-lived token) and paste it into `accessToken`.

Meta's own coverage rule: the API returns ads that reached at least one EU country, plus ads about social issues, elections or politics elsewhere. It does not contain all ads worldwide. With `sources: ["meta"]` and no token, the actor returns 3 clearly marked illustrative sample rows (`isSample: true`, not live data) so you can see the columns; no ad events are charged (only the $0.02 start fee).

### 💵 Price

$0.0008 per unique ad exported (`ad-exported`) + $0.02 per run (Actor start). 5 ads = $0.024; 100 ads = $0.10; 1,000 ads = $0.82; 10,000 ads (over 10 runs) = $8.20. Same price for Microsoft and Meta ads. You can set a maximum cost per run.

### ⚠️ Limits

- **Microsoft:** EU/EEA ads only (that is what Microsoft publishes), at most 1,000 results per query. Details (dates, impressions) cost one extra API request per ad; turn `microsoftAdDetails` off for faster runs. The public Ad Library page link and creative images are not filled for Microsoft rows yet.
- **Meta:** needs your own approved token; spend and impressions are ranges and only for political and issue ads; Meta rate limits apply (the actor pauses, then stops and keeps what it exported).
- `maxAds` is shared by both libraries; Meta is searched first when a token is given.
- No images or videos are downloaded.

### 🛡️ Data source and responsible use

Both ad libraries are public transparency archives run by Microsoft and Meta. The actor only requests the documented public ad fields, nothing about the people who saw the ads. Your Meta token is a secret input, sent only to Meta's API, removed from returned links and never written to the dataset or logs. Follow each library's API terms and the data-protection law that applies to you.

### 🔌 API

```bash
curl -X POST "https://api.apify.com/v2/acts/digivibetech~meta-ad-library-api-export/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sources": ["microsoft"], "searchTerms": ["nike"], "maxAds": 5}'
```

Works from n8n, Make, Zapier, webhooks and the Apify MCP server.

### ❓ FAQ

#### Can I try it for free?

Yes. Press Start with the prefilled input: it runs a small real Microsoft Ad Library job with no token. Apify's free plan includes monthly platform credit, which covers a first test.

#### Do I need a token?

Not for Microsoft. For Meta you need your own Meta access token; without it the Meta part is skipped.

#### Have you tested the Meta part?

Not with a real token yet. The listing shows only Microsoft proof until we have a real Meta run.

#### Is it legal to use Ad Library Export?

It only calls the official, public ad-transparency APIs published by Microsoft and Meta, under their terms, and requests no data about the people who saw the ads. Use the results lawfully (source terms, GDPR where it applies). This is not legal advice.

#### Can I use it through the API or an MCP server?

Yes, through the Apify API, the official client libraries, and the Apify MCP server.

### 📝 Changelog

- **22 Nov 2026:** listing rewritten Microsoft-first with a dated real run at the current price. No code change.
- **1.1 (21 Nov 2026):** Microsoft Ad Library leg (official public API, no token), new `sources`, `microsoftAdvertiserIds`, `microsoftAdDetails` inputs and a `platform` column.
- **1.0 (10 Nov 2026):** Meta Ad Library API export.

Questions or a field you need: [digivibetech.com/support](https://digivibetech.com/support/).

# Changelog

This Actor's version history is a separate document: https://apify.com/digivibetech/meta-ad-library-api-export/changelog.md

# Actor input Schema

## `sources` (type: `array`):

Which official ad libraries to search. Meta needs your own access token below; without a token the Meta leg is skipped (or, if Meta is the only library, you get 3 free illustrative sample rows). Microsoft's public Ad Library API needs no login and returns real Bing ads shown in the EU/EEA. 'maxAds' is the total across both libraries.

## `accessToken` (type: `string`):

Your own Meta user or System User access token with Ad Library API access (identity confirmed at facebook.com/ID, terms accepted at facebook.com/ads/library/api). Stored encrypted by Apify, sent only to graph.facebook.com in the Authorization header, removed from every returned URL, never logged. Leave empty to search only the Microsoft Ad Library (real ads, no token), or, with Meta as the only library, to get 3 free illustrative sample rows.

## `searchTerms` (type: `array`):

Keywords to search in ad text (max 100 characters each, up to 50). Each term is one query; ads found by several queries are returned and charged once.

## `searchType` (type: `string`):

How Meta matches the search terms.

## `searchPageIds` (type: `array`):

Numeric page ids (from an Ad Library URL: view_all_page_id=...). Sent 10 per request, Meta's limit. Can be combined with search terms.

## `microsoftAdvertiserIds` (type: `array`):

AdvertiserId values from the Microsoft Ad Library (numbers) to export all of an advertiser's EU/EEA Bing ads. Meta page ids above do not apply to Microsoft.

## `adReachedCountries` (type: `array`):

ISO two-letter country codes (e.g. DE, FR, BR) or ALL. Coverage limit: ads that did not reach any EU country are only returned when they are about social issues, elections or politics.

## `adType` (type: `string`):

Political and issue ads add spend, impressions, audience size, funder byline and demographic/regional distribution.

## `adActiveStatus` (type: `string`):

Running ads, stopped ads, or both.

## `deliveryDateMin` (type: `string`):

Only ads delivered on or after this date (YYYY-MM-DD). Optional.

## `deliveryDateMax` (type: `string`):

Only ads delivered on or before this date (YYYY-MM-DD). Optional.

## `languages` (type: `array`):

ISO 639-1 codes such as en, de, es. Empty = any language.

## `publisherPlatforms` (type: `array`):

Only ads that ran on these Meta technologies. Empty = all.

## `mediaType` (type: `string`):

Only ads with this kind of media.

## `maxAds` (type: `integer`):

Safety cap on unique ads exported (each costs one 'ad-exported' event). The small default keeps a first test run to about one cent.

## `maxChargeUsd` (type: `number`):

Extra cap on top of Apify's own max cost per run: the run stops before exported ads would cost more than this.

## `includeTargeting` (type: `boolean`):

Adds target ages, gender, locations and the age/country/gender reach breakdown Meta publishes for ads delivered in the EU/UK. Larger rows, same price.

## `microsoftAdDetails` (type: `boolean`):

For each Microsoft ad, also read its details: first and last served date, total EU impressions range, impression share per country and targeting types. One extra API call per ad (slower), no extra charge.

## `apiVersion` (type: `string`):

Meta Graph API version used for ads_archive.

## Actor input object example

```json
{
  "sources": [
    "meta",
    "microsoft"
  ],
  "searchTerms": [
    "solar panels"
  ],
  "searchType": "KEYWORD_UNORDERED",
  "adReachedCountries": [
    "ALL"
  ],
  "adType": "ALL",
  "adActiveStatus": "ACTIVE",
  "mediaType": "ALL",
  "maxAds": 20,
  "includeTargeting": false,
  "microsoftAdDetails": true,
  "apiVersion": "v25.0"
}
```

# Actor output Schema

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

All result items (overview view)

## `political` (type: `string`):

Spend, impressions and funder byline (political and issue ads only)

## `errors` (type: `string`):

Inputs that could not be processed, with the reason

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

Counts of processed, billed and failed items

# 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 = {
    "sources": [
        "meta",
        "microsoft"
    ],
    "searchTerms": [
        "solar panels"
    ],
    "adReachedCountries": [
        "ALL"
    ],
    "maxAds": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("digivibetech/meta-ad-library-api-export").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 = {
    "sources": [
        "meta",
        "microsoft",
    ],
    "searchTerms": ["solar panels"],
    "adReachedCountries": ["ALL"],
    "maxAds": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("digivibetech/meta-ad-library-api-export").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 '{
  "sources": [
    "meta",
    "microsoft"
  ],
  "searchTerms": [
    "solar panels"
  ],
  "adReachedCountries": [
    "ALL"
  ],
  "maxAds": 20
}' |
apify call digivibetech/meta-ad-library-api-export --silent --output-dataset

```

## MCP server setup

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

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/hroAsfsxadMLSzqg0/builds/NgXx7K0tQSh0AJpHF/openapi.json
