# Microsoft Ads Library (`codebyte/microsoft-ads-library`) Actor

Scrape ads, advertisers, and ad details from the Microsoft Advertising Transparency Center (Bing Ads Library). Extract competitor ad copy, targeting data, impression stats, and advertiser information across all EU/EEA countries.

- **URL**: https://apify.com/codebyte/microsoft-ads-library.md
- **Developed by:** [Codebyte](https://apify.com/codebyte) (community)
- **Categories:** SEO tools, E-commerce, Lead generation
- **Stats:** 26 total users, 3 monthly users, 95.6% runs succeeded, 2 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

from $1.00 / 1,000 search results

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

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

## Microsoft Ads Library Scraper

Scrape ads, advertisers, and ad details from the Microsoft Advertising Transparency Center (Bing Ads Library). Extract competitor ad copy, targeting data, impression stats, and advertiser information across all EU/EEA countries — no login or API key required.

### What does Microsoft Ads Library Scraper do?

This actor lets you programmatically access the [Microsoft Ads Library](https://adlibrary.about.ads.microsoft.com/) to extract advertising data served across the European Economic Area. Use it for competitive intelligence, market research, ad creative analysis, and compliance monitoring.

The Microsoft Ad Library is publicly available but has no bulk export. This actor handles pagination, proxy rotation, and structured data output so you can extract thousands of results in minutes.

#### Key features

- **Search ads** by keyword, advertiser ID, date range, or country
- **Search advertisers** by name to find their advertiser IDs
- **Get full ad details** including impression ranges, country breakdowns, and targeting parameters (gender, age, location, audiences)
- Automatic pagination — scrape up to 1,000 results per run
- Structured JSON output ready for analysis or integration
- Pay-per-event pricing — you only pay for the results you get

### How to use

#### 1. Search Ads

Find ads by keyword, advertiser, date range, or country. Great for monitoring competitor ad copy and discovering what ads are running in specific markets.

**Input example:**

```json
{
  "mode": "searchAds",
  "searchAdText": "cloud computing",
  "countryCodes": ["66"],
  "startDate": "2025-01-01",
  "maxSearchResults": 100
}
```

**Output example:**

```json
{
  "AdId": 83291234567,
  "AdvertiserName": "Contoso Ltd",
  "AdvertiserId": 4295212345,
  "Title": "Enterprise Cloud Computing Solutions",
  "Description": "Scale your business with secure cloud infrastructure. Start your free trial today.",
  "DisplayUrl": "contoso.com",
  "DestinationUrl": "https://www.contoso.com/cloud"
}
```

#### 2. Search Advertisers

Look up advertisers by name to find their IDs, verification status, and registered country. Use the advertiser ID to then search for all their ads.

**Input example:**

```json
{
  "mode": "searchAdvertisers",
  "searchAdvertiserText": "Microsoft",
  "maxSearchResults": 50
}
```

**Output example:**

```json
{
  "AdvertiserId": 4295212599,
  "AdvertiserName": "Microsoft",
  "AdvertiserCountry": "United States",
  "IsVerified": true
}
```

#### 3. Get Ad Details

Retrieve full details for specific ads by their IDs, including impression data, country-level impression breakdowns, and targeting parameters.

**Input example:**

```json
{
  "mode": "getAdDetails",
  "adIds": ["83291234567", "83291234568"]
}
```

**Output example:**

```json
{
  "AdId": 83291234567,
  "AdvertiserName": "Contoso Ltd",
  "AdvertiserId": 4295212345,
  "Title": "Enterprise Cloud Computing Solutions",
  "Description": "Scale your business with secure cloud infrastructure.",
  "DisplayUrl": "contoso.com",
  "DestinationUrl": "https://www.contoso.com/cloud",
  "AdDetails": {
    "StartDate": "2025-01-15",
    "EndDate": "2025-02-28",
    "TotalImpressionsRange": "10k - 50k",
    "ImpressionsByCountry": [
      { "Country": 66, "ImpressionShare": "45.2%" },
      { "Country": 72, "ImpressionShare": "30.1%" }
    ],
    "Targets": [
      { "TargetType": 2, "UsedForExclusion": false },
      { "TargetType": 3, "UsedForExclusion": false }
    ]
  }
}
```

### Input schema

| Field | Type | Description |
|-------|------|-------------|
| `mode` | string | **Required.** One of `searchAds`, `searchAdvertisers`, or `getAdDetails` |
| `maxSearchResults` | integer | Maximum results to return (24–1,000). Default: 1,000 |
| `searchAdText` | string | Keyword to search in ad content (for `searchAds` mode) |
| `advertiserId` | integer | Filter ads by advertiser ID (for `searchAds` mode) |
| `startDate` | string | Filter ads from this date, format `YYYY-MM-DD` (for `searchAds` mode) |
| `endDate` | string | Filter ads until this date, format `YYYY-MM-DD` (for `searchAds` mode) |
| `countryCodes` | array | Filter by EU/EEA country codes (for `searchAds` mode) |
| `includeAdDetails` | boolean | Also fetch full details for each ad found (for `searchAds` mode). Increases cost and runtime |
| `searchAdvertiserText` | string | Keyword to search in advertiser names (for `searchAdvertisers` mode) |
| `adIds` | array | List of ad IDs to retrieve details for (for `getAdDetails` mode) |

#### Supported countries

Austria, Belgium, Bulgaria, Croatia, Cyprus, Czechia, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Iceland, Ireland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Netherlands, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden.

### Output

Results are pushed to the default dataset in structured JSON. The output schema depends on the mode:

- **searchAds** — returns `Ad` objects with `AdId`, `AdvertiserName`, `AdvertiserId`, `Title`, `Description`, `DisplayUrl`, `DestinationUrl`
- **searchAdvertisers** — returns `Advertiser` objects with `AdvertiserId`, `AdvertiserName`, `AdvertiserCountry`, `IsVerified`
- **getAdDetails** — returns `Ad` objects with full `AdDetails` including `StartDate`, `EndDate`, `TotalImpressionsRange`, `ImpressionsByCountry`, and `Targets`

You can download results in JSON, CSV, XML, or Excel format, or access them via the Apify API.

### Use cases

- **Competitive ad intelligence** — Monitor what ads your competitors are running on Microsoft/Bing Search
- **Market research** — Discover which companies are advertising in specific markets or industries
- **Ad creative analysis** — Analyze ad copy, headlines, and landing pages at scale
- **Compliance monitoring** — Track advertiser verification status and ad transparency data
- **Media buying research** — Understand targeting strategies (age, gender, location, audiences) used by advertisers
- **Trend analysis** — Track advertising activity over time with date range filters

### Important notes

- The Microsoft Ad Library only contains ads served in the **EU and EEA** since June 2023
- There may be a **1–3 day delay** before new ads appear in the library
- The API is publicly available and does not require authentication
- Ad details (impressions, targeting) can only be retrieved for individual ads, not in bulk search results — use `includeAdDetails` or `getAdDetails` mode

### Integrations

Connect Microsoft Ads Library Scraper with any cloud service or web app through [integrations on the Apify platform](https://apify.com/integrations). You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, and more. Or you can use [webhooks](https://docs.apify.com/integrations/webhooks) to carry out an action whenever an event occurs.

### Using the Apify API

The Apify API lets you programmatically access the Apify platform. The API is organized around RESTful HTTP endpoints. All requests and responses (including errors) are encoded in JSON. You can retrieve results, manage runs, and integrate this actor into your pipeline. See the [Apify API reference](https://docs.apify.com/api/v2) for full details.

# Actor input Schema

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

Select what you want to scrape from the Microsoft Ads Library

## `maxSearchResults` (type: `integer`):

Maximum total number of results to scrape across all pagination requests

## `advertiserId` (type: `integer`):

Filter ads by specific advertiser ID (AccountId or VerifiedAdvertiserId). Used when mode is 'Search Ads'

## `searchAdText` (type: `string`):

Text to search for in ad content (title, description, etc.)

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

Filter ads that ran on or after this date (format: YYYY-MM-DD)

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

Filter ads that ran on or before this date (format: YYYY-MM-DD)

## `countryCodes` (type: `array`):

Filter ads by EU/EEA countries where they were shown. Select from available countries

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

Retrieve ad details for each ad in the search results (will increase cost and runtime)

## `searchAdvertiserText` (type: `string`):

Text to search for in advertiser names (used when mode is 'Search Advertisers')

## `adIds` (type: `array`):

List of specific Ad IDs to retrieve detailed information for (used when mode is 'Get Ad Details'). Enter one ID per line

## Actor input object example

```json
{
  "mode": "searchAds",
  "maxSearchResults": 1000,
  "searchAdText": "",
  "includeAdDetails": false,
  "searchAdvertiserText": ""
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codebyte/microsoft-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("codebyte/microsoft-ads-library").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 '{}' |
apify call codebyte/microsoft-ads-library --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/d70XbELJH44RT80AY/builds/kh5z2fyFgIRtXlq7d/openapi.json
