{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper – Targeting, Impressions, Payers",
    "description": "Scrape ads from the LinkedIn Ad Library by advertiser, keyword, payer or company. Get ad text, images, videos, carousels, documents, landing pages, who paid, run dates, impressions by country and targeting. No login needed.",
    "version": "0.1",
    "x-build-id": "PpcmEYXCK1DOmRmRg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/expensive_marquess~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-expensive_marquess-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/expensive_marquess~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-expensive_marquess-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/expensive_marquess~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-expensive_marquess-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Advertisers, keywords or URLs",
            "type": "array",
            "description": "Any mix of: advertiser names (Microsoft), keywords, LinkedIn company URLs (linkedin.com/company/1035), Ad Library search URLs, or ad URLs (linkedin.com/ad-library/detail/...).",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Treat plain text as",
            "enum": [
              "advertiser",
              "keyword",
              "payer"
            ],
            "type": "string",
            "description": "How plain-text entries are searched. URLs are detected automatically.",
            "default": "advertiser"
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Only ads shown in these countries.",
            "items": {
              "type": "string",
              "enum": [
                "ALL",
                "AD",
                "AE",
                "AF",
                "AG",
                "AI",
                "AL",
                "AM",
                "AO",
                "AQ",
                "AR",
                "AS",
                "AT",
                "AU",
                "AW",
                "AX",
                "AZ",
                "BA",
                "BB",
                "BD",
                "BE",
                "BF",
                "BG",
                "BH",
                "BI",
                "BJ",
                "BM",
                "BN",
                "BO",
                "BR",
                "BS",
                "BT",
                "BV",
                "BW",
                "BY",
                "BZ",
                "CA",
                "CC",
                "CD",
                "CF",
                "CG",
                "CH",
                "CI",
                "CK",
                "CL",
                "CM",
                "CN",
                "CO",
                "CR",
                "CU",
                "CV",
                "CX",
                "CY",
                "CZ",
                "DE",
                "DJ",
                "DK",
                "DM",
                "DO",
                "DZ",
                "EC",
                "EE",
                "EG",
                "EH",
                "ER",
                "ES",
                "ET",
                "FI",
                "FJ",
                "FK",
                "FM",
                "FO",
                "FR",
                "GA",
                "GB",
                "GD",
                "GE",
                "GF",
                "GG",
                "GH",
                "GI",
                "GL",
                "GM",
                "GN",
                "GP",
                "GQ",
                "GR",
                "GS",
                "GT",
                "GU",
                "GW",
                "GY",
                "HK",
                "HM",
                "HN",
                "HR",
                "HT",
                "HU",
                "ID",
                "IE",
                "IL",
                "IM",
                "IN",
                "IO",
                "IQ",
                "IR",
                "IS",
                "IT",
                "JE",
                "JM",
                "JO",
                "JP",
                "KE",
                "KG",
                "KH",
                "KI",
                "KM",
                "KN",
                "KP",
                "KR",
                "KW",
                "KY",
                "KZ",
                "LA",
                "LB",
                "LC",
                "LI",
                "LK",
                "LR",
                "LS",
                "LT",
                "LU",
                "LV",
                "LY",
                "MA",
                "MC",
                "MD",
                "ME",
                "MG",
                "MH",
                "MK",
                "ML",
                "MM",
                "MN",
                "MO",
                "MP",
                "MQ",
                "MR",
                "MS",
                "MT",
                "MU",
                "MV",
                "MW",
                "MX",
                "MY",
                "MZ",
                "NA",
                "NC",
                "NE",
                "NF",
                "NG",
                "NI",
                "NL",
                "NO",
                "NP",
                "NR",
                "NU",
                "NZ",
                "OM",
                "PA",
                "PE",
                "PF",
                "PG",
                "PH",
                "PK",
                "PL",
                "PM",
                "PN",
                "PR",
                "PS",
                "PT",
                "PW",
                "PY",
                "QA",
                "RE",
                "RO",
                "RS",
                "RU",
                "RW",
                "SA",
                "SB",
                "SC",
                "SD",
                "SE",
                "SG",
                "SH",
                "SI",
                "SJ",
                "SK",
                "SL",
                "SM",
                "SN",
                "SO",
                "SR",
                "SS",
                "ST",
                "SV",
                "SY",
                "SZ",
                "TC",
                "TD",
                "TF",
                "TG",
                "TH",
                "TJ",
                "TK",
                "TL",
                "TM",
                "TN",
                "TO",
                "TR",
                "TT",
                "TV",
                "TW",
                "TZ",
                "UA",
                "UG",
                "US",
                "UY",
                "UZ",
                "VA",
                "VC",
                "VE",
                "VG",
                "VI",
                "VN",
                "VU",
                "WF",
                "WS",
                "YE",
                "YT",
                "ZA",
                "ZM",
                "ZW"
              ],
              "enumTitles": [
                "All countries",
                "Andorra (AD)",
                "United Arab Emirates (AE)",
                "Afghanistan (AF)",
                "Antigua and Barbuda (AG)",
                "Anguilla (AI)",
                "Albania (AL)",
                "Armenia (AM)",
                "Angola (AO)",
                "Antarctica (AQ)",
                "Argentina (AR)",
                "American Samoa (AS)",
                "Austria (AT)",
                "Australia (AU)",
                "Aruba (AW)",
                "Åland Islands (AX)",
                "Azerbaijan (AZ)",
                "Bosnia and Herzegovina (BA)",
                "Barbados (BB)",
                "Bangladesh (BD)",
                "Belgium (BE)",
                "Burkina Faso (BF)",
                "Bulgaria (BG)",
                "Bahrain (BH)",
                "Burundi (BI)",
                "Benin (BJ)",
                "Bermuda (BM)",
                "Brunei Darussalam (BN)",
                "Bolivia (BO)",
                "Brazil (BR)",
                "Bahamas (BS)",
                "Bhutan (BT)",
                "Bouvet Island (BV)",
                "Botswana (BW)",
                "Belarus (BY)",
                "Belize (BZ)",
                "Canada (CA)",
                "Cocos (Keeling) Islands (CC)",
                "Congo, The Democratic Republic of the (CD)",
                "Central African Republic (CF)",
                "Congo (CG)",
                "Switzerland (CH)",
                "Côte d'Ivoire (CI)",
                "Cook Islands (CK)",
                "Chile (CL)",
                "Cameroon (CM)",
                "China (CN)",
                "Colombia (CO)",
                "Costa Rica (CR)",
                "Cuba (CU)",
                "Cabo Verde (CV)",
                "Christmas Island (CX)",
                "Cyprus (CY)",
                "Czechia (CZ)",
                "Germany (DE)",
                "Djibouti (DJ)",
                "Denmark (DK)",
                "Dominica (DM)",
                "Dominican Republic (DO)",
                "Algeria (DZ)",
                "Ecuador (EC)",
                "Estonia (EE)",
                "Egypt (EG)",
                "Western Sahara (EH)",
                "Eritrea (ER)",
                "Spain (ES)",
                "Ethiopia (ET)",
                "Finland (FI)",
                "Fiji (FJ)",
                "Falkland Islands (Malvinas) (FK)",
                "Micronesia, Federated States of (FM)",
                "Faroe Islands (FO)",
                "France (FR)",
                "Gabon (GA)",
                "United Kingdom (GB)",
                "Grenada (GD)",
                "Georgia (GE)",
                "French Guiana (GF)",
                "Guernsey (GG)",
                "Ghana (GH)",
                "Gibraltar (GI)",
                "Greenland (GL)",
                "Gambia (GM)",
                "Guinea (GN)",
                "Guadeloupe (GP)",
                "Equatorial Guinea (GQ)",
                "Greece (GR)",
                "South Georgia and the South Sandwich Islands (GS)",
                "Guatemala (GT)",
                "Guam (GU)",
                "Guinea-Bissau (GW)",
                "Guyana (GY)",
                "Hong Kong (HK)",
                "Heard Island and McDonald Islands (HM)",
                "Honduras (HN)",
                "Croatia (HR)",
                "Haiti (HT)",
                "Hungary (HU)",
                "Indonesia (ID)",
                "Ireland (IE)",
                "Israel (IL)",
                "Isle of Man (IM)",
                "India (IN)",
                "British Indian Ocean Territory (IO)",
                "Iraq (IQ)",
                "Iran (IR)",
                "Iceland (IS)",
                "Italy (IT)",
                "Jersey (JE)",
                "Jamaica (JM)",
                "Jordan (JO)",
                "Japan (JP)",
                "Kenya (KE)",
                "Kyrgyzstan (KG)",
                "Cambodia (KH)",
                "Kiribati (KI)",
                "Comoros (KM)",
                "Saint Kitts and Nevis (KN)",
                "North Korea (KP)",
                "South Korea (KR)",
                "Kuwait (KW)",
                "Cayman Islands (KY)",
                "Kazakhstan (KZ)",
                "Laos (LA)",
                "Lebanon (LB)",
                "Saint Lucia (LC)",
                "Liechtenstein (LI)",
                "Sri Lanka (LK)",
                "Liberia (LR)",
                "Lesotho (LS)",
                "Lithuania (LT)",
                "Luxembourg (LU)",
                "Latvia (LV)",
                "Libya (LY)",
                "Morocco (MA)",
                "Monaco (MC)",
                "Moldova (MD)",
                "Montenegro (ME)",
                "Madagascar (MG)",
                "Marshall Islands (MH)",
                "North Macedonia (MK)",
                "Mali (ML)",
                "Myanmar (MM)",
                "Mongolia (MN)",
                "Macao (MO)",
                "Northern Mariana Islands (MP)",
                "Martinique (MQ)",
                "Mauritania (MR)",
                "Montserrat (MS)",
                "Malta (MT)",
                "Mauritius (MU)",
                "Maldives (MV)",
                "Malawi (MW)",
                "Mexico (MX)",
                "Malaysia (MY)",
                "Mozambique (MZ)",
                "Namibia (NA)",
                "New Caledonia (NC)",
                "Niger (NE)",
                "Norfolk Island (NF)",
                "Nigeria (NG)",
                "Nicaragua (NI)",
                "Netherlands (NL)",
                "Norway (NO)",
                "Nepal (NP)",
                "Nauru (NR)",
                "Niue (NU)",
                "New Zealand (NZ)",
                "Oman (OM)",
                "Panama (PA)",
                "Peru (PE)",
                "French Polynesia (PF)",
                "Papua New Guinea (PG)",
                "Philippines (PH)",
                "Pakistan (PK)",
                "Poland (PL)",
                "Saint Pierre and Miquelon (PM)",
                "Pitcairn (PN)",
                "Puerto Rico (PR)",
                "Palestine, State of (PS)",
                "Portugal (PT)",
                "Palau (PW)",
                "Paraguay (PY)",
                "Qatar (QA)",
                "Réunion (RE)",
                "Romania (RO)",
                "Serbia (RS)",
                "Russian Federation (RU)",
                "Rwanda (RW)",
                "Saudi Arabia (SA)",
                "Solomon Islands (SB)",
                "Seychelles (SC)",
                "Sudan (SD)",
                "Sweden (SE)",
                "Singapore (SG)",
                "Saint Helena, Ascension and Tristan da Cunha (SH)",
                "Slovenia (SI)",
                "Svalbard and Jan Mayen (SJ)",
                "Slovakia (SK)",
                "Sierra Leone (SL)",
                "San Marino (SM)",
                "Senegal (SN)",
                "Somalia (SO)",
                "Suriname (SR)",
                "South Sudan (SS)",
                "Sao Tome and Principe (ST)",
                "El Salvador (SV)",
                "Syria (SY)",
                "Eswatini (SZ)",
                "Turks and Caicos Islands (TC)",
                "Chad (TD)",
                "French Southern Territories (TF)",
                "Togo (TG)",
                "Thailand (TH)",
                "Tajikistan (TJ)",
                "Tokelau (TK)",
                "Timor-Leste (TL)",
                "Turkmenistan (TM)",
                "Tunisia (TN)",
                "Tonga (TO)",
                "Türkiye (TR)",
                "Trinidad and Tobago (TT)",
                "Tuvalu (TV)",
                "Taiwan (TW)",
                "Tanzania (TZ)",
                "Ukraine (UA)",
                "Uganda (UG)",
                "United States (US)",
                "Uruguay (UY)",
                "Uzbekistan (UZ)",
                "Holy See (Vatican City State) (VA)",
                "Saint Vincent and the Grenadines (VC)",
                "Venezuela (VE)",
                "Virgin Islands, British (VG)",
                "Virgin Islands, U.S. (VI)",
                "Vietnam (VN)",
                "Vanuatu (VU)",
                "Wallis and Futuna (WF)",
                "Samoa (WS)",
                "Yemen (YE)",
                "Mayotte (YT)",
                "South Africa (ZA)",
                "Zambia (ZM)",
                "Zimbabwe (ZW)"
              ]
            },
            "default": [
              "ALL"
            ]
          },
          "dateRange": {
            "title": "Date range",
            "enum": [
              "all",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom"
            ],
            "type": "string",
            "description": "Only ads shown in this period.",
            "default": "all"
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Used when Date range is Custom."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Used when Date range is Custom."
          },
          "maxAdsPerQuery": {
            "title": "Max ads per query",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all ads.",
            "default": 100
          },
          "adFormats": {
            "title": "Only these ad formats",
            "type": "array",
            "description": "Keep only these formats (e.g. Video). Other ads are skipped before details are loaded and are not charged. Leave empty for all formats.",
            "items": {
              "type": "string",
              "enum": [
                "Single image",
                "Video",
                "Carousel",
                "Document",
                "Event",
                "Message",
                "Text",
                "Spotlight",
                "Follower",
                "Job",
                "Article"
              ]
            }
          },
          "includeDetails": {
            "title": "Include full details",
            "type": "boolean",
            "description": "Opens each ad for the full text, landing page, who paid, run dates, impressions by country and targeting (language, location, audience/company/job/education targeting). LinkedIn shows dates, impressions and targeting only for ads that ran in the EU.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "LinkedIn rate-limits quickly; keep the proxy on.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}