# Bing Ads Library Scraper — Microsoft Ads Transparency API (`mochiboo/bing-ads-library-scraper`) Actor

Scrape the Microsoft/Bing Ads Library by advertiser, domain, or keyword. Ad creatives, titles, destination URLs, first/last-shown dates; filter by country & date. Bing ads library / Microsoft ads transparency / competitor ads on Bing. Clean JSON/CSV, company-level only.

- **URL**: https://apify.com/mochiboo/bing-ads-library-scraper.md
- **Developed by:** [mochi](https://apify.com/mochiboo) (community)
- **Categories:** Developer tools, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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/platform/actors/running/actors-in-store#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

## Bing Ads Library Scraper — Microsoft Ads Transparency & Competitor Ad Library API

Scrape the **Microsoft / Bing Ads Library** ([adlibrary.ads.microsoft.com](https://adlibrary.ads.microsoft.com/)) into clean, filterable JSON or CSV. Search by **advertiser name**, **advertiser ID**, or **ad-copy keyword**, and pull every ad an advertiser is running on Bing — title, description, display & destination URLs, creative assets, and (optionally) per-ad impressions and targeting. Built for **competitor ad research**, **ad monitoring**, and **AI agents** that need Bing ad transparency data on tap.

> **Keywords:** bing ads library, microsoft ads transparency, bing ads scraper, competitor ads bing, ad library api, microsoft advertising transparency, bing ad intelligence, competitor ad monitoring.

### What it does

- **Advertiser search** — type a brand ("Nike", "Bosch") and get every advertiser match plus all their ads.
- **Advertiser ID** — pass an exact Microsoft advertiser ID and pull its complete ad set.
- **Keyword** — find ads whose copy (title/description) contains your terms.
- **Filters** — EEA **country**, **date range**, and an optional **ad details** enrichment (impressions range, impressions-by-country, targeting).
- **Streams results live** — rows are written to the dataset as each page arrives, so an interrupted run still keeps everything found so far.
- **Company-level only** — advertiser (funding-entity) name + ad creative metadata. No personal data.

### Data source & scope

This actor uses Microsoft's **official public Ad Library API** (`adlibrary.api.bingads.microsoft.com/api/v1`), the same data behind the public Bing Ad Library site. The API is **public and needs no login or API key**.

**Coverage: the European Economic Area (EEA) only.** The Bing Ad Library is Microsoft's EU-compliance transparency tool, so it contains ads served within the EEA — not the US. If you need a specific EEA market, set `country` (e.g. `DE`, `France`, `IE`); otherwise it returns ads across the EEA.

### Input

| Field | Type | Description |
|---|---|---|
| `searchMode` | select | `advertiser` (name search, default), `advertiserId` (exact), or `keyword` (words in ad copy). |
| `queries` | array | Advertiser names, advertiser IDs, or keywords — must match `searchMode`. |
| `country` | string | EEA country name/code (e.g. `DE`, `Germany`, `IE`) or `anywhere`. Unknown → `anywhere` (never a wrong-country result). |
| `dateFrom` / `dateTo` | string | `YYYY-MM-DD` active-period bounds (applied when ad dates are available). |
| `includeAdDetails` | boolean | Fetch per-ad impressions range / by-country / targeting (one extra request per ad, slower). Default off. |
| `maxResults` | integer | Stop after N ads. Default **20** for a fast preview; `0` = no limit. |

#### Example

```json
{
  "searchMode": "advertiser",
  "queries": ["Nike"],
  "country": "DE",
  "maxResults": 50
}
```

### Output

One row per ad (flat, predictable, agent-friendly):

```json
{
  "advertiserName": "Contoso Retail GmbH",
  "advertiserId": "123456789",
  "advertiserCountry": "DE",
  "advertiserVerified": true,
  "adId": "AD-0001",
  "title": "Winter Sale — up to 40% off",
  "description": "Shop the Contoso winter collection. Free returns across the EEA.",
  "displayUrl": "contoso.de/winter",
  "destinationUrl": "https://www.contoso.de/winter-sale",
  "assetJson": "{\"images\":[{\"url\":\"https://…\"}]}",
  "firstShown": "2026-01-05",
  "lastShown": "2026-02-28",
  "totalImpressionsRange": "100000-150000",
  "impressionsByCountry": [ { "Country": "DE", "ImpressionsRange": "80000-120000" } ],
  "targets": { "AgeRanges": ["25-34"], "Genders": ["All"] },
  "adLibraryUrl": "https://adlibrary.ads.microsoft.com/ad-details?adId=AD-0001",
  "country": "DE",
  "matchedQuery": "Nike",
  "searchMode": "advertiser",
  "recordType": "ad",
  "source": "adlibrary.ads.microsoft.com",
  "scrapedAt": "2026-07-27T00:00:00.000Z"
}
```

`firstShown` / `lastShown` / `totalImpressionsRange` / `impressionsByCountry` / `targets` are populated only when `includeAdDetails` is on (the Ad Library exposes these on the single-ad endpoint).

### For AI agents (MCP)

- Every input has a short, self-explanatory description; field names are literal.
- Default run is small and fast (`maxResults: 20`), so an agent can probe cheaply before a full pull.
- Output is a flat object with stable keys — no nested decoding needed for the common fields.

### Notes

- **Compliance:** all data is advertiser/company-level (Microsoft requires ads to disclose the funding organisation). No personal data is collected.
- **Rate limits:** unauthenticated Ad Library calls are throttled by Microsoft; this actor retries with backoff and rotates IPs via Apify Proxy to stay reliable on larger pulls.

# Actor input Schema

## `searchMode` (type: `string`):

How to interpret your queries. 'advertiser' = free-text advertiser/brand name search (e.g. 'Nike'). 'advertiserId' = exact Microsoft advertiser IDs — get every ad for that advertiser. 'keyword' = words present in the ad copy (title/description).

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

List of advertiser names, advertiser IDs, or ad-copy keywords — must match your Search mode. Examples: advertiser mode -> \["Nike", "Bosch"]; advertiserId mode -> \["123456789"]; keyword mode -> \["running shoes"].

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

Restrict ads to where they were shown. The Bing Ad Library covers the EEA only, so use an EEA country name/code (e.g. "DE", "Germany", "France", "IE") or "anywhere" for all EEA. Unknown values fall back to anywhere (never a wrong-country leak).

## `dateFrom` (type: `string`):

Only ads active on/after this date. Format YYYY-MM-DD. Leave blank for no lower bound.

## `dateTo` (type: `string`):

Only ads active on/before this date. Format YYYY-MM-DD. Leave blank for no upper bound.

## `includeAdDetails` (type: `boolean`):

Fetch per-ad detail (impressions range, impressions-by-country, targeting) with one extra request per ad. Off by default for fast, cheap runs. Only the Bing Ad Library single-ad endpoint exposes these.

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

Stop after this many ads (across all queries). Keep low for a fast preview; raise for full pulls. 0 = no limit.

## Actor input object example

```json
{
  "searchMode": "advertiser",
  "queries": [
    "Nike"
  ],
  "country": "anywhere",
  "includeAdDetails": false,
  "maxResults": 20
}
```

# 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 = {
    "queries": [
        "Nike"
    ],
    "country": "anywhere"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mochiboo/bing-ads-library-scraper").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 = {
    "queries": ["Nike"],
    "country": "anywhere",
}

# Run the Actor and wait for it to finish
run = client.actor("mochiboo/bing-ads-library-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "Nike"
  ],
  "country": "anywhere"
}' |
apify call mochiboo/bing-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mochiboo/bing-ads-library-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/JSa1izZpPIn6wQgYD/builds/AwuYhyJKy6Uf66cqE/openapi.json
