{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper",
    "description": "Scrape LinkedIn Ad Library ads by keyword, advertiser, company ID, payer or URL: ad text, format, media, plus optional landing URL, run dates, impressions by country and targeting. No login. Export to JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "n4KieADtTMnyLjfAC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nice_dev~linkedin-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nice_dev-linkedin-ads-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/nice_dev~linkedin-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nice_dev-linkedin-ads-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/nice_dev~linkedin-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nice_dev-linkedin-ads-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": {
          "startUrls": {
            "title": "Start URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "LinkedIn Ad Library links: search-result URLs (`https://www.linkedin.com/ad-library/search?...`, every filter set on the site is kept, pagination is automatic), single ad URLs (`https://www.linkedin.com/ad-library/detail/1649718966`) or company pages with a numeric id (`https://www.linkedin.com/company/2802`). Added to the searches of the fields below: a search URL keeps its own LinkedIn filters, while the Actor's filters, caps and monitoring apply to every ad. Max 1 000 URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "query": {
            "title": "Search keyword",
            "maxLength": 200,
            "type": "string",
            "description": "Words found in the ad text or advertiser, exactly as typed in the Ad Library search box (e.g. `software`). Empty = no keyword (then give an advertiser, a company ID or a payer)."
          },
          "searchQueries": {
            "title": "More search keywords",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Several keywords in one run: one search per keyword. Added to **Search keyword**; ads found by several searches are saved once. All search fields together give at most 500 searches (max 500 searches per run).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "companies": {
            "title": "Advertiser names",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Advertiser (company page) names, as in the Ad Library \"Advertiser\" box (e.g. `HubSpot`): one search per name. LinkedIn matches loosely (similar names come too): tick **Exact advertiser name** to keep only this advertiser, or use **Company IDs**. With a keyword, every keyword is searched for every advertiser. All search fields together give at most 500 searches (max 500 searches per run).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "companyIds": {
            "title": "Company IDs",
            "maxItems": 200,
            "uniqueItems": true,
            "type": "array",
            "description": "LinkedIn company IDs (`68529`) or company URLs with that ID (`https://www.linkedin.com/company/68529`): exact advertiser, no look-alikes. The ID is in the advertiser link of any ad (`advertiserId` in the results, filled with **Ad details**). With keywords, each one is searched for every keyword. All search fields together give at most 500 searches (max 500 searches per run).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "Payer names",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Who paid for the ads (\"Paid for by\" on LinkedIn, e.g. an agency): one search per payer. With keywords, each one is searched for every keyword. All search fields together give at most 500 searches (max 500 searches per run).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "adIds": {
            "title": "Ad IDs",
            "maxItems": 1000,
            "uniqueItems": true,
            "type": "array",
            "description": "Single ads by ID (`1649718966`) or ad URL. Each one is read on its ad page and charged as a result with details.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "resultType": {
            "title": "What to return",
            "enum": [
              "ads",
              "counts"
            ],
            "type": "string",
            "description": "`ads` = one row per ad. `counts` = one row per search with the number of ads LinkedIn finds (1 request per search, no ad rows, charged per search): to size a market or follow an advertiser's volume over time.",
            "default": "ads"
          },
          "maxItems": {
            "title": "Max ads",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of ads to save for the whole run (after deduplication and filters). 0 = no limit. Not used with **What to return** = counts (one row per search).",
            "default": 100
          },
          "maxItemsPerQuery": {
            "title": "Max ads per search",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap for EACH search (keyword, advertiser, company ID, payer or search URL), so that the first search cannot use up the whole **Max ads** budget. 0 = no per-search cap.",
            "default": 0
          },
          "countries": {
            "title": "Countries",
            "maxItems": 250,
            "uniqueItems": true,
            "type": "array",
            "description": "Countries where the ads were shown: ISO codes (`FR`, `DE`, `US`) or English names, plus the groups `EU` (27 EU countries), `EEA`, `DACH`, `NORDICS`. Empty = all countries. Impressions, run dates and targeting are only published for ads shown in the EU / EEA: add an EU country to get them on (almost) every ad.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Period",
            "enum": [
              "all",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom"
            ],
            "type": "string",
            "description": "When the ads ran (LinkedIn filter). `Custom` uses **Ran after** / **Ran before** below. The Ad Library keeps the last 12 months.",
            "default": "all"
          },
          "startDate": {
            "title": "Ran after",
            "type": "string",
            "description": "First day of a custom period (LinkedIn filter): `2026-09-01`, or a period before now such as `30 days`, `3 months`. Filling it sets **Period** to custom. LinkedIn keeps 12 months: an older day is moved to the oldest day kept."
          },
          "endDate": {
            "title": "Ran before",
            "type": "string",
            "description": "Last day of a custom period (included), or a period before now such as `7 days`. Empty = yesterday: LinkedIn has the ads up to yesterday, a later day is moved back to it."
          },
          "impressionsMin": {
            "title": "Min impressions",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Only ads with at least this many impressions (LinkedIn filter on its impression ranges, e.g. `1000`, `100000`). 0 = no minimum. Impressions exist for EU-shown ads only.",
            "default": 0
          },
          "impressionsMax": {
            "title": "Max impressions",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Only ads with at most this many impressions (LinkedIn filter). 0 = no maximum.",
            "default": 0
          },
          "targetingIncludes": {
            "title": "Targeting used",
            "uniqueItems": true,
            "type": "array",
            "description": "Only ads whose advertiser targeted members with these parameter types (LinkedIn filter).",
            "items": {
              "type": "string",
              "enum": [
                "LANGUAGE",
                "LOCATION",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "COMPANY",
                "EDUCATION",
                "JOB",
                "INTERESTS_AND_TRAITS"
              ],
              "enumTitles": [
                "Language",
                "Location",
                "Audience (matched / lookalike)",
                "Demographic",
                "Company",
                "Education",
                "Job",
                "Member interests and traits"
              ]
            },
            "default": []
          },
          "targetingExcludes": {
            "title": "Exclusions used",
            "uniqueItems": true,
            "type": "array",
            "description": "Only ads whose advertiser excluded members with these parameter types (LinkedIn filter).",
            "items": {
              "type": "string",
              "enum": [
                "LANGUAGE",
                "LOCATION",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "COMPANY",
                "EDUCATION",
                "JOB",
                "INTERESTS_AND_TRAITS"
              ],
              "enumTitles": [
                "Language",
                "Location",
                "Audience (matched / lookalike)",
                "Demographic",
                "Company",
                "Education",
                "Job",
                "Member interests and traits"
              ]
            },
            "default": []
          },
          "adFormats": {
            "title": "Ad formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only these formats (read on the ad card; a dropped ad is not saved and not charged as a result). Empty = all formats.",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "carousel",
                "document",
                "article",
                "event",
                "message",
                "text",
                "spotlight",
                "follower",
                "job",
                "other"
              ],
              "enumTitles": [
                "Single image",
                "Video",
                "Carousel",
                "Document",
                "LinkedIn article",
                "Event",
                "Message / conversation (InMail)",
                "Text ad",
                "Spotlight",
                "Follower ad",
                "Job ad",
                "Other formats"
              ]
            },
            "default": []
          },
          "extractDetails": {
            "title": "Ad details (paid option)",
            "type": "boolean",
            "description": "Open each ad page (1 extra request per ad) for what LinkedIn shows only there: full text, landing URL with UTM tags, call to action, all images / video files / carousel cards / document / event / message content, payer, run dates, total impressions (range + min / max numbers), impressions by country, targeting (language, locations, targeted / excluded parameter types). Charged as a result with details instead of a result (see Pricing). Off = ad-card fields only (advertiser, format, start of the text, headline, image).",
            "default": false
          },
          "decodeShortLinks": {
            "title": "Decode lnkd.in links",
            "type": "boolean",
            "description": "With **Ad details**: turn the lnkd.in short links of the ad text into their real address (1 small extra request per link, free). Off = short links as written.",
            "default": true
          },
          "imageText": {
            "title": "Text in images (paid option)",
            "type": "boolean",
            "description": "AI reads the text written in the ad images (offer, dates, brand, call to action): fields **imageText** (main image) and **imageTexts** (every image, up to 10 per ad). Latin-script text only (English, French, German, Spanish, Italian, Portuguese...). Charged per image where text is found, on top of the result (see Pricing); an image without readable text is free. Needs 2 GB of memory (Run options): with less the option is skipped and not charged.",
            "default": false
          },
          "videoTranscript": {
            "title": "Speech in videos (paid option)",
            "type": "boolean",
            "description": "AI writes down what is said in the ad videos (first 60 seconds of sound) into **videoTranscript**, with the language in **videoLanguage**. Charged per video where speech is found, on top of the result with details (see Pricing); music only or no sound = empty and free. The video files are on the ad page, so this option opens each ad page (charged as a result with details). Needs 2 GB of memory (Run options): with less the option is skipped and not charged.",
            "default": false
          },
          "adTags": {
            "title": "Ad tags (paid option)",
            "type": "boolean",
            "description": "AI tags each ad in the field **adTags**: language (ISO 639-1 code), ctaIntent (learn_more, register, download, sign_up, book_demo, contact, buy, apply), offerType (event, content, free_trial, demo, discount, product, job, course), funnelStage (awareness, consideration, conversion), targetFunction (the job the ad speaks to: marketing, sales, engineering, it, hr, finance, executive, operations, legal, customer_service, healthcare, education) and sentiment (English ads only: positive or neutral). Each tag comes with a confidence from 0 to 1, and is null when the Actor is not sure enough. The tags also read the text in images and the speech in videos when those options are on. Charged per ad with at least one tag, on top of the result (see Pricing); an ad with no tag is free. Needs 2 GB of memory (Run options): with less the option is skipped and not charged.",
            "default": false
          },
          "exactAdvertiserMatch": {
            "title": "Exact advertiser name",
            "type": "boolean",
            "description": "With **Advertiser names**: drop the look-alike advertisers LinkedIn adds (names compared without case or accents). Free.",
            "default": false
          },
          "postedAfter": {
            "title": "First shown after",
            "type": "string",
            "description": "Only ads first shown on or after this date: `2026-09-01`, or a period before now such as `7 days`, `2 weeks`. Read on the ad page (run dates are published for EU-shown ads only): with this filter each ad page is opened, so a kept ad comes with all its details and is charged as a result with details (see Pricing); ads without dates are dropped. To filter on LinkedIn's side instead, use **Period**."
          },
          "postedBefore": {
            "title": "First shown before",
            "type": "string",
            "description": "Only ads first shown on or before this date (the whole day is included), or older than a period such as `30 days`."
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Drop the ads whose text, headline or advertiser name contains one of these WHOLE words (case and accents ignored): `ai` drops \"AI tools for teams\" but keeps \"retail\". Several words in one entry (`hand made`) must appear together, in that order. Chinese, Japanese, Korean, Thai, Lao, Khmer and Burmese words are found anywhere in the text (no spaces there). Without **Ad details**, only the start of the text shown on the ad card (about 120 characters) is read.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minDaysRunning": {
            "title": "Min days running",
            "minimum": 0,
            "maximum": 400,
            "type": "integer",
            "description": "Only ads that ran for at least this many days (run dates of the ad page: each page is opened, so a kept ad comes with all its details and is charged as a result with details; ads without dates are dropped). 0 = off.",
            "default": 0
          },
          "activeOnly": {
            "title": "Still running only",
            "type": "boolean",
            "description": "Only ads whose last run day is today or yesterday (run dates of the ad page: each page is opened, so a kept ad comes with all its details and is charged as a result with details; ads without dates are dropped).",
            "default": false
          },
          "onlyNew": {
            "title": "Only new ads",
            "type": "boolean",
            "description": "Skip the ads that a previous run (same **Memory key**) already delivered: they are not saved and not charged, and their page is not even opened (an ad given by **Ad IDs** included). First run = everything is new.",
            "default": false
          },
          "stateKey": {
            "title": "Memory key",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "maxLength": 64,
            "type": "string",
            "description": "Name of the memory used by **Only new ads**. Give each schedule / task its own key (e.g. `hubspot-ads`) so that they do not share their memory. Letters, digits, `-` and `_`.",
            "default": "default"
          },
          "resetState": {
            "title": "Reset the memory",
            "type": "boolean",
            "description": "Forget everything remembered under this **Memory key** before the run: this run returns (and charges) every ad again. Untick it afterwards.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy or your own proxies. Keep the default: it is included in the price. The residential Apify proxy is not available in this Actor.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of requests processed in parallel.",
            "default": 4
          },
          "maxRequestsPerMinute": {
            "title": "Max requests per minute",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Most requests to the site in any 60 seconds, all of them counted: results pages and ad pages. A budget, not an even pace: up to this many can leave at once when the minute starts (spread them with the minimum delay below). Lower it if the site answers HTTP 429 / 403 in the log.",
            "default": 60
          },
          "minRequestIntervalMs": {
            "title": "Min delay between requests",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Smallest gap between two requests, in milliseconds. Unlike the per-minute rate, this spreads the requests evenly instead of letting them go out in a burst. 0 = no gap.",
            "default": 1000
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Retries per request before it is marked as failed. Behind a proxy, a request the site turns away is also retried on a new proxy session up to 10 times without using up these retries.",
            "default": 5
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Include debug messages in the run log.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}