# Bing Ad Library Explorer — EU Ad Copy, Reach & Targeting (`xyrelith-data/bing-ad-library`) Actor

Query Microsoft's public Bing Ad Library for EU/EEA ads by keyword, advertiser or ad ID. Export ad copy, landing pages, image creatives, run dates, impression bands, per-country reach, targeting and advertiser identity without a login or API key.

- **URL**: https://apify.com/xyrelith-data/bing-ad-library.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** Automation, Lead generation, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Bing Ad Library Explorer — EU Ad Copy, Reach & Targeting

Microsoft's Ad Library publishes every ad that received an impression on Bing in the EU/EEA since June 2023. This actor queries that public library and returns analysis-ready ad records: the exact copy, creative assets, landing pages, run dates, impression bands, per-country reach and targeting signals — with no login, cookie or API key.

### What this actor does

- **Four modes:** keyword search, ads by advertiser, advertiser directory rows, and direct ad-ID lookup
- **All 30 EU/EEA markets:** Austria through Sweden, including Iceland, Liechtenstein and Norway
- **Date windows** on the ad run period, plus text-only / image creative filters, landing-domain filters and an ad-text keyword filter
- **Optional detail enrichment:** first and last shown dates, days active, total EU impressions (raw band and numeric minimum/maximum), impression share by country, targeting types with include/exclude flags, paid-for-by and restriction reasons
- **Deep search:** when a broad keyword reaches Microsoft's 1,000-ad ceiling, the actor slices the query by country and then by month, deduplicating by ad ID
- **Advertiser summaries:** one row per advertiser account with its country, verified badge, number of matching ads and distinct landing domains
- **Cross-run memory:** optionally emit only ads a named monitor store has not delivered before (ad modes)
- **Image assets:** every image asset with its width, height and type; optional rehosting for third-party image hosts
- **Empty fields are omitted** — no nulls and no placeholder values

### Data source

The actor reads Microsoft's official public Ad Library API at `adlibrary.api.bingads.microsoft.com`. The library is a transparency record, not a campaign report: it contains ads served inside the EU/EEA, reports impressions in bands rather than exact counts, and can lag real delivery by one to three days. Microsoft keeps an ad for one year after its last eligible impression.

### Modes

| Mode | `queries` means | Returns |
|---|---|---|
| `searchAds` | Keywords found in ad copy | One row per ad |
| `byAdvertiser` | Advertiser name, numeric ID or `/advertiser/` URL | One row per ad from each matching account |
| `searchAdvertisers` | Advertiser name or numeric ID | One row per advertiser account with ad count and landing domains |
| `byAdIds` | Ad ID or `/ad/` URL | One row per exact ad |

A name in `byAdvertiser` mode is resolved through Microsoft's advertiser register first, so `Nike` can match `Nike - EMEA`, `Nike Retail B.V.` and other accounts. Use `maxAdvertisersPerQuery` to bound how many accounts one name may resolve to.

### Output per ad

- `adId`, `adLibraryUrl`, `sourceUrl` — the stable ad identity and its public Ad Library page
- `advertiserId`, `advertiserName`, `advertiserUrl`
- `headline`, `description`, `displayUrl`, `destinationUrl`, `destinationDomain`
- `assets[]` — `assetType`, `url`, `width`, `height`, plus `originalUrl` when an image was rehosted
- `firstShownDate`, `lastShownDate`, `daysActive`
- `totalImpressionsRange` — Microsoft's raw band, e.g. `100K - 250K`
- `impressionsMin`, `impressionsMax` — the band parsed to integers, e.g. `100000` and `250000`
- `impressionsByCountry[]` — `country`, `impressionShare` (e.g. `17.3%`) and `impressionSharePercent`
- `targetingTypes[]` — `targetType` (`Gender`, `Age`, `Location`, `MicrosoftAudiences`, `AdvertiserAudiences`) and `usedForExclusion`
- `paidForByName` — present when a media agency or other party paid for the ad
- `restrictionReason` — present when Microsoft restricted or removed the ad
- `advertiserCountry`, `advertiserVerified` — when advertiser profile enrichment is on, or when an advertiser query resolved them
- `detailsFetched` — present when details were requested, so a failed detail call is distinguishable from details left off
- `searchTerm`, `matchedVia` — how the record was found
- `recordType: "ad"`, `scrapedAt`

### Output per advertiser

- `advertiserId`, `advertiserName`, `advertiserCountry`, `advertiserVerified`
- `advertiserUrl`, `sourceUrl`
- `adsFound` — distinct ads matching the run's filters
- `landingDomains[]` — distinct destination domains, sorted
- `adsFoundIsLowerBound` — present when a result cap stopped the scan
- `searchTerm`, `matchedVia`, `recordType: "advertiser"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `searchAds` | `searchAds` / `byAdvertiser` / `searchAdvertisers` / `byAdIds` |
| `queries` | array | `["nike"]` | Keywords, advertiser names/IDs/URLs, or ad IDs/URLs depending on mode |
| `advertiserMatch` | select | `word` | `word`, `contains` or `exact` name matching |
| `maxAdvertisersPerQuery` | int | `5` | Advertiser accounts read per name (1–200) |
| `countries` | multi-select | all | EU/EEA markets (30 ISO codes) |
| `startDate` | date | – | First eligible impression date, `YYYY-MM-DD` |
| `endDate` | date | – | Last eligible impression date, `YYYY-MM-DD` |
| `adFormat` | select | `all` | `all`, `text` (no image asset) or `image` |
| `landingDomains` | array | – | Keep ads whose destination host matches these domains |
| `adKeywordFilter` | string | – | Keep ads whose title, description or display URL contains every word |
| `includeDetails` | bool | `false` | Run dates, impressions, targeting, paid-for-by, restriction |
| `includeAdvertiserProfile` | bool | `false` | Add advertiser country and verified flag to each ad |
| `maxAdvertiserProfiles` | int | `100` | Distinct profile lookups per run; `0` = no cap |
| `rehostImages` | bool | `false` | Rehost non-Bing image assets in the run's key-value store |
| `deepSearch` | bool | `false` | Slice capped queries by country, then month |
| `maxResults` | int | `1000` | Total records for the run (ads, or advertiser rows in `searchAdvertisers`) |
| `maxAdsPerQuery` | int | `0` | Per-query/advertiser cap; `0` = remaining global budget |
| `onlyNewAds` | bool | `false` | Emit only ads not already delivered by the monitor store |
| `monitorStoreName` | string | `bing-ad-library-monitor` | Key-value store for the cross-run ad-ID memory |

#### Example: competitor keyword sweep with details

```json
{
  "mode": "searchAds",
  "queries": ["meal kit", "vpn"],
  "countries": ["DE", "FR", "NL"],
  "startDate": "2026-09-01",
  "includeDetails": true,
  "maxAdsPerQuery": 50,
  "maxResults": 100
}
```

#### Example: advertiser check

```json
{
  "mode": "byAdvertiser",
  "queries": ["Booking.com", "https://adlibrary.ads.microsoft.com/advertiser/4295007715"],
  "advertiserMatch": "word",
  "maxAdvertisersPerQuery": 5,
  "includeDetails": true,
  "maxResults": 100
}
```

#### Example: advertiser directory rows

```json
{
  "mode": "searchAdvertisers",
  "queries": ["nike", "adidas"],
  "maxAdvertisersPerQuery": 10,
  "maxAdsPerQuery": 25,
  "maxResults": 20
}
```

#### Example: exact ads and a scheduled new-ad monitor

```json
{
  "mode": "byAdIds",
  "queries": ["71056224111848", "https://adlibrary.ads.microsoft.com/ad/73530116422594"],
  "includeDetails": true
}
```

```json
{
  "mode": "byAdvertiser",
  "queries": ["Nike - EMEA"],
  "onlyNewAds": true,
  "monitorStoreName": "nike-emea-watch",
  "includeDetails": true
}
```

### Coverage, caps and pacing

Microsoft returns at most **24 ads per page** and at most **1,000 ads per query**. The actor follows pagination to the cap. With `deepSearch` on, a capped query is repeated for each selected country and then for each month in the date window, which can surface ads beyond the first 1,000. Deduplication is by `adId`, so overlapping slices do not create duplicate records.

Anonymous API calls are rate-limited. The actor sends one request at a time with a short pause, honours `Retry-After`, and backs off automatically on HTTP 429 and 5xx responses. Detail calls are the slow part: a 1,000-ad run with `includeDetails` can take tens of minutes. Use `maxAdsPerQuery` or a narrower country/date window to keep runs small.

The actor has an internal request budget so a mistaken input cannot run forever. If the budget is reached, it stops cleanly with the records already collected and says so in the run status.

### Limits and honest caveats

- **EU/EEA only.** The library does not contain ads served outside the EU/EEA.
- **Since June 2023.** Ads are retained for one year after their last eligible impression.
- **Impression bands, not exact counts.** Microsoft publishes ranges such as `2.5K - 5K`; `impressionsMin` and `impressionsMax` are parsed from that band. A `<100` band becomes `0`–`99`.
- **One to three days of lag** is normal for new impressions and edits.
- **1,000-result ceiling per query.** Deep search works around it with country and month slices, but a very large advertiser can still exceed the request budget. Month slicing without a date window uses the last 12 months; set `startDate`/`endDate` to cover older ads.
- **Thousands of advertiser accounts share similar names.** The default `word` matching requires every query word as a whole word, which avoids matches inside unrelated names such as "Kliniken". Use `exact` or a numeric advertiser ID for the tightest scope.
- **Some fields are often absent.** `paidForByName` appears only when the payer differs from the advertiser; `restrictionReason` only for restricted or removed ads. Both are omitted rather than filled with placeholders.
- **Creative assets belong to advertisers.** Most image URLs are Bing-hosted and load directly. A minority sit on third-party CDNs that may block automated requests. `rehostImages` copies fetchable non-Bing images into the run's key-value store; unfetchable third-party URLs are kept as-is.
- **No proxy or account is required.** The public API answers anonymous calls; the pacing exists because those calls share a strict per-IP limit.

### FAQ

**Why did I get fewer ads than `maxResults`?** The query may have fewer matches, the country/date/format/domain filters may have removed some, or the source hit its 1,000-ad ceiling. Turn on `deepSearch` for a capped broad query, or narrow the filters.

**Why are `firstShownDate` and `lastShownDate` not my campaign dates?** They are the first and last days Microsoft recorded an eligible EU/EEA impression. An ad can have run earlier outside the library's coverage or before June 2023.

**What does `adsFoundIsLowerBound` mean?** The advertiser scan stopped at a result cap, so the advertiser may have more matching ads than the number shown.

**Can I export every ad an advertiser ever ran?** The library retains one year after the last impression and caps each query at 1,000. Deep search plus country and date slices gets the broadest coverage the public API allows.

**Are the image URLs permanent?** Bing-hosted asset URLs are stable CDN links. Third-party advertiser CDNs control their own retention. Enable `rehostImages` if you need copies served from your run's key-value store.

**Does `onlyNewAds` remember ads across different searches?** The memory is per named store. Use one store per scheduled watch, and a different name for a different competitor or market.

**How fresh is the data?** Microsoft updates the library with a one-to-three-day delay after an eligible impression. The actor always queries the live API.

### Use cases

- **Competitive creative research** — pull the exact headlines and descriptions competitors run in each EU market
- **Ad monitoring** — schedule an advertiser watch and export only newly seen ads
- **Media and brand intelligence** — compare impression bands and country mixes across advertisers
- **DSA transparency research** — archive ad copy, payer identity, targeting types and restriction reasons
- **Landing-page discovery** — collect the domains and URLs advertisers send Bing traffic to
- **Market entry analysis** — see which brands advertise in a country before launching there

# Actor input Schema

## `mode` (type: `string`):

Pick what to return.

## `queries` (type: `array`):

One per line. searchAds: keywords matched in ad copy. byAdvertiser: advertiser name, numeric ID or /advertiser/ URL. searchAdvertisers: advertiser name or ID. byAdIds: ad ID or /ad/ URL.

## `advertiserMatch` (type: `string`):

How a name query is matched to advertiser accounts in byAdvertiser and searchAdvertisers modes. Whole-word matching avoids brands inside unrelated names.

## `maxAdvertisersPerQuery` (type: `integer`):

A brand can have several accounts (per market or agency). Read this many matches per name.

## `countries` (type: `array`):

Only ads shown in these markets. Empty means all 30 EU/EEA countries. Uses Microsoft's numeric country codes internally.

## `startDate` (type: `string`):

Only ads with an eligible impression on or after this date. The library starts 2023-06-01.

## `endDate` (type: `string`):

Only ads with an eligible impression on or before this date. Data can lag by 1-3 days.

## `adFormat` (type: `string`):

Filter list results by the ad's image assets.

## `landingDomains` (type: `array`):

Keep ads whose destination URL is on one of these domains, e.g. nike.com. Ads without a destination URL pass through.

## `adKeywordFilter` (type: `string`):

Keep ads whose title, description or display URL contains every word here. Useful for narrowing an advertiser's ads to a product or theme.

## `includeDetails` (type: `boolean`):

Adds first/last shown dates, days active, the EU impression band with numeric bounds, per-country impression share, targeting types with exclusion flags, paid-for-by and any restriction reason. One extra request per ad.

## `includeAdvertiserProfile` (type: `boolean`):

Adds the advertiser's registered country and verified flag to each ad. Uses one cached lookup per distinct advertiser, capped by the next field.

## `maxAdvertiserProfiles` (type: `integer`):

Maximum distinct advertiser profiles to look up per run. 0 means no cap.

## `rehostImages` (type: `boolean`):

Downloads image assets hosted outside bing.com into this run's key-value store and emits public URLs plus originalUrl. Bing-hosted images stay as they are. Up to 100 images per run.

## `deepSearch` (type: `boolean`):

When a query reaches Microsoft's 1,000-result limit, repeat it by country and then by month, deduplicating by ad ID. Slower and uses more requests.

## `maxResults` (type: `integer`):

Total records to return: ads in ad modes, advertiser rows in searchAdvertisers mode.

## `maxAdsPerQuery` (type: `integer`):

Per-query cap. 0 uses the remaining global budget, up to Microsoft's 1,000-ad limit per unsliced query.

## `onlyNewAds` (type: `boolean`):

Stores delivered ad IDs in a named key-value store and emits only ads this store has not delivered yet. Applies to the three ad modes.

## `monitorStoreName` (type: `string`):

Key-value store that remembers delivered ad IDs. Use a separate name per schedule. Lowercase letters, digits and hyphens only.

## Actor input object example

```json
{
  "mode": "searchAds",
  "queries": [
    "nike"
  ],
  "advertiserMatch": "word",
  "maxAdvertisersPerQuery": 5,
  "countries": [],
  "adFormat": "all",
  "landingDomains": [],
  "adKeywordFilter": "",
  "includeDetails": false,
  "includeAdvertiserProfile": false,
  "maxAdvertiserProfiles": 100,
  "rehostImages": false,
  "deepSearch": false,
  "maxResults": 3,
  "maxAdsPerQuery": 0,
  "onlyNewAds": false,
  "monitorStoreName": "bing-ad-library-monitor"
}
```

# Actor output Schema

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

Dataset containing ad records and, in advertiser-directory mode, advertiser summary records.

# 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 = {
    "mode": "searchAds",
    "queries": [
        "nike"
    ],
    "advertiserMatch": "word",
    "maxAdvertisersPerQuery": 5,
    "countries": [],
    "adFormat": "all",
    "landingDomains": [],
    "adKeywordFilter": "",
    "includeDetails": false,
    "includeAdvertiserProfile": false,
    "maxAdvertiserProfiles": 100,
    "rehostImages": false,
    "deepSearch": false,
    "maxResults": 3,
    "maxAdsPerQuery": 0,
    "onlyNewAds": false,
    "monitorStoreName": "bing-ad-library-monitor"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/bing-ad-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 = {
    "mode": "searchAds",
    "queries": ["nike"],
    "advertiserMatch": "word",
    "maxAdvertisersPerQuery": 5,
    "countries": [],
    "adFormat": "all",
    "landingDomains": [],
    "adKeywordFilter": "",
    "includeDetails": False,
    "includeAdvertiserProfile": False,
    "maxAdvertiserProfiles": 100,
    "rehostImages": False,
    "deepSearch": False,
    "maxResults": 3,
    "maxAdsPerQuery": 0,
    "onlyNewAds": False,
    "monitorStoreName": "bing-ad-library-monitor",
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/bing-ad-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 '{
  "mode": "searchAds",
  "queries": [
    "nike"
  ],
  "advertiserMatch": "word",
  "maxAdvertisersPerQuery": 5,
  "countries": [],
  "adFormat": "all",
  "landingDomains": [],
  "adKeywordFilter": "",
  "includeDetails": false,
  "includeAdvertiserProfile": false,
  "maxAdvertiserProfiles": 100,
  "rehostImages": false,
  "deepSearch": false,
  "maxResults": 3,
  "maxAdsPerQuery": 0,
  "onlyNewAds": false,
  "monitorStoreName": "bing-ad-library-monitor"
}' |
apify call xyrelith-data/bing-ad-library --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/bing-ad-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/UjvV9uRu8I1KwyYsU/builds/RgWmR0sB6mPWF16bk/openapi.json
