{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper — Full Ad Details, No Login",
    "description": "Scrape public LinkedIn Ad Library ads with no login or cookies. Search by company, keyword, or payer. Export ad copy, CTAs, EU impressions, targeting, and the paying entity to JSON or CSV. From $0.55/1,000 ads.",
    "version": "1.0",
    "x-build-id": "iilMWaL4KY5K1hCZ8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/valev-lab~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-valev-lab-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/valev-lab~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-valev-lab-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/valev-lab~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-valev-lab-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": {
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "Advertiser names, company page URLs, or numeric company ids. A name is matched exactly. A numeric id uses companyIds.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words matched against the ad text.",
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "Paying entities",
            "type": "array",
            "description": "The legal entity that paid for the ad, such as HubSpot, Inc.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "ISO-2 codes or English country names. DE is Germany. Leave empty for every country.",
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "all-time",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "A preset window. If you set a start or end date, the run switches to a custom range so LinkedIn honors the dates.",
            "default": "all-time"
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "YYYY-MM-DD, or a relative value such as 30 days. Dates before the 12-month window are moved forward."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "YYYY-MM-DD, or a relative value. A window that ends today is moved to yesterday, because today returns no ads."
          },
          "impressionsMinValue": {
            "title": "Minimum impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Lower bound of the EU impressions range. If you set only one side, the other side is filled so LinkedIn accepts the filter."
          },
          "impressionsMinUnit": {
            "title": "Minimum impressions unit",
            "enum": [
              "none",
              "thousand",
              "million"
            ],
            "type": "string",
            "description": "none is the exact number, thousand multiplies by 1,000, million by 1,000,000.",
            "default": "thousand"
          },
          "impressionsMaxValue": {
            "title": "Maximum impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound of the EU impressions range."
          },
          "impressionsMaxUnit": {
            "title": "Maximum impressions unit",
            "enum": [
              "none",
              "thousand",
              "million"
            ],
            "type": "string",
            "description": "none is the exact number, thousand multiplies by 1,000, million by 1,000,000.",
            "default": "thousand"
          },
          "includedTargetingFacetCategories": {
            "title": "Targeting facets to include",
            "type": "array",
            "description": "Ads that include one of these targeting categories. Combined with a country, LinkedIn may ignore the country.",
            "items": {
              "type": "string",
              "enum": [
                "LANGUAGE",
                "LOCATION",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "COMPANY",
                "EDUCATION",
                "JOB",
                "INTERESTS_AND_TRAITS"
              ]
            }
          },
          "excludedTargetingFacetCategories": {
            "title": "Targeting facets to exclude",
            "type": "array",
            "description": "Ads that exclude one of these targeting categories.",
            "items": {
              "type": "string",
              "enum": [
                "LANGUAGE",
                "LOCATION",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "COMPANY",
                "EDUCATION",
                "JOB",
                "INTERESTS_AND_TRAITS"
              ]
            }
          },
          "searches": {
            "title": "Extra searches",
            "type": "array",
            "description": "Each entry is another search. Omitted filters are copied from the fields above. Use company, keyword, or payer (singular or plural)."
          },
          "adTypes": {
            "title": "Ad formats",
            "type": "array",
            "description": "Keep these formats. Empty keeps every format. The library has no server-side format filter, so a non-empty list reads extra pages.",
            "items": {
              "type": "string",
              "enum": [
                "SINGLE_IMAGE",
                "VIDEO",
                "CAROUSEL",
                "DOCUMENT",
                "TEXT",
                "EVENT",
                "MESSAGE",
                "SPOTLIGHT",
                "THOUGHT_LEADER",
                "FOLLOW_COMPANY",
                "JOB"
              ],
              "enumTitles": [
                "Single image",
                "Video",
                "Carousel",
                "Document",
                "Text",
                "Event",
                "Message",
                "Spotlight",
                "Thought leader",
                "Follow company",
                "Job"
              ]
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Ad Library search URLs are replayed. Ad detail URLs are fetched as single ads. Other URLs are rejected.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "adIds": {
            "title": "Ad IDs",
            "type": "array",
            "description": "Numeric Ad Library ids. Each one is fetched as a detail page.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum ads",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many delivered ads. The default run with no search uses 5.",
            "default": 100
          },
          "maxItemsPerSearch": {
            "title": "Maximum ads per search",
            "minimum": 1,
            "type": "integer",
            "description": "A second cap applied to each company, keyword, payer, or start URL."
          },
          "scrapeAdDetails": {
            "title": "Scrape ad details",
            "type": "boolean",
            "description": "Open each ad. Details add the paying entity, full text, CTA, click URL, and video file for every ad, plus impressions, targeting, and run dates when LinkedIn publishes them (EU ads). Turn this off for a cheaper listing.",
            "default": true
          },
          "includeEmployerBranding": {
            "title": "Include employer branding",
            "type": "boolean",
            "description": "Employer-brand tiles have no ad id. They are included only when the page contains both a company id and a channel id.",
            "default": false
          },
          "includeRelatedAdvertisers": {
            "title": "Include related advertisers",
            "type": "boolean",
            "description": "A company name search otherwise keeps only the exact advertiser. Turn this on to also keep partners shown on the same name search.",
            "default": false
          },
          "includeAdvertiserSummary": {
            "title": "Advertiser summary rows",
            "type": "boolean",
            "description": "Also add one uncharged summary row per advertiser to the dataset. Off keeps the dataset to ads only. The same summary is always saved in the key-value store and linked in the Output tab.",
            "default": false
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Datacenter by default. The first datacenter block switches to residential unless you set proxy groups or your own proxy URLs.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many ad pages to open at once. Each session waits at least 2.5 seconds between its own requests.",
            "default": 3
          },
          "minDelay": {
            "title": "Minimum delay (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Extra wait between requests on one session. The run never goes below 2.5 seconds.",
            "default": 1
          },
          "maxDelay": {
            "title": "Maximum delay (seconds)",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "Upper bound of the random wait on one session.",
            "default": 3
          },
          "debug": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Reserved for extra request logging.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}