{
  "openapi": "3.0.1",
  "info": {
    "title": "Bing Ads Library Scraper - Microsoft Ad Library Competitor Ads",
    "description": "Scrape Bing search & shopping ads from the official Microsoft Ad Library (EU/EEA) by advertiser, ID or keyword: headline, description, display & landing URL, images, run dates, impression ranges, country split, payer, targeting. No login. $2 / 1,000 ads.",
    "version": "0.1",
    "x-build-id": "vG7ax55pnwvdqOkwm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/adintel-labs~microsoft-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-adintel-labs-microsoft-ad-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/adintel-labs~microsoft-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-adintel-labs-microsoft-ad-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/adintel-labs~microsoft-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-adintel-labs-microsoft-ad-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "advertisers": {
            "title": "Advertiser names",
            "type": "array",
            "description": "Brand / advertiser names as shown in the Microsoft Ad Library (e.g. Nike, Booking.com). Each name is resolved to its advertiser ID automatically.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms (ad content)",
            "type": "array",
            "description": "Keywords that appear in the ad copy, e.g. \"running shoes\" or \"cloud hosting\".",
            "items": {
              "type": "string"
            }
          },
          "advertiserIds": {
            "title": "Advertiser IDs",
            "type": "array",
            "description": "Numeric Microsoft Ad Library advertiser IDs (from adlibrary.ads.microsoft.com/advertiser/<id>).",
            "items": {
              "type": "string"
            }
          },
          "maxAdvertisersPerName": {
            "title": "Advertiser matches per name",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many matching advertiser accounts to scrape for each name (e.g. 3 = \"Nike - EMEA\", \"Nike Retail\"...).",
            "default": 1
          },
          "dateFrom": {
            "title": "Shown on or after",
            "type": "string",
            "description": "Only ads shown on/after this date (YYYY-MM-DD)."
          },
          "dateTo": {
            "title": "Shown on or before",
            "type": "string",
            "description": "Only ads shown on/before this date (YYYY-MM-DD)."
          },
          "maxResults": {
            "title": "Max ads per query",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum ads returned for EACH advertiser / ID / search term.",
            "default": 50
          },
          "includeDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Fetch each ad's detail record: payer, run dates, total impression range, impression share by country and targeting types (1 extra API call per ad, ~0.6 s). Turn off for fast list-only runs.",
            "default": true
          },
          "includeAiAnalysis": {
            "title": "AI ad-angle analysis (extra event)",
            "type": "boolean",
            "description": "Adds aiAnalysis (angle, hook, offer, audience, emotional triggers, funnel stage) to each ad. Charged per successfully analysed ad only.",
            "default": false
          },
          "llmApiKey": {
            "title": "LLM API key (optional)",
            "type": "string",
            "description": "OpenAI-compatible API key. Leave empty to use the Actor's built-in key (if configured)."
          },
          "llmModel": {
            "title": "LLM model",
            "type": "string",
            "description": "Model name for the OpenAI-compatible endpoint.",
            "default": "gpt-4o-mini"
          },
          "llmBaseUrl": {
            "title": "LLM base URL",
            "type": "string",
            "description": "OpenAI-compatible base URL (OpenAI, OpenRouter, Groq, xAI...).",
            "default": "https://api.openai.com/v1"
          },
          "detailConcurrency": {
            "title": "Detail concurrency",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Parallel detail requests. Microsoft rate-limits bursts per IP, so 1 (sequential, ~0.6 s per ad) is the most reliable.",
            "default": 1
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Official public API - Apify datacenter proxy (default) works; the Actor rotates sessions and auto-upgrades to RESIDENTIAL after repeated 403/429s.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}