{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper - Ads, Copy, CTA & EU Targeting",
    "description": "LinkedIn Ad Library scraper and LinkedIn ads scraper: search by keyword, advertiser or company ID and get ad copy, headline, format, image, video, CTA and landing page with UTM. For ads reported under the EU DSA, add who paid, run dates, impressions by country and targeting. No login.",
    "version": "0.1",
    "x-build-id": "ZmbMIxnJLEgURAbUP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-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/lergassy~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-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/lergassy~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-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",
        "properties": {
          "searchTerms": {
            "title": "🔍 Search terms",
            "type": "array",
            "description": "One search per line. What a line means depends on <b>Search by</b>: a keyword from the ad copy (<code>crm</code>), an advertiser name (<code>hubspot</code>), a payer name, or a LinkedIn company ID (<code>1337</code> or <code>linkedin.com/company/1337</code>). Each line is billed only for the ads it returns.",
            "default": [
              "crm"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "🔎 Search by",
            "enum": [
              "keyword",
              "advertiser",
              "payer",
              "companyId"
            ],
            "type": "string",
            "description": "How to read the search terms. <b>Keyword</b> finds ads whose copy contains the word; <b>Advertiser</b> matches the company or person shown on the ad (partial names match: <code>hubspot</code> also returns HubSpot partners); <b>Payer</b> matches the \"Paid for by\" entity; <b>Company ID</b> returns exactly one company's ads.",
            "default": "keyword"
          },
          "countries": {
            "title": "🌍 Countries",
            "type": "array",
            "description": "Keep only ads shown in these countries — two-letter codes: <code>US</code>, <code>GB</code>, <code>DE</code>, <code>FR</code>… (common country names like <code>Germany</code> work too). Empty = all countries.",
            "items": {
              "type": "string"
            }
          },
          "maxAdsPerSearch": {
            "title": "💯 Ads per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many ads to take from each search line, newest first. LinkedIn serves 24 per page; up to 5,000 per search per run.",
            "default": 24
          },
          "includeDetails": {
            "title": "📊 Add impressions, countries, targeting and landing page to every ad ($)",
            "type": "boolean",
            "description": "Opens each ad's page in the Ad Library: full ad text, who paid, run dates, total impressions and impressions by country, targeted languages and locations, which targeting criteria were used (audience, company, job, demographic…), call-to-action button, landing page URL with its UTM parameters, video file. Impressions and targeting exist only for ads LinkedIn reports under the EU Digital Services Act; for other ads those fields stay empty. Billed as a separate event per ad.",
            "default": false
          },
          "dateRange": {
            "title": "📅 Date range",
            "enum": [
              "any",
              "last-30-days",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Keep only ads that ran in this period. For exact dates use Start date / End date below instead.",
            "default": "any"
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Custom range start, YYYY-MM-DD (for example <code>2026-01-01</code>). Overrides Date range."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Custom range end, YYYY-MM-DD (for example <code>2026-03-31</code>). Overrides Date range."
          },
          "sortOrder": {
            "title": "Order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Newest ads first (LinkedIn's default) or oldest first.",
            "default": "newest"
          },
          "startUrls": {
            "title": "🔗 Ad Library URLs",
            "type": "array",
            "description": "Instead of search terms: paste LinkedIn Ad Library links as you see them in the browser — a search (<code>https://www.linkedin.com/ad-library/search?keyword=crm&countries=US,GB</code>, every filter of the page kept) or a single ad (<code>https://www.linkedin.com/ad-library/detail/1578841044</code>, always returned with details). When URLs are given, Search terms are ignored.",
            "items": {
              "type": "string"
            }
          },
          "onlyNewRowsStore": {
            "title": "🔁 Only new ads — memory name",
            "pattern": "^[A-Za-z0-9-]{0,63}$",
            "type": "string",
            "description": "Give this run a name — <code>my-ads-watch</code> — and the Actor remembers every ad it delivered under that name. Every later run with the same name writes and charges <b>only ads you have not received before</b>. Schedule the Actor daily to get a feed of competitors' new LinkedIn ads instead of the whole list each time. Leave empty to get everything found, every time."
          },
          "maxConcurrency": {
            "title": "Parallel ad pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many ad pages to open at once when details are on. 4 is safe; higher is faster but gets more refusals.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify datacenter proxy by default — LinkedIn's Cloudflare refuses Apify server addresses without a proxy. Residential is not needed; one residential attempt is made automatically only after repeated refusals.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}