{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper: Ads by Company",
    "description": "Scrape the public LinkedIn Ad Library by company, keyword, payer or country with no login and no cookies. Get ad copy, headline, CTA, format, image and video URLs, the paying entity, run dates, impression ranges and EU targeting. JSON, CSV, Excel or API, schedulable, billed once per new ad.",
    "version": "0.1",
    "x-build-id": "ukLCJNu0YioD3rfWV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation_craft~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation_craft-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/automation_craft~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation_craft-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/automation_craft~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation_craft-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": {
          "companyUrlsOrIds": {
            "title": "Advertiser company pages or ids",
            "type": "array",
            "description": "LinkedIn company pages whose ads you want, as URLs or numeric ids. A numeric URL such as https://www.linkedin.com/company/1035 or the bare id 1035 is an exact match. A vanity URL such as /company/microsoft carries no id, so it is searched as an advertiser name instead and a warning says so.",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases to look for in the ad text, one search per entry. Example: cloud security.",
            "items": {
              "type": "string"
            }
          },
          "advertiserNames": {
            "title": "Advertiser names",
            "type": "array",
            "description": "Advertiser or company names to search when you do not have the numeric company id. Example: Salesforce.",
            "items": {
              "type": "string"
            }
          },
          "payerNames": {
            "title": "Payer names",
            "type": "array",
            "description": "The entity that paid for the ads, as printed on the ad detail page. Example: Essence Global LLC. Useful for tracking one media agency across its clients.",
            "items": {
              "type": "string"
            }
          },
          "adUrlsOrIds": {
            "title": "Ad detail URLs or ids",
            "type": "array",
            "description": "Look up specific ads directly. Accepts https://www.linkedin.com/ad-library/detail/1542548173 or the bare id 1542548173. An id that no longer exists returns a free status row.",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "Ad Library search URLs",
            "type": "array",
            "description": "Paste any LinkedIn Ad Library search URL. Its keyword, advertiser, company, payer, country and date filters are read out of the link.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries the ad was shown in",
            "type": "array",
            "description": "Two-letter country codes. Leave empty for worldwide. Ads shown in the EU and the EEA are the ones that carry run dates, impressions and targeting, so pick European countries when you want those fields.",
            "items": {
              "type": "string",
              "enum": [
                "US",
                "GB",
                "DE",
                "FR",
                "NL",
                "IE",
                "ES",
                "IT",
                "SE",
                "PL",
                "BE",
                "DK",
                "FI",
                "NO",
                "AT",
                "CH",
                "PT",
                "CZ",
                "RO",
                "GR",
                "IN",
                "AU",
                "CA",
                "BR",
                "SG",
                "AE",
                "JP",
                "MX",
                "ZA",
                "NZ"
              ],
              "enumTitles": [
                "United States",
                "United Kingdom",
                "Germany",
                "France",
                "Netherlands",
                "Ireland",
                "Spain",
                "Italy",
                "Sweden",
                "Poland",
                "Belgium",
                "Denmark",
                "Finland",
                "Norway",
                "Austria",
                "Switzerland",
                "Portugal",
                "Czechia",
                "Romania",
                "Greece",
                "India",
                "Australia",
                "Canada",
                "Brazil",
                "Singapore",
                "United Arab Emirates",
                "Japan",
                "Mexico",
                "South Africa",
                "New Zealand"
              ]
            }
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "Which slice of the Ad Library to search. The library itself only holds the last 12 months, whatever you pick here.",
            "default": "last-30-days"
          },
          "startDate": {
            "title": "Custom range start",
            "type": "string",
            "description": "First day of a custom range, as YYYY-MM-DD. Only used when the date range is set to Custom range."
          },
          "endDate": {
            "title": "Custom range end",
            "type": "string",
            "description": "Last day of a custom range, as YYYY-MM-DD. Only used when the date range is set to Custom range."
          },
          "maxAds": {
            "title": "Maximum ads in total",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on delivered ads across every search in this run. Leave empty for no cap. The budget is shared fairly between your searches, then any leftover is given back to the searches that still have results."
          },
          "maxAdsPerQuery": {
            "title": "Maximum ads per search",
            "minimum": 1,
            "type": "integer",
            "description": "Cap per keyword, company, advertiser or payer. Leave empty to let one search use the whole budget."
          },
          "includeAdDetails": {
            "title": "Open each ad detail page",
            "type": "boolean",
            "description": "Adds the full ad copy, the paying entity, the run dates, the impression range, the per-country split and the targeting parameters. Turn it off for a faster, lighter creative list. The price per ad is the same either way.",
            "default": true
          },
          "dedupMemoryName": {
            "title": "Dedup memory name",
            "type": "string",
            "description": "Name a memory here and this Actor remembers every ad it has already delivered under that name. Later runs skip those ads free of charge, so a daily or weekly monitor pays once per ad. Use one name per project."
          },
          "emitKnownAds": {
            "title": "Also return already-known ads",
            "type": "boolean",
            "description": "Returns ads the memory has seen before, flagged with alreadyKnown true and free of charge, instead of skipping them. Useful when you want the full current list every run.",
            "default": false
          },
          "resetDedupMemory": {
            "title": "Reset the memory before this run",
            "type": "boolean",
            "description": "Empties the named memory first, so every ad found in this run counts as new and is charged again.",
            "default": false
          },
          "maxRequestsPerSecond": {
            "title": "Requests per second",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How fast to ask LinkedIn. Eight is the tested default; higher values raise the share of refused requests, which the Actor then has to retry.",
            "default": 8
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many ad detail pages to open at once.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave the default. LinkedIn refuses a share of requests per exit IP, and residential exits are refused far less often than datacenter ones; the Actor recovers the rest by retrying on a fresh proxy session. With no proxy it cannot.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}