{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper & API: Ads, Impressions & Campaigns",
    "description": "Scrape the LinkedIn Ad Library without login: every ad of a company, keyword or payer with full copy, CTA, image / video / carousel / document, run dates, impressions by country and targeting. Short links expanded to the real landing page, campaign ids and UTM tags, exact ad count per advertiser.",
    "version": "0.1",
    "x-build-id": "kbu1AKsJH8sV6Oddc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-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/s_actors~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-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/s_actors~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-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": {
          "advertisers": {
            "title": "🏢 Companies (advertisers)",
            "type": "array",
            "description": "Company names as LinkedIn shows them (\"HubSpot\", \"Notion\") or company page links (linkedin.com/company/<name>: the Actor reads the name from the page). Each one is its own search of the Ad Library. LinkedIn matches names loosely: \"HubSpot\" also finds \"HubSpot for Developers\", partner agencies and employees' thought leader ads (see \"Only this company\").",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "🔎 Keywords in the ad text",
            "type": "array",
            "description": "Words or phrases in the ad copy across ALL advertisers (\"payroll software\", \"AI agents\"): find every company advertising a topic, not only the ones you know.",
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "💳 Payers",
            "type": "array",
            "description": "The legal entity that paid for the ads (\"HubSpot, Inc.\"), as in \"Paid for by\" on the ad.",
            "items": {
              "type": "string"
            }
          },
          "adLibraryUrls": {
            "title": "🔗 Ad Library links",
            "type": "array",
            "description": "Search links built on linkedin.com/ad-library (any filters: they are replayed as they are) and ad links (linkedin.com/ad-library/detail/<id>) or bare ad IDs.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "🌍 Countries",
            "type": "array",
            "description": "Two-letter country codes where the ads were shown (DE, FR, US, GB...). Empty = all countries. Applies to companies, keywords and payers (an Ad Library link keeps its own).",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "📅 Date range",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "When the ads ran.",
            "default": ""
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "First day, for \"Custom range\". Not earlier than 12 months ago."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "Last day, for \"Custom range\"."
          },
          "minImpressions": {
            "title": "📈 Min impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads with at least this many impressions (e.g. 10000). LinkedIn publishes impressions for ads shown in the EU only, so this filter keeps EU ads only."
          },
          "maxImpressions": {
            "title": "Max impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads with at most this many impressions (EU ads only, as above)."
          },
          "adFormats": {
            "title": "🎞️ Ad formats",
            "type": "array",
            "description": "Keep only these formats. Others are skipped before any charge. Empty = all formats.",
            "items": {
              "type": "string",
              "enum": [
                "Single Image Ad",
                "Video Ad",
                "Carousel Ad",
                "Document Ad",
                "Text Ad",
                "Message Ad",
                "Conversation Ad",
                "Spotlight Ad",
                "Follower Ad",
                "Event Ad",
                "Job Ad",
                "LinkedIn Article Ad",
                "Newsletter Ad"
              ]
            }
          },
          "exactAdvertiserMatch": {
            "title": "🎯 Only this company (drop loose matches)",
            "type": "boolean",
            "description": "For companies: keep only the company's own ads: its pages (\"HubSpot\", \"HubSpot for Developers\") and employees' thought leader ads it promotes (\"Promoted by HubSpot\"); drops partners and namesakes (\"Avidly HubSpot Solutions\"). Dropped ads are free.",
            "default": false
          },
          "maxAdsPerSearch": {
            "title": "🔢 Max ads per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop each company / keyword / payer / link after this many ads (newest first). Controls the cost. The exact total LinkedIn holds is in \"searchTotalAds\" anyway.",
            "default": 100
          },
          "includeDetails": {
            "title": "📋 Ad details (impressions, targeting, dates, CTA, landing page)",
            "type": "boolean",
            "description": "Opens every ad's page: full text, CTA, click URL and landing page, payer, run dates, impressions by country, targeting, campaign ids. Off = the search card only (advertiser, format, the first ~120 characters, headline, picture): faster and cheaper.",
            "default": true
          },
          "expandLandingPages": {
            "title": "🔗 Expand short links to the landing page",
            "type": "boolean",
            "description": "Follows the click URL (hubs.la, bit.ly, lnkd.in...) to the real landing page and reads the full UTM campaign name and campaign ids there. Free.",
            "default": true
          },
          "onlyNewAds": {
            "title": "🔔 Only new ads (for scheduled runs)",
            "type": "boolean",
            "description": "Return only ads that earlier runs with the same search did not return. Ads seen before are skipped for free.",
            "default": false
          },
          "maxConcurrency": {
            "title": "⚡ Parallel ad pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many ad pages are loaded at the same time.",
            "default": 8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}