{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Scraper (LinkedIn Ad Library)",
    "description": "Scrape LinkedIn ads from the public Ad Library: ad copy, creative, headline, destination URL, run dates, impressions per country and targeting. Search by advertiser, payer or keyword, check which companies run LinkedIn ads, or track new ads.",
    "version": "1.0",
    "x-build-id": "Tt0eu2x6IFm8ck7IH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pulsedata~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pulsedata-linkedin-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/pulsedata~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pulsedata-linkedin-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/pulsedata~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pulsedata-linkedin-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Advertisers or keywords",
            "minItems": 1,
            "type": "array",
            "description": "One entry per line. Accepts advertiser names (e.g. `Salesforce`), LinkedIn company page URLs (`https://www.linkedin.com/company/hubspot`, searched by name), keywords when `Match by` is set to keyword, LinkedIn Ad Library search URLs, or single ad URLs / ad IDs (e.g. `https://www.linkedin.com/ad-library/detail/1552638623`).",
            "items": {
              "type": "string"
            }
          },
          "resultType": {
            "title": "What to return",
            "enum": [
              "ads",
              "advertisers"
            ],
            "type": "string",
            "description": "`ads` returns every ad of each advertiser or keyword. `advertisers` is the ad-check mode: one row per entry with whether it runs LinkedIn ads, how many ads match, the advertisers and formats on the first result page and the three newest ads. It reads one search page per entry and opens no detail pages. Country and date filters apply to the count.",
            "default": "ads"
          },
          "matchBy": {
            "title": "Match by",
            "enum": [
              "advertiser",
              "payer",
              "keyword"
            ],
            "type": "string",
            "description": "`advertiser` searches the LinkedIn page that runs the ad, `payer` the legal entity that paid for it (often the parent company - the precise way to catch every ad of a group), `keyword` searches the ad text.",
            "default": "advertiser"
          },
          "countryCode": {
            "title": "Country",
            "type": "string",
            "description": "Only ads shown in this country, as an ISO 3166-1 alpha-2 code (`us`, `de`, `gb`, …). A country name such as `Germany` is converted to its code. One country per run. Leave empty for all countries.",
            "default": ""
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "Restrict to when the ad ran. Use `custom-date-range` together with the two date fields below.",
            "default": ""
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "Format `YYYY-MM-DD`. `01.08.2026` and `08/01/2026` are converted with a warning in the log. Only used with the custom date range."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "Format `YYYY-MM-DD`. `01.08.2026` and `08/01/2026` are converted with a warning in the log. Only used with the custom date range."
          },
          "maxAdsPerQuery": {
            "title": "Max ads per query",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many ads per advertiser or keyword. Set 0 for no limit (big advertisers run thousands of ads).",
            "default": 100
          },
          "includeDetails": {
            "title": "Include ad details (impressions, targeting, full ad copy)",
            "type": "boolean",
            "description": "Opens each ad's detail page for estimated total impressions, the impression share per country, the advertiser's targeting parameters, the untruncated ad text and the destination URL. One extra request per ad. Costs $3 per 1,000 ads on top of the ad price. Until 2026-10-12 this is charged only for ads that carry impressions or targeting; from 2026-10-13 it is charged for every detail page that loads. Pages that time out or are blocked are free. Turn this off to pay only the ad price.",
            "default": true
          },
          "onlyNewAds": {
            "title": "Only new ads (monitor mode)",
            "type": "boolean",
            "description": "Output and charge only ads this monitor has not delivered on an earlier run. The ad IDs are remembered in a named key-value store in your account, so a scheduled daily or weekly run returns just the ads a competitor launched since the last run. Known ads cost no detail request. Ads seen before still count towards \"Max ads per query\", which sets how far down the list a run looks; set it to 0 to watch every ad. The first run returns everything and fills the store.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Name of the key-value store that remembers delivered ads. Leave empty to name it after the run's targets and filters, so each different input keeps its own history. Set a name to share one history between inputs, or to start over by picking a new one. Letters, digits and hyphens."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "LinkedIn answers datacenter and residential proxies with a challenge page, so this actor uses the Apify Unblocker by default. Only change this if you know your proxies get through.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "UNBLOCKER"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}