{
  "openapi": "3.0.1",
  "info": {
    "title": "Bing Ad Library Explorer — EU Ad Copy, Reach & Targeting",
    "description": "Query Microsoft's public Bing Ad Library for EU/EEA ads by keyword, advertiser or ad ID. Export ad copy, landing pages, image creatives, run dates, impression bands, per-country reach, targeting and advertiser identity without a login or API key.",
    "version": "1.0",
    "x-build-id": "RgWmR0sB6mPWF16bk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xyrelith-data~bing-ad-library/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xyrelith-data-bing-ad-library",
        "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/xyrelith-data~bing-ad-library/runs": {
      "post": {
        "operationId": "runs-sync-xyrelith-data-bing-ad-library",
        "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/xyrelith-data~bing-ad-library/run-sync": {
      "post": {
        "operationId": "run-sync-xyrelith-data-bing-ad-library",
        "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",
        "required": [
          "mode",
          "queries"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "searchAds",
              "byAdvertiser",
              "searchAdvertisers",
              "byAdIds"
            ],
            "type": "string",
            "description": "Pick what to return.",
            "default": "searchAds"
          },
          "queries": {
            "title": "Queries",
            "type": "array",
            "description": "One per line. searchAds: keywords matched in ad copy. byAdvertiser: advertiser name, numeric ID or /advertiser/ URL. searchAdvertisers: advertiser name or ID. byAdIds: ad ID or /ad/ URL.",
            "default": [
              "nike"
            ],
            "items": {
              "type": "string"
            }
          },
          "advertiserMatch": {
            "title": "Advertiser name matching",
            "enum": [
              "word",
              "contains",
              "exact"
            ],
            "type": "string",
            "description": "How a name query is matched to advertiser accounts in byAdvertiser and searchAdvertisers modes. Whole-word matching avoids brands inside unrelated names.",
            "default": "word"
          },
          "maxAdvertisersPerQuery": {
            "title": "Advertiser accounts per name",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "A brand can have several accounts (per market or agency). Read this many matches per name.",
            "default": 5
          },
          "countries": {
            "title": "EU/EEA markets",
            "type": "array",
            "description": "Only ads shown in these markets. Empty means all 30 EU/EEA countries. Uses Microsoft's numeric country codes internally.",
            "items": {
              "type": "string",
              "enum": [
                "AT",
                "BE",
                "BG",
                "HR",
                "CY",
                "CZ",
                "DK",
                "EE",
                "FI",
                "FR",
                "DE",
                "GR",
                "HU",
                "IS",
                "IE",
                "IT",
                "LV",
                "LI",
                "LT",
                "LU",
                "MT",
                "NL",
                "NO",
                "PL",
                "PT",
                "RO",
                "SK",
                "SI",
                "ES",
                "SE"
              ],
              "enumTitles": [
                "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"
              ]
            },
            "default": []
          },
          "startDate": {
            "title": "Shown from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only ads with an eligible impression on or after this date. The library starts 2023-06-01."
          },
          "endDate": {
            "title": "Shown until (YYYY-MM-DD)",
            "type": "string",
            "description": "Only ads with an eligible impression on or before this date. Data can lag by 1-3 days."
          },
          "adFormat": {
            "title": "Creative format",
            "enum": [
              "all",
              "text",
              "image"
            ],
            "type": "string",
            "description": "Filter list results by the ad's image assets.",
            "default": "all"
          },
          "landingDomains": {
            "title": "Landing-page domains",
            "type": "array",
            "description": "Keep ads whose destination URL is on one of these domains, e.g. nike.com. Ads without a destination URL pass through.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "adKeywordFilter": {
            "title": "Ad text filter",
            "type": "string",
            "description": "Keep ads whose title, description or display URL contains every word here. Useful for narrowing an advertiser's ads to a product or theme.",
            "default": ""
          },
          "includeDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Adds first/last shown dates, days active, the EU impression band with numeric bounds, per-country impression share, targeting types with exclusion flags, paid-for-by and any restriction reason. One extra request per ad.",
            "default": false
          },
          "includeAdvertiserProfile": {
            "title": "Add advertiser country and verification",
            "type": "boolean",
            "description": "Adds the advertiser's registered country and verified flag to each ad. Uses one cached lookup per distinct advertiser, capped by the next field.",
            "default": false
          },
          "maxAdvertiserProfiles": {
            "title": "Advertiser profile lookup cap",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum distinct advertiser profiles to look up per run. 0 means no cap.",
            "default": 100
          },
          "rehostImages": {
            "title": "Rehost non-Bing images",
            "type": "boolean",
            "description": "Downloads image assets hosted outside bing.com into this run's key-value store and emits public URLs plus originalUrl. Bing-hosted images stay as they are. Up to 100 images per run.",
            "default": false
          },
          "deepSearch": {
            "title": "Search past the 1,000-ad cap",
            "type": "boolean",
            "description": "When a query reaches Microsoft's 1,000-result limit, repeat it by country and then by month, deduplicating by ad ID. Slower and uses more requests.",
            "default": false
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Total records to return: ads in ad modes, advertiser rows in searchAdvertisers mode.",
            "default": 1000
          },
          "maxAdsPerQuery": {
            "title": "Max ads per query or advertiser",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Per-query cap. 0 uses the remaining global budget, up to Microsoft's 1,000-ad limit per unsliced query.",
            "default": 0
          },
          "onlyNewAds": {
            "title": "Only ads not seen before",
            "type": "boolean",
            "description": "Stores delivered ad IDs in a named key-value store and emits only ads this store has not delivered yet. Applies to the three ad modes.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Key-value store that remembers delivered ad IDs. Use a separate name per schedule. Lowercase letters, digits and hyphens only.",
            "default": "bing-ad-library-monitor"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}