# Microsoft Ads Library Scraper (`parsebird/microsoft-ads-library-scraper`) Actor

Scrape the Microsoft Ad Library (Bing Ads): search ads by keyword, advertiser, date and EU/EEA country, find advertisers, and get ad details with impressions by country and targeting.

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

## Pricing

from $0.99 / 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/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

**Microsoft Ads Library Scraper** extracts ads from the [Microsoft Ad Library](https://adlibrary.ads.microsoft.com/), the public archive of ads shown on Bing in the European Union and the European Economic Area. Get ad titles, descriptions, display and landing page URLs, images, advertisers, the entity that paid for each ad, run dates, total impressions, impressions by country and targeting, as clean JSON, CSV or Excel.

<table><tr>
<td style="border-left:4px solid #0078D4;padding:12px 16px;font-weight:600">
Search Bing ads by keyword, advertiser ID, date range and any of 30 EU/EEA countries, look up advertisers by name, or pull full details for ad IDs. Duplicate rows are removed, and when a search with several countries hits the Ad Library's 1,000-row limit, the Actor searches those countries one by one to find more ads.
</td>
</tr></table>

<br>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
Apify Actor: parsebird/microsoft-ads-library-scraper. Scrapes the Microsoft Ad Library (adlibrary.ads.microsoft.com), the archive of Bing ads served in the EU/EEA. Call via ApifyClient: client.actor("parsebird/microsoft-ads-library-scraper").call(run_input={"mode": "searchAds", "searchAdText": "cloud computing", "countryCodes": ["66"], "startDate": "2025-01-01", "maxSearchResults": 100, "includeAdDetails": false}). Inputs: mode (required: "searchAds" | "searchAdvertisers" | "getAdDetails", default searchAds), maxSearchResults (integer 1-5000, default 100, unique ads or advertisers), searchAds inputs: searchAdText (keyword in ad text, optional), advertiserId (integer, optional), startDate and endDate (YYYY-MM-DD, ads that ran during the range), countryCodes (array of Ad Library country codes: 10 Austria, 14 Belgium, 26 Bulgaria, 49 Croatia, 207 Cyprus, 51 Czechia, 53 Denmark, 61 Estonia, 65 Finland, 66 France, 72 Germany, 76 Greece, 88 Hungary, 89 Iceland, 92 Ireland, 93 Italy, 104 Latvia, 107 Liechtenstein, 108 Lithuania, 109 Luxembourg, 115 Malta, 129 Netherlands, 139 Norway, 151 Poland, 152 Portugal, 226 Romania, 165 Slovakia, 167 Slovenia, 170 Spain, 175 Sweden), includeAdDetails (boolean, default false); searchAdvertisers input: searchAdvertiserText (advertiser name); getAdDetails input: adIds (array of ad IDs or https://adlibrary.ads.microsoft.com/ad/<id> URLs); concurrency (1-32, default 10), proxyConfiguration (default Apify Proxy). Output for ads: AdId, AdUrl, AdvertiserName, AdvertiserId, AdvertiserUrl, Title, Description, DisplayUrl, DestinationUrl, Assets [{AssetType, AssetUrl, Width, Height}], AdDetails (null unless details were fetched: PaidForByName, StartDate, EndDate, TotalImpressionsRange, ImpressionsByCountry [{Country, ImpressionShare}], Targets [{TargetType, UsedForExclusion}], IsRemoved, Rejection), scrapedAt. Output for advertisers: AdvertiserId, AdvertiserName, AdvertiserCountry, IsVerified, AdvertiserUrl, scrapedAt. Pricing: pay per event, "search-result" per ad or advertiser found by a search, "ad-details" per ad with details. Full API spec: https://apify.com/parsebird/microsoft-ads-library-scraper/api. Get your token: https://console.apify.com/settings/integrations.
```

### What is Microsoft Ads Library Scraper?

**Microsoft Ads Library Scraper** turns the [Microsoft Ad Library](https://adlibrary.ads.microsoft.com/) into a structured dataset. The Ad Library is where Microsoft Advertising publishes the ads it served on Bing in the EU and EEA, with who paid for them, how often they were shown in each country, and how they were targeted. It covers ads that served in the EEA in the past year.

The easiest way to try it: keep the **Search ads** mode, type a keyword such as `cloud computing` and click **Start**. It works as a **Microsoft Ad Library API alternative**: no Microsoft Advertising account, API key or coding needed, and you get the data in a spreadsheet-ready format.

### What can Microsoft Ads Library Scraper do?

- 🔎 **Search ads.** Filter Bing ads by keyword, advertiser ID, start and end date, and one or more of the 30 EU/EEA countries.
- 🏢 **Search advertisers.** Find advertisers by name and get their advertiser ID, registered country and verification status.
- 📋 **Get ad details by ID.** Paste ad IDs or Ad Library ad URLs to get paid-for-by, run dates, impressions and targeting.
- 📊 **Optional details for every ad in a search.** Turn on **Include ad details** to add impressions by country and targeting to search results.
- 🧹 **Unique ads only.** The Ad Library often returns the same ad several times in one search. The Actor removes duplicates, so you don't pay twice.
- 🌍 **Past the 1,000-row limit.** One Ad Library search returns at most 1,000 rows. If you select several countries and the search hits that limit, the Actor searches each country one by one to find more ads.
- 📅 **Scheduling.** Run daily or weekly with [Apify Schedules](https://docs.apify.com/platform/schedules) to track competitors' new Bing ads.
- 🔌 **API and integrations.** Use the [Apify API](https://docs.apify.com/api/v2), or send results to Google Sheets, Zapier, Make, Slack or webhooks with [Apify integrations](https://docs.apify.com/platform/integrations). Export as JSON, CSV, Excel, XML or HTML.

### What data can you extract from the Microsoft Ad Library?

| Field | Description |
|-------|-------------|
| `AdId`, `AdUrl` | Ad Library ad ID and the ad's page in the Ad Library |
| `AdvertiserName`, `AdvertiserId`, `AdvertiserUrl` | Advertiser that ran the ad and its Ad Library page |
| `Title`, `Description` | Ad headline(s) and description text |
| `DisplayUrl`, `DestinationUrl` | URL shown in the ad and the landing page it links to |
| `Assets` | Images used by the ad, with URL, width and height (empty for text-only ads) |
| `AdDetails.PaidForByName` | Entity that paid for the ad, when it differs from the advertiser |
| `AdDetails.StartDate`, `AdDetails.EndDate` | First and last day the ad was shown |
| `AdDetails.TotalImpressionsRange` | Estimated total impressions in the EEA, e.g. `5K - 10K` |
| `AdDetails.ImpressionsByCountry` | Estimated share of impressions per EEA country |
| `AdDetails.Targets` | Targeting types used (`Location`, `Age`, `Gender`, `MicrosoftAudiences`, `AdvertiserAudiences`) and whether each was used to include or exclude people |
| `AdDetails.IsRemoved`, `AdDetails.Rejection` | Whether Microsoft removed the ad for a policy violation, and the reason |
| `AdvertiserCountry`, `IsVerified` | Advertiser's country and verification status (Search advertisers mode) |

### How to scrape the Microsoft Ad Library

1. Open [Microsoft Ads Library Scraper](https://apify.com/parsebird/microsoft-ads-library-scraper) in Apify Console and sign in (or create a free account).
2. Pick a **Mode**: **Search ads**, **Search advertisers** or **Get ad details by ID**.
3. For **Search ads**, enter a **Keyword**, an **Advertiser ID**, dates and **Countries**, or any mix of them. Turn on **Include ad details** if you need impressions and targeting.
4. For **Search advertisers**, enter an **Advertiser name**. Copy the `AdvertiserId` of the one you want and use it in **Search ads** to get all of its ads.
5. For **Get ad details by ID**, paste ad IDs or URLs such as `https://adlibrary.ads.microsoft.com/ad/73598874340208`.
6. Set **Max results**, click **Start**, then download the data from the **Output** tab as JSON, CSV or Excel, or read it through the API.

### How much does it cost to scrape the Microsoft Ad Library?

Microsoft Ads Library Scraper uses **pay-per-event** pricing. Compute and proxy costs are included in the event prices; there are no other usage charges for the run.

| Event | When it's charged | Free | Bronze | Silver | Gold |
|-------|-------------------|------|--------|--------|------|
| `search-result` | Each unique ad or advertiser found by a search | $0.00199 | $0.00169 | $0.00139 | $0.00099 |
| `ad-details` | Each ad saved with details (Include ad details, or Get ad details by ID) | $0.00249 | $0.00229 | $0.00199 | $0.00179 |
| Per 1,000 search results | | **$1.99** | **$1.69** | **$1.39** | **$0.99** |
| Per 1,000 ad details | | **$2.49** | **$2.29** | **$1.99** | **$1.79** |

For example, on the Free plan 1,000 ads from a search cost $1.99. With **Include ad details** on, each ad is charged both events, so 1,000 ads cost $1.99 + $2.49 = $4.48. In **Get ad details by ID** mode, each found ad costs only the `ad-details` event ($2.49 per 1,000). If an ad's details can't be loaded, it's saved without them and only the search result is charged. Set a maximum cost per run in Apify Console and the Actor stops when it's reached.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `mode` | string | **Yes** | `searchAds` | `searchAds`, `searchAdvertisers` or `getAdDetails` |
| `maxSearchResults` | integer | No | `100` | Maximum unique ads or advertisers to return (1-5,000) |
| `searchAdText` | string | No | — | Keyword to find in ad text (searchAds) |
| `advertiserId` | integer | No | — | Only ads from this advertiser (searchAds) |
| `startDate` | string | No | — | Ads shown on or after this date, `YYYY-MM-DD` (searchAds) |
| `endDate` | string | No | — | Ads shown on or before this date, `YYYY-MM-DD` (searchAds) |
| `countryCodes` | string\[] | No | all | EU/EEA country codes, e.g. `["66", "72"]` for France and Germany (searchAds) |
| `includeAdDetails` | boolean | No | `false` | Also get details for every ad found (searchAds) |
| `searchAdvertiserText` | string | Yes, for searchAdvertisers | — | Text to find in advertiser names |
| `adIds` | string\[] | Yes, for getAdDetails | — | Ad IDs or Ad Library ad URLs |
| `concurrency` | integer | No | `10` | Requests sent at the same time (1-32) |
| `proxyConfiguration` | object | No | Apify Proxy | Proxy settings |

**Country codes:** 10 Austria, 14 Belgium, 26 Bulgaria, 49 Croatia, 207 Cyprus, 51 Czechia, 53 Denmark, 61 Estonia, 65 Finland, 66 France, 72 Germany, 76 Greece, 88 Hungary, 89 Iceland, 92 Ireland, 93 Italy, 104 Latvia, 107 Liechtenstein, 108 Lithuania, 109 Luxembourg, 115 Malta, 129 Netherlands, 139 Norway, 151 Poland, 152 Portugal, 226 Romania, 165 Slovakia, 167 Slovenia, 170 Spain, 175 Sweden. These are the codes the Ad Library uses.

Search ads:

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

Search advertisers:

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

Get ad details:

```json
{
    "mode": "getAdDetails",
    "adIds": ["73598874340208", "71056171137215"]
}
```

### Output example

An ad from **Search ads** (without details):

```json
{
    "AdId": 84456823185044,
    "AdUrl": "https://adlibrary.ads.microsoft.com/ad/84456823185044",
    "AdvertiserName": "Microsoft",
    "AdvertiserId": 4295212599,
    "AdvertiserUrl": "https://adlibrary.ads.microsoft.com/advertiser/4295212599",
    "Title": "Copilot+ PCs",
    "Description": "From to-do to done",
    "DisplayUrl": "www.microsoft.com",
    "DestinationUrl": "https://www.microsoft.com/windows/copilot-plus-pcs?ocid=CGE_inp_Devices_CopilotPlus_PC_Launch_868drp455&form=M5006X",
    "Assets": [
        { "AssetType": "Image", "AssetUrl": "https://www.bing.com/th?id=OADD2.10239338869416_1XRO25625EPP8REW1&pid=21.2", "Width": 452, "Height": 452 },
        { "AssetType": "Image", "AssetUrl": "https://www.bing.com/th?id=OADD2.10239341218582_1T5RN9J5JGD3NMFB7&pid=21.2", "Width": 1187, "Height": 771 }
    ],
    "AdDetails": null,
    "scrapedAt": "2026-10-19T05:45:19.688Z"
}
```

An ad with details (**Include ad details** or **Get ad details by ID**):

```json
{
    "AdId": 73598874340208,
    "AdUrl": "https://adlibrary.ads.microsoft.com/ad/73598874340208",
    "AdvertiserName": "Panther Holding GmbH",
    "AdvertiserId": 4295239417,
    "AdvertiserUrl": "https://adlibrary.ads.microsoft.com/advertiser/4295239417",
    "Title": "On Cloud Cloud 6 im Sale - Günstige On Cloud Cloud 6 zu Top-Preisen - Versandkostenfrei möglich",
    "Description": "On Cloud Cloud 6 rund um die Uhr online kaufen.. Einfach anziehend.",
    "DisplayUrl": "www.purefashion.de/laufschuhe/preisvergleich",
    "DestinationUrl": "https://www.purefashion.de/trends?q=on+cloud+cloud+6",
    "Assets": [],
    "AdDetails": {
        "PaidForByName": "Idealo internet GmbH",
        "StartDate": "2024-10-11",
        "EndDate": "2026-10-17",
        "TotalImpressionsRange": "5K - 10K",
        "ImpressionsByCountry": [
            { "Country": "Germany", "ImpressionShare": "100.0%" }
        ],
        "Targets": [
            { "TargetType": "Location", "UsedForExclusion": false }
        ],
        "IsRemoved": false,
        "Rejection": null
    },
    "scrapedAt": "2026-10-19T06:30:38.239Z"
}
```

An advertiser from **Search advertisers**:

```json
{
    "AdvertiserId": 4295212599,
    "AdvertiserName": "Microsoft",
    "AdvertiserCountry": "United States",
    "IsVerified": true,
    "AdvertiserUrl": "https://adlibrary.ads.microsoft.com/advertiser/4295212599",
    "scrapedAt": "2026-10-19T05:44:56.658Z"
}
```

Download the dataset in JSON, CSV, Excel, XML or HTML from the **Output** tab. The Console has separate table views for ads, ad details and advertisers.

### Use the Microsoft Ads Library Scraper API

Start the Actor and read its results from your own code with the Apify API clients. Find your token in [Apify Console → Settings → Integrations](https://console.apify.com/settings/integrations).

**Python** ([apify-client](https://docs.apify.com/api/client/python/)):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("parsebird/microsoft-ads-library-scraper").call(run_input={
    "mode": "searchAds",
    "searchAdText": "running shoes",
    "countryCodes": ["72", "129"],
    "startDate": "2026-01-01",
    "maxSearchResults": 300,
    "includeAdDetails": True,
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    details = ad["AdDetails"] or {}
    print(ad["AdvertiserName"], ad["Title"], details.get("TotalImpressionsRange"))
```

**JavaScript** ([apify-client](https://docs.apify.com/api/client/js/)):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('parsebird/microsoft-ads-library-scraper').call({
    mode: 'searchAds',
    advertiserId: 4295212599,
    maxSearchResults: 500,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((ad) => console.log(ad.Title, ad.DisplayUrl, ad.DestinationUrl));
```

### Use cases

- **Competitive ad intelligence:** see which ads competitors run on Bing in Europe, with copy and landing pages.
- **Ad copy research:** collect headlines and descriptions for a keyword to find angles and offers that others use.
- **Market research:** discover which companies advertise for a topic in a given country.
- **Reach analysis:** compare estimated impressions and country splits across ads and advertisers.
- **Targeting insight:** see whether advertisers use location, age, gender or audience targeting, and what they exclude.
- **Compliance and transparency:** track paid-for-by entities, advertiser verification and ads Microsoft removed for policy violations.
- **Monitoring:** schedule a run to catch new ads for your brand terms or competitors.

### How it works

1. The Actor sends your filters to the Microsoft Ad Library, the same source the [Ad Library website](https://adlibrary.ads.microsoft.com/) uses, and pages through the results (24 per page).
2. Duplicate rows are dropped, so each ad or advertiser is saved and charged once.
3. If a search with several selected countries returns the maximum of 1,000 rows and you need more, it repeats the search for each of those countries, one at a time, and adds the new ads it finds.
4. With **Include ad details** on, or in **Get ad details by ID** mode, it loads each ad's details: paid-for-by, dates, impressions and targeting.
5. The Ad Library allows only about 10 requests per minute from one IP address, so requests are spread over Apify Proxy IPs. That cost is included in the price.

### FAQ

**Which ads are in the Microsoft Ad Library?**
Ads that Microsoft Advertising served on Bing in the EU and EEA. The Ad Library shows ads that served there in the past year; ads that haven't served in the EEA in the past year return "not found". The impressions and country data cover EEA countries only.

**Why do I get fewer ads than the search says match?**
The Ad Library returns at most 1,000 rows per search, and many rows repeat the same ad. In our tests, a search for `cloud` returned 1,008 rows but only 563 unique ads. The Actor removes the repeats. To get more ads, select several countries (the Actor then searches each one separately), or split your search by date range or advertiser ID.

**How long does a run take?**
In our tests on Apify, 50 ads from a search took between 5 and 90 seconds, 100 ads with details about 45 seconds, and 500 ads with details about 4 minutes. The Ad Library is sometimes slow to answer a search it hasn't seen recently (especially with country or date filters) and returns errors until the results are ready; the Actor waits and retries automatically.

**How do I get all ads from one advertiser?**
Run **Search advertisers** with the advertiser's name, copy its `AdvertiserId`, then run **Search ads** with that ID in **Advertiser ID**. You can also copy the ID from the advertiser's page URL, for example `https://adlibrary.ads.microsoft.com/advertiser/4295212599`.

**How do the date filters work?**
**Start date** keeps ads that were still shown on or after that date, and **End date** keeps ads that started on or before it. Together they return ads that ran at some point during the range.

**Why is `AdDetails` null?**
Details are fetched only when **Include ad details** is on, or in **Get ad details by ID** mode. Search results alone don't include impressions, dates or targeting.

**Why is `PaidForByName` empty for some ads?**
The Ad Library shows a paid-for-by entity only for some ads. In our tests, 35 of 100 ads with details had one.

**Why is `Assets` empty for some ads?**
Text-only search ads have no images, so `Assets` is empty for them. It lists the ad's images when it has them.

**Can I schedule runs and connect them to other tools?**
Yes. Use [Apify Schedules](https://docs.apify.com/platform/schedules) for recurring runs and [integrations](https://docs.apify.com/platform/integrations) for Google Sheets, Slack, Zapier, Make, n8n or webhooks. Results are also available through the [API](https://apify.com/parsebird/microsoft-ads-library-scraper/api).

**Something doesn't work or a field is missing?**
Open an issue on the Actor's **Issues** tab with the input you used, and we'll look into it.

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

This Actor collects ad information that Microsoft publishes in its public Ad Library for advertising transparency. The data is about ads and advertisers, not private individuals, but you are still responsible for how you use it: follow Microsoft's terms of use and the laws that apply to you, such as the GDPR if you process any personal data. Read more in Apify's blog post [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/), and ask a lawyer if you're unsure.

### Other ad library scrapers

| Actor | What it does |
|-------|-------------|
| [Meta | Facebook Ads Library Scraper](https://apify.com/parsebird/facebook-ads-library-scraper) | Facebook and Instagram ads from the Meta Ad Library |
| [Google Ads Transparency Center Scraper](https://apify.com/parsebird/google-ads-transparency-scraper) | Ads from the Google Ads Transparency Center by domain, keyword or advertiser |
| [LinkedIn Ads Library Scraper](https://apify.com/parsebird/linkedin-ads-library-scraper) | LinkedIn ads with copy, creative, impressions and targeting |
| [Snapchat Ads Library Scraper](https://apify.com/parsebird/snapchat-ads-scraper) | Snapchat ads from the Snap Ads Gallery with impressions by country and targeting |
| [TikTok Ads Scraper](https://apify.com/parsebird/tiktok-ads-scraper) | TikTok Top Ads from Creative Center by country, industry, objective and ad format |
| [TikTok Top Ads Scraper](https://apify.com/parsebird/tiktok-top-ads-scraper) | Top-performing TikTok ads from TikTok Creative Center |

# Changelog

This Actor's version history is a separate document: https://apify.com/parsebird/microsoft-ads-library-scraper/changelog.md

# Actor input Schema

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

Choose what to get: ads matching your filters, advertisers matching a name, or full details for ad IDs you already have.

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

Maximum number of unique ads or advertisers to return. One Ad Library search returns at most 1,000 rows, and some rows repeat the same ad. If you select several countries, the Actor searches them one by one to find more ads.

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

Find ads whose text contains this keyword (e.g. cloud computing). Leave empty to browse all ads matching the other filters.

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

Only return ads from this advertiser. Get the ID with the 'Search advertisers' mode or from an advertiser page URL (adlibrary.ads.microsoft.com/advertiser/4295212599).

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

Only return ads shown on or after this date (YYYY-MM-DD).

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

Only return ads shown on or before this date (YYYY-MM-DD).

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

Only return ads shown in these EU/EEA countries. Leave empty for all 30 countries.

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

Also open each ad to get the paid-for-by entity, start and end dates, total impressions, impressions by country, targeting types and removal reason. Slower, and each ad is also billed as an ad details event.

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

Find advertisers whose name contains this text (e.g. Microsoft). Used in the 'Search advertisers' mode.

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

Add ad IDs (e.g. 73598874340208) or ad URLs (https://adlibrary.ads.microsoft.com/ad/73598874340208). Used in the 'Get ad details by ID' mode.

## `concurrency` (type: `integer`):

Number of requests sent at the same time when a proxy is used. Leave empty for the default (10).

## `proxyConfiguration` (type: `object`):

The Ad Library allows only about 10 requests per minute from one IP address, so the Actor spreads requests over Apify Proxy IPs. Without a proxy, runs are much slower.

## Actor input object example

```json
{
  "mode": "searchAds",
  "maxSearchResults": 50,
  "searchAdText": "cloud computing",
  "includeAdDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "mode": "searchAds",
    "maxSearchResults": 50,
    "searchAdText": "cloud computing",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/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 = {
    "mode": "searchAds",
    "maxSearchResults": 50,
    "searchAdText": "cloud computing",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/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 '{
  "mode": "searchAds",
  "maxSearchResults": 50,
  "searchAdText": "cloud computing",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call parsebird/microsoft-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsebird/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/4mZB8LUiOw5C8JmpQ/builds/8s8F6IdIzPsRpP8c0/openapi.json
