{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Scraper",
    "description": "LinkedIn Ads Scraper collects ads from the public LinkedIn Ad Library for the companies you name, by country and time range: ad copy, format, creative image links, call to action, advertiser and paying entity. No login needed. Export to JSON, CSV or Excel, or use the API.",
    "version": "0.4",
    "x-build-id": "cYID2t0JT8u8kKgTv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialdataapi~linkedin-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialdataapi-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/socialdataapi~linkedin-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-socialdataapi-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/socialdataapi~linkedin-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-socialdataapi-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": {
          "input": {
            "title": "🔎 Companies to search",
            "type": "array",
            "description": "One entry per advertiser: a company name (for example google or hubspot), a LinkedIn company URL (https://www.linkedin.com/company/hubspot/), or a ready-made LinkedIn Ad Library search URL, which is used as is. The same ad found under two companies is saved once.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "📍 Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "BR",
              "IN",
              "JP",
              "CN",
              "MX",
              "ES",
              "IT",
              "NL",
              "PL",
              "SE",
              "CH",
              "AE",
              "SG",
              "KR",
              "ALL",
              "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": "Show ads that ran in this country. Pick All countries to skip the country filter.",
            "default": "US"
          },
          "dateOption": {
            "title": "📅 When the ads ran",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Time range the ads were active in – the ranges the LinkedIn Ad Library itself offers. Any time removes the date filter.",
            "default": "last-30-days"
          },
          "maxItems": {
            "title": "🔢 How many ads to collect",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on the total number of ads saved across all companies you listed, shared evenly between them. LinkedIn shows 24 ads per page and the Actor reads further pages as needed; a company with fewer matching ads than its share passes the rest to the others. Free plan: up to 20 ads per run (all companies together) and 200 per month; paid plans have no limit.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Optional – leave it off. Every request already goes through Apify residential proxy with a new address each time, which LinkedIn answers. A proxy you select here is used instead; if it cannot be used or LinkedIn refuses it 12 times in a row, the run switches to Apify residential proxy and says so in the log."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}