{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper — B2B Copy, Video & EU [$3/1K]",
    "description": "[$3.00/1K] Fast, zero-browser LinkedIn Ad Library scraper. Extract B2B ad copy, headlines, CTAs, direct MP4 video streams, carousel slides, Thought Leader creators, verified payers, landing URLs & EU DSA reach.",
    "version": "1.4",
    "x-build-id": "vcSM5haDYHoO72ZfO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/appropriate_ideal_ksi~linkedin-ad-library-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-appropriate_ideal_ksi-linkedin-ad-library-pro",
        "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/appropriate_ideal_ksi~linkedin-ad-library-pro/runs": {
      "post": {
        "operationId": "runs-sync-appropriate_ideal_ksi-linkedin-ad-library-pro",
        "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/appropriate_ideal_ksi~linkedin-ad-library-pro/run-sync": {
      "post": {
        "operationId": "run-sync-appropriate_ideal_ksi-linkedin-ad-library-pro",
        "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": {
          "companyNames": {
            "title": "Company / Advertiser Names",
            "type": "array",
            "description": "List of company or advertiser names to extract LinkedIn Ads for (e.g. 'Notion', 'HubSpot', 'Salesforce', 'Stripe').",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords or Phrases",
            "type": "array",
            "description": "Search LinkedIn Ads containing specific words or phrases in ad copy or headlines (e.g. 'crm', 'ai agent', 'soc 2').",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Direct LinkedIn Ad Library or Company URLs",
            "type": "array",
            "description": "Paste any linkedin.com/ad-library/search..., linkedin.com/ad-library/detail/<id>, or linkedin.com/company/<slug> URLs directly.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Target Countries (ISO-2)",
            "type": "array",
            "description": "Optional ISO-2 country codes where ads were served (e.g. ['US', 'GB', 'DE', 'FR']). Leave empty for all countries worldwide.",
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Date Range Filter",
            "enum": [
              "ALL",
              "last-30-days",
              "current-month",
              "cur-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "Filter ads by impression recency, or select ALL to return all available LinkedIn Ad Library records.",
            "default": "ALL"
          },
          "startDate": {
            "title": "Custom Start Date (YYYY-MM-DD)",
            "type": "string",
            "description": "Start date in YYYY-MM-DD format (required when Date Range Filter is 'custom-date-range')."
          },
          "endDate": {
            "title": "Custom End Date (YYYY-MM-DD)",
            "type": "string",
            "description": "End date in YYYY-MM-DD format (required when Date Range Filter is 'custom-date-range')."
          },
          "combineCompanyAndKeywords": {
            "title": "Combine Companies × Keywords",
            "type": "boolean",
            "description": "When enabled and both Company Names and Keywords are provided, searches each (Company + Keyword) combination together instead of running them as separate targets.",
            "default": false
          },
          "maxAdsPerTarget": {
            "title": "Max Ads per Company / Keyword",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of unique LinkedIn Ads to extract per company, keyword, or start URL (Free Apify plan preview: up to 25/run; Paid Apify plans: up to 10,000/target).",
            "default": 25
          },
          "maxTotalAds": {
            "title": "Global Max Total Ads (Entire Run — Optional)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Optional hard global ceiling on total ads emitted across the entire run. Leave empty for no global cap beyond Max Ads per Company / Keyword."
          },
          "includeAdDetails": {
            "title": "Include Full Copy, MP4 Video, Payer & EU/DSA Reach",
            "type": "boolean",
            "description": "Fetches each ad's detail page for untruncated body copy, verified payer entity, external landing URL, direct MP4 video stream, carousel cards, impression dates, and country/targeting breakdowns (included at no extra add-on charge).",
            "default": true
          },
          "adFormats": {
            "title": "Pre-Charge Filter: Ad Media / Creative Formats (Optional)",
            "type": "array",
            "description": "Optional filter to only return (and charge for) specific LinkedIn ad formats: VIDEO, SINGLE_IMAGE, CAROUSEL, DOCUMENT, THOUGHT_LEADER, EVENT, MESSAGE, SPOTLIGHT, TEXT, FOLLOWER, or JOB. Leave empty for all formats.",
            "items": {
              "type": "string"
            }
          },
          "excludeJobAds": {
            "title": "Pre-Charge Filter: Exclude HR Job Ads (JOBS_V2)",
            "type": "boolean",
            "description": "Skip promoted LinkedIn Job Ads before billing so B2B marketers spying on SaaS competitors only pay for actual marketing creatives.",
            "default": false
          },
          "onlyNewAds": {
            "title": "Only New Ads (Stateful Competitor Monitoring)",
            "type": "boolean",
            "description": "Deduplicates against a persistent Apify Key-Value Store across runs so daily/weekly scheduled monitors only return and charge for newly launched competitor ads.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor Key-Value Store Name",
            "type": "string",
            "description": "Named Apify Key-Value Store used to remember previously seen ad IDs when 'Only New Ads' is enabled.",
            "default": "linkedin-ads-seen-state"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (Optional)",
            "type": "object",
            "description": "Optional proxy settings. Direct HTTP/2 Chrome-150 TLS impersonation works reliably out of the box with zero residential proxy cost.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}