{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Scraper: Full Advertiser Ad History",
    "description": "LinkedIn Ads Scraper: Full Advertiser Ad History extracts data from LinkedIn ad campaigns, including ad titles, descriptions, impressions, engagement metrics, and company details. Ideal for marketers and analysts to track competitors and optimize campaigns.",
    "version": "0.1",
    "x-build-id": "JpBnqSgcEcdZWimD7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~linkedin-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-linkedin-ads-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/scraper-engine~linkedin-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-linkedin-ads-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/scraper-engine~linkedin-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-linkedin-ads-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": {
          "advertiserTargets": {
            "title": "🏢 Advertisers to trace",
            "type": "array",
            "description": "Company names, LinkedIn company URLs, or LinkedIn Ad Library search URLs — one per line. Example: hubspot, https://www.linkedin.com/company/microsoft/",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "🌍 Country",
            "enum": [
              "ALL",
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "BR",
              "IN",
              "JP",
              "CN",
              "MX",
              "ES",
              "IT",
              "NL",
              "PL",
              "SE",
              "CH",
              "AE",
              "SG",
              "KR",
              "AF",
              "AL",
              "DZ",
              "AR",
              "AM",
              "AT",
              "AZ",
              "BH",
              "BD",
              "BE",
              "BO",
              "BA",
              "BW",
              "BG",
              "CL",
              "CO",
              "CR",
              "HR",
              "CY",
              "CZ",
              "DK",
              "EC",
              "EG",
              "EE",
              "FI",
              "GR",
              "HK",
              "HU",
              "IS",
              "ID",
              "IE",
              "IL",
              "JO",
              "KZ",
              "KE",
              "KW",
              "LV",
              "LB",
              "LT",
              "LU",
              "MY",
              "MT",
              "MA",
              "NZ",
              "NO",
              "PK",
              "PE",
              "PH",
              "PT",
              "QA",
              "RO",
              "RU",
              "SA",
              "RS",
              "SK",
              "SI",
              "ZA",
              "TH",
              "TR",
              "UA",
              "UY",
              "VN"
            ],
            "type": "string",
            "description": "Only keep ads shown in this country. Choose 'All countries' for the widest history — a single country can cut an advertiser's visible catalogue by two thirds. Default: All countries."
          },
          "maxAdsPerAdvertiser": {
            "title": "📈 Ad budget per advertiser",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many distinct ads to collect for each advertiser before moving on. The sweep also stops on its own once the advertiser's history runs dry. Example: 100 → up to 100 unique ads per company. Leave empty and the run falls back to the overall cap below."
          },
          "historyMonthsBack": {
            "title": "🗓️ How far back to trace (months)",
            "minimum": 1,
            "maximum": 36,
            "type": "integer",
            "description": "Trace this many months of history for each advertiser. Example: 12 → the last year. Default: 12.",
            "default": 12
          },
          "windowSizeDays": {
            "title": "🪟 Window size",
            "enum": [
              "7",
              "14",
              "30",
              "90"
            ],
            "type": "string",
            "description": "The size of each step in the sweep. Smaller windows surface more ads from busy advertisers; larger windows finish faster. Default: 30 days.",
            "default": "30"
          },
          "stopAfterEmptyWindows": {
            "title": "🛑 Stop after this many empty steps",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "End an advertiser's sweep early once this many steps in a row return nothing new. Example: 4 → stop after 4 consecutive empty steps. Default: 4.",
            "default": 4
          },
          "expandCountries": {
            "title": "🧭 Also sweep these countries",
            "type": "array",
            "description": "Two-letter country codes to sweep as extra passes, e.g. JP, BR, DE. Leave empty to skip. Country audiences overlap only partly, so each code can add new ads.",
            "items": {
              "type": "string"
            }
          },
          "expandKeywords": {
            "title": "🔎 Also sweep these ad topics",
            "type": "array",
            "description": "Words that appear in the ad text, e.g. webinar, pricing, demo. Each one runs as an extra pass over the same advertiser. Leave empty to skip.",
            "items": {
              "type": "string"
            }
          },
          "includeCoverageSummary": {
            "title": "🧮 Add a coverage summary row per advertiser",
            "type": "boolean",
            "description": "Adds one extra row per advertiser (type = advertiserCoverage) with the ad-format mix, first/last run dates, and the coverage percentage. Default: on.",
            "default": true
          },
          "input": {
            "title": "🔍 Companies or keywords to search (legacy)",
            "type": "array",
            "description": "Older name for 'Advertisers to trace'. Used only when that field is empty.",
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "📅 Anchor time range (legacy)",
            "enum": [
              "",
              "last-7-days",
              "last-30-days",
              "last-90-days",
              "current-month",
              "this-month",
              "current-year",
              "this-year",
              "last-year"
            ],
            "type": "string",
            "description": "Time range for the first look at each advertiser, before the history sweep starts. 'Any time' gives the widest starting set. Default: Any time."
          },
          "maxItems": {
            "title": "🔢 Overall ad cap across all advertisers (legacy)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Optional hard stop on the total number of ads for the whole run. Leave empty to let 'Ad budget per advertiser' decide."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is recommended. You can also supply your own proxy URLs."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}