# Microsoft Ads Library Scraper - Bing Ads & Advertisers (`hgservices/microsoft-ads-library-scraper`) Actor

Scrape Bing ads from the Microsoft Ad Library by keyword, advertiser or ad URL. Which ads does a competitor run on Bing? Get ad titles, text, landing pages and images, plus run dates, impressions by EU country, targeting and payer. Filter by country and date. No login.

- **URL**: https://apify.com/hgservices/microsoft-ads-library-scraper.md
- **Developed by:** [Harish Garg](https://apify.com/hgservices) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.90 / 1,000 ads

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/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

**Microsoft Ads Library Scraper** extracts **Bing ads from the Microsoft Ad Library**, the public repository of ads that Microsoft showed on Bing in the European Union and the EEA. Search by **keyword**, by **advertiser** (name, ID or page URL) or by **ad URL**. For each ad you get the **title, ad text, display URL, landing page and images**, the **advertiser**, and on request the **first and last shown dates, total impressions, impression share per country, targeting types and who paid**.

**No Microsoft account, login or API token is needed.** Enter your searches and click **Start**. Then download the data as JSON, CSV or Excel, get it through the API that this Actor gives you, run it on a schedule, or ask an AI assistant such as Claude or ChatGPT to get Bing ad data for you.

### Questions this Actor answers

| Question | Input |
|---|---|
| Which ads does my competitor run on Bing? | `{"advertisers": ["Nike - EMEA"]}` or an advertiser ID such as `{"advertisers": ["4295000966"]}` |
| Which Bing ads mention this product, brand or keyword? | `{"searchQueries": ["running shoes"]}` |
| Which ads ran in Germany last month? | `{"searchQueries": ["car insurance"], "countries": ["DE"], "dateFrom": "2026-10-01", "dateTo": "2026-10-31"}` |
| How long did an ad run, and where were its impressions? | `{"adUrls": ["https://adlibrary.ads.microsoft.com/ad/71124924512540"]}`, or `"includeAdDetails": true` for a search |
| Which landing pages and offers does an advertiser test? | `{"advertisers": ["4295000966"], "maxAdsPerSearch": 500}` — see `destination_url`, `title`, `description` |
| What is the advertiser ID of a brand? | `{"advertisers": ["Nike EMEA"]}` — when the name is not exact, a notice lists the closest names and their IDs |
| Bing ads shown outside the EU and EEA | Not available: the library has only ads shown in the EU and EEA |

### What is Microsoft Ads Library Scraper?

Microsoft Ads Library Scraper is an unofficial **Microsoft Ad Library API and scraper**. You give it search words, advertisers or ad links, and it saves **one row for each ad**:

- 📝 **Ad copy:** the title (headline) and the ad text
- 🔗 **Links:** the display URL, the landing page and its domain
- 🖼️ **Images:** the image links of multimedia and shopping ads, with width and height
- 🏢 **Advertiser:** the name, ID and Ad Library page; for advertiser inputs also the country and the verified flag
- 📅 **Run dates** (details): the first and last day with impressions in the EU and EEA
- 📊 **Impressions** (details): the total impressions range and the share of impressions per country
- 🎯 **Targeting** (details): the targeting types (location, age, gender, Microsoft audiences, advertiser audiences) and if each was used to exclude people
- 💳 **Paid for by** (details): who paid for the ad, when not the advertiser

The Actor runs on the Apify platform, so you also get **API access, scheduling, integrations, monitoring and data export** in many formats.

### Why scrape the Microsoft Ad Library?

The Microsoft Ad Library is Microsoft's public record of the ads it showed on Bing in the EU and EEA. Use the data for:

- **Competitor research:** see every ad, headline and landing page that a competitor runs on Bing.
- **Ad copy ideas:** collect the ads of a keyword or product and compare their messages and offers.
- **Market monitoring:** run the same searches every week and follow new ads, countries and landing pages.
- **Agency pitches and audits:** show a client what its competitors run, with dates and impression ranges.
- **Research and compliance:** study ads by country and date, and see who paid for them.

### How to scrape the Microsoft Ad Library

1. Enter search words in **Search words**, advertisers in **Advertisers**, or ad links in **Ad URLs or IDs**.
2. Optional: choose **Countries**, a date range, the **Max ads per input**, and **Include ad details**.
3. Click **Start**, then open the **Output** tab or export the data.

### Input

| Field | Type | Description |
|---|---|---|
| `searchQueries` | list of text | Words to find in the ad title, ad text or advertiser name. One search per line. |
| `advertisers` | list of text | The exact advertiser name as the library lists it (for example `Nike - EMEA`), an advertiser ID (`4295000966`) or an advertiser page (`https://adlibrary.ads.microsoft.com/advertiser/4295000966`). |
| `adUrls` | list of text | An ad page (`https://adlibrary.ads.microsoft.com/ad/71124924512540`) or an ad ID. These ads always have details. |
| `countries` | list of text | Only ads shown in these countries: ISO codes or English names of EU and EEA countries. Empty = all. |
| `dateFrom`, `dateTo` | date | Only ads shown in this date range (YYYY-MM-DD). The library starts on 2023-06-01. |
| `maxAdsPerSearch` | number | The most ads for each search word or advertiser. Default 100. |
| `includeAdDetails` | true/false | Add run dates, impressions, impression share per country, targeting and payer. Default false. |

#### Input example

```json
{
    "searchQueries": ["running shoes"],
    "advertisers": ["Nike - EMEA"],
    "countries": ["DE", "FR"],
    "dateFrom": "2026-10-01",
    "maxAdsPerSearch": 200,
    "includeAdDetails": false
}
```

### Output

Each ad is one row with `type: "ad"`. An example row with details:

```json
{
    "type": "ad",
    "ad_id": "71124924512540",
    "ad_url": "https://adlibrary.ads.microsoft.com/ad/71124924512540",
    "advertiser_name": "Groupe COURIR",
    "advertiser_id": "4295002191",
    "advertiser_url": "https://adlibrary.ads.microsoft.com/advertiser/4295002191",
    "advertiser_country": null,
    "advertiser_verified": null,
    "title": "Retrouvez les dernières collections de vêtements et sneakers Nike dispos sur Courir.com",
    "description": "Commandez dès maintenant vos Nike préférées sur le site Courir. La marque et le style",
    "display_url": "www.courir.com",
    "destination_url": "https://www.courir.com/fr/c/marques/nike/",
    "landing_domain": "courir.com",
    "image_urls": ["https://www.bing.com/th?id=OADD2.7696659001613_1SXY30BGQPUHWVCE19&pid=21.2"],
    "assets": [{"type": "image", "url": "https://www.bing.com/th?id=OADD2.7696659001613_1SXY30BGQPUHWVCE19&pid=21.2", "width": 1080, "height": 1080}],
    "paid_for_by": null,
    "first_shown_date": "2024-07-26",
    "last_shown_date": "2026-11-03",
    "total_impressions": "2.5M - 5M",
    "impressions_by_country": [{"country": "France", "country_code": "FR", "share_percent": 100.0}],
    "targeting": [{"parameter": "Location", "used_for_exclusion": true}],
    "restriction_reason": null,
    "details_scraped": true,
    "details_error": null,
    "position": 1,
    "source": "https://adlibrary.ads.microsoft.com/ad/71124924512540",
    "source_type": "ad_url",
    "scraped_at": "2026-11-06T12:00:00+00:00"
}
```

Without details, the detail fields (`paid_for_by` to `restriction_reason`) are `null`, so every row has the same columns.

#### Output fields

| Field | Description |
|---|---|
| `type` | `ad` for an ad, `notice` for an item that explains an empty result. |
| `ad_id`, `ad_url` | The Microsoft Ad Library ID of the ad and its page in the library. |
| `advertiser_name`, `advertiser_id`, `advertiser_url` | The advertiser. Use the ID in `advertisers` to get every ad of this advertiser. |
| `advertiser_country`, `advertiser_verified` | Where the advertiser is registered, and `true` when Microsoft verified its identity. Filled for inputs in `advertisers` only. |
| `title`, `description` | The headline and the ad text. For ads with several versions, a recent version. |
| `display_url`, `destination_url`, `landing_domain` | The URL shown in the ad, the landing page, and the landing page's domain. |
| `image_urls`, `assets` | The image links. `assets` also gives the width and height. Empty for text ads. |
| `paid_for_by` | Details only. Who paid for the ad, when not the advertiser. |
| `first_shown_date`, `last_shown_date` | Details only. The first and last day with impressions in the EU and EEA (YYYY-MM-DD). |
| `total_impressions` | Details only. The range of impressions in the EU and EEA, for example `250K - 500K`. |
| `impressions_by_country` | Details only. The share of impressions for each country, largest first. |
| `targeting` | Details only. The targeting types (`Location`, `Age`, `Gender`, `MicrosoftAudiences`, `AdvertiserAudiences`) and if each was used to exclude people. |
| `restriction_reason` | Details only. Why Microsoft stopped or restricted the ad, when it did. |
| `details_scraped`, `details_error` | `true` when the row has details, and the reason when the details failed. |
| `position`, `source`, `source_type` | The position of the ad in the results of its input, the input value, and the input type (`keyword`, `search_url`, `advertiser_name`, `advertiser_id`, `advertiser_url`, `ad_url` or `ad_id`). |
| `scraped_at` | When the Actor saved the ad. |

#### Empty results and notices

When an input gives no ad, the dataset gets a free `type: "notice"` item with a `reason`, a `message`, a `suggestion` and the `input`:

| `reason` | Meaning |
|---|---|
| `no_results` | The library has no ads for this input and these filters. |
| `advertiser_not_found` | No advertiser has exactly this name. The suggestion lists the closest names and their IDs. |
| `not_found` | The library has no ad with this ID. |
| `input_rejected` | The value is not a search, an advertiser or a Microsoft Ad Library link. |
| `rate_limited`, `network`, `http_error` | Microsoft did not answer. Run again later. |
| `charge_limit` | The run stopped at your maximum cost per run. |

The run's status message always says how many ads were saved and why any input gave fewer. A run that saves no ads because Microsoft failed ends as **Failed**.

### How to use the Microsoft Ad Library scraper

You can run the Actor from Apify Console, from the Apify API, from your own JavaScript or Python code, or from an AI assistant.

#### Apify Console (no code)

1. Open the Actor and fill in the **Input** tab.
2. Click **Start**. Follow the progress in the **Log** tab.
3. Open the **Output** tab to see the table, or click **Export** to download the data.
4. To repeat the same run, click **Save as a new task**. Add a **Schedule** to the task to follow the same advertisers every week.

#### Microsoft Ad Library API (HTTP)

Run the Actor and get the ads in one request. Replace `YOUR_API_TOKEN` with your token from **Settings → API & Integrations** in Apify Console.

```bash
curl -X POST "https://api.apify.com/v2/acts/hgservices~microsoft-ads-library-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["running shoes"], "maxAdsPerSearch": 50}'
```

The response is a JSON array with one object for each ad. Add `&format=csv` or `&format=xlsx` to the URL to get CSV or Excel.

This request waits for the run to finish, for up to 5 minutes. For large runs, start the run with `POST https://api.apify.com/v2/acts/hgservices~microsoft-ads-library-scraper/runs`. When the run is finished, get the ads from `GET https://api.apify.com/v2/datasets/{defaultDatasetId}/items`.

#### Scrape Bing ads with JavaScript

Install the client with `npm install apify-client`, then run this code:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('hgservices/microsoft-ads-library-scraper').call({
    advertisers: ['Nike - EMEA'],
    maxAdsPerSearch: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const ad of items.filter((item) => item.type === 'ad')) {
    console.log(ad.advertiser_name, ad.title, ad.destination_url);
}
```

#### Scrape Bing ads with Python

Install the client with `pip install apify-client` (version 3.0 or later), then run this code:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("hgservices/microsoft-ads-library-scraper").call(
    run_input={"searchQueries": ["running shoes"], "countries": ["DE"], "maxAdsPerSearch": 100}
)
if run is None:
    raise RuntimeError("The run was not found.")

for ad in client.dataset(run.default_dataset_id).iterate_items():
    if ad["type"] == "ad":
        print(ad["advertiser_name"], ad["title"], ad["destination_url"])
```

#### Claude, ChatGPT and other AI assistants (MCP)

Connect your AI assistant to the **Apify MCP server**. The assistant can then run this Actor for you and answer from the results. Use this server URL to give the assistant this Actor as a tool:

```
https://mcp.apify.com?tools=hgservices/microsoft-ads-library-scraper
```

**Claude (claude.ai and Claude Desktop)**

1. Open **Settings → Connectors**.
2. Click **Add**, then **Add custom connector**.
3. Enter a name, for example `Apify`, and paste the server URL above.
4. Click **Continue**, keep the detected settings, and click **Add**.
5. Sign in to Apify in the browser window that opens.

**ChatGPT**

1. Open **Settings → Apps & Connectors** and click **Create**. If you do not see **Create**, turn on **Developer mode**.
2. Enter a name, for example `apify-mcp`, and paste the server URL above as the **MCP Server URL**.
3. Select **OAuth** for authentication and click **Create**.
4. Sign in to Apify and allow access.
5. In a new chat, click **+**, select **More**, and select your Apify connector.

**Claude Code, Cursor, VS Code and Codex**

- **Claude Code:** run `claude mcp add --transport http apify "https://mcp.apify.com?tools=hgservices/microsoft-ads-library-scraper"`, then run `/mcp` and sign in to Apify.
- **Apify CLI:** run `apify mcp install claude-code --tools hgservices/microsoft-ads-library-scraper`. You can use `cursor`, `vscode` or `codex` in place of `claude-code`.
- **Other MCP clients:** add the server URL as a remote (HTTP) MCP server.

Then ask in plain language, for example:

- *"Which ads does Nike run on Bing in Germany? Show the headlines and landing pages."*
- *"Find Bing ads for 'car insurance' in France from last month and group them by advertiser."*

#### Integrations

Send the results to **Google Sheets, Slack, email, Zapier, Make, n8n, Airbyte** or any **webhook** from the Actor's **Integrations** tab.

### Tips for scraping the Microsoft Ad Library

- **Find the advertiser ID first.** Advertiser names must match exactly. Put a brand name in `advertisers`: if it does not match, the notice item lists the library's closest names with their IDs. Then use the ID.
- **Use words for a market, advertisers for a competitor.** `searchQueries` finds ads from every advertiser that mention the words. `advertisers` gives every ad of one account.
- **Ask for details only when you need them.** Details make the run much slower. Get the ads first, then get the details of the ads you want with `adUrls`.
- **Follow advertisers over time.** Run the same input every week. Each row has `ad_id` and `scraped_at`, so you can see which ads are new.

### Limits

- **EU and EEA only.** The library holds only ads that Microsoft showed in the EU and EEA, since June 2023.
- **Run time.** Without details, 100 ads take about 30 seconds. Details add about 6 to 20 seconds for each ad, so 100 ads with details can take 10 to 30 minutes.
- **Large searches.** Above 1,000 ads for one input, the Actor splits the search by date and then by country, and removes the duplicates. Very large searches can take hours.
- **Representative ad copy.** For ads with several versions, the library shows one recent version.
- **Ranges, not exact numbers.** Impressions are ranges (for example `2.5M - 5M`), as the library gives them. The library does not show spend or clicks.
- **No image files.** The Actor saves the image links, not the files.

### FAQ, disclaimers and support

#### Do I need a Microsoft account or an API token?

No. The Actor reads the public Microsoft Ad Library, which needs no login and no token.

#### Do I need a proxy?

No. You do not need to set a proxy.

#### Why do I get fewer ads than I asked for?

The input has fewer ads for your filters, or the run reached `maxAdsPerSearch` or your maximum cost per run. The status message and the notice items give the reason.

#### Is it legal to scrape the Microsoft Ad Library?

The Microsoft Ad Library is a public transparency tool that the EU Digital Services Act requires. The Actor collects only what the library shows to everyone. You are responsible for how you use the data. If you are not sure, ask a lawyer.

#### I found a problem or need a feature

Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `searchQueries` (type: `array`):

Words to find in the ad title, ad text or advertiser name, one search per line, for example running shoes or nike. Each search gives up to maxAdsPerSearch ads, in the library's order.

## `advertisers` (type: `array`):

Every ad of an advertiser, one per line. Accepted formats: (1) the exact advertiser name as the library lists it, for example Nike - EMEA (if the name does not match exactly, a notice item lists the closest names and their IDs); (2) an advertiser ID, for example 4295000966; (3) an advertiser page, https://adlibrary.ads.microsoft.com/advertiser/4295000966.

## `adUrls` (type: `array`):

Single ads, always with details. Accepted formats: an ad page such as https://adlibrary.ads.microsoft.com/ad/71124924512540, or an ad ID such as 71124924512540.

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

Only ads shown in these countries. ISO codes or English names. The library covers the EU and EEA only: AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE, IS, LI, NO. Leave empty for all of them.

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

Only ads shown on or after this day (YYYY-MM-DD). The library starts on 2023-06-01. Leave empty for no start limit.

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

Only ads shown on or before this day (YYYY-MM-DD). Leave empty for today.

## `maxAdsPerSearch` (type: `integer`):

The most ads to save for each search word or advertiser. One library query gives at most 1,000 ads; above 1,000 the Actor splits the search by date and country and removes duplicates, so large numbers take longer. Each page of 24 ads takes about 6 seconds.

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

Add each ad's first and last shown dates, total impressions range, impression share per country, targeting types and who paid. This takes one more request per ad (about 6 to 20 seconds each) and is charged per ad. Ads from adUrls always have details.

## Actor input object example

```json
{
  "searchQueries": [
    "running shoes"
  ],
  "maxAdsPerSearch": 100,
  "includeAdDetails": false
}
```

# Actor output Schema

## `ads` (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 = {
    "searchQueries": [
        "running shoes"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hgservices/microsoft-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 = { "searchQueries": ["running shoes"] }

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

```

## MCP server setup

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

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/BKVjAhk0WhDRcQXbe/builds/9AwFvpUrsMBG4pD4B/openapi.json
