{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper | Ads, Payers & Targeting",
    "description": "Get LinkedIn Ad Library ads: advertiser name, ad format, ad text, headline and images, plus payer, landing URL, run dates, impressions and targeting with details. Search by keyword, advertiser, payer, URL or ad ID, with country, date and impressions filters. No login.",
    "version": "0.0",
    "x-build-id": "q7ya17gqUbtOb8Sim"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/genial_candlestand~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-genial_candlestand-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/genial_candlestand~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-genial_candlestand-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/genial_candlestand~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-genial_candlestand-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": {
          "queries": {
            "title": "Keywords",
            "type": "array",
            "description": "Search the ad text for these keywords, one search per line (e.g. \"cybersecurity\"). Give at least one of Keywords, Advertisers, Paid for by, Start URLs or Ad IDs. The filters below apply to every keyword.",
            "items": {
              "type": "string"
            }
          },
          "advertisers": {
            "title": "Advertisers",
            "type": "array",
            "description": "Find the ads of these advertisers (LinkedIn company or person names, e.g. \"HubSpot\"), one search per line. LinkedIn matches names loosely; for one exact company paste its page URL (https://www.linkedin.com/company/68529) into Start URLs. The filters below apply to every advertiser.",
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "Paid for by",
            "type": "array",
            "description": "Find ads by the legal entity that paid for them (the \"Paid for by\" line, e.g. \"Microsoft\"), one search per line. The filters below apply to every payer.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "LinkedIn URLs: Ad Library search URLs (https://www.linkedin.com/ad-library/search?…, filters taken from the URL), ad URLs (https://www.linkedin.com/ad-library/detail/<id>) or company pages (https://www.linkedin.com/company/<id or name>). The filter fields below do not change pasted search URLs; they do apply to company pages. Other URLs are skipped with a warning.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "adIds": {
            "title": "Ad IDs",
            "type": "array",
            "description": "Numeric LinkedIn Ad Library ad IDs (e.g. \"1615837293\"), one per line. Each ad is returned with its full details and charged as Ad + Ad details. Filters do not apply to ad IDs. Ad URLs go into Start URLs.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Only ads shown in these countries: ISO 3166-1 alpha-2 codes or English names (\"DE\", \"United States\"). Empty = all countries. An unknown country stops the run with an input error before any request.",
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "all-time",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "When the ads ran. LinkedIn keeps ads for the last 12 months only. \"Custom range\" uses Start date and End date; filling a date switches to a custom range automatically.",
            "default": "all-time"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day of a custom range: YYYY-MM-DD or relative (\"3 months\"). At most 12 months back; an older date is moved to the earliest allowed day with a warning. Empty in a custom range = 12 months ago."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day of a custom range: YYYY-MM-DD or relative. Must be before today (LinkedIn returns nothing for today or the future): today or later is moved to yesterday with a warning. Empty in a custom range = yesterday. Must be after Start date."
          },
          "minImpressions": {
            "title": "Min impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads with at least this many impressions (e.g. 10000). Works alone or with Max impressions (then it must be lower). LinkedIn publishes impressions mainly for ads served in the EU and Brazil, so this filter keeps mostly such ads."
          },
          "maxImpressions": {
            "title": "Max impressions",
            "minimum": 1,
            "type": "integer",
            "description": "Only ads with at most this many impressions (e.g. 1000000). Works alone or with Min impressions; must be higher than Min impressions."
          },
          "targetingIncluded": {
            "title": "Targeting includes",
            "type": "array",
            "description": "Only ads whose advertiser included targeting of these kinds (e.g. Location). A kind can be in both lists (= both included and excluded). LinkedIn shows targeting mainly for EU and Brazil ads.",
            "items": {
              "type": "string",
              "enum": [
                "LOCATION",
                "LANGUAGE",
                "COMPANY",
                "JOB",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "EDUCATION",
                "INTERESTS_AND_TRAITS"
              ],
              "enumTitles": [
                "Location",
                "Language",
                "Company",
                "Job",
                "Audience",
                "Demographic",
                "Education",
                "Interests and traits"
              ]
            }
          },
          "targetingExcluded": {
            "title": "Targeting excludes",
            "type": "array",
            "description": "Only ads whose advertiser excluded audiences of these kinds (e.g. Company).",
            "items": {
              "type": "string",
              "enum": [
                "LOCATION",
                "LANGUAGE",
                "COMPANY",
                "JOB",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "EDUCATION",
                "INTERESTS_AND_TRAITS"
              ],
              "enumTitles": [
                "Location",
                "Language",
                "Company",
                "Job",
                "Audience",
                "Demographic",
                "Education",
                "Interests and traits"
              ]
            }
          },
          "includeDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Open every ad's page for the full text, payer, landing URL, call to action, video, run dates, impressions (total and by country) and targeting. Charged as an extra \"Ad details\" event per ad. Off = search-card data only (advertiser, format, text preview, images).",
            "default": false
          },
          "maxItemsPerSearch": {
            "title": "Max ads per search",
            "minimum": 1,
            "type": "integer",
            "description": "Stop each keyword, advertiser, payer or URL search after this many ads (24 per page). Popular keywords match hundreds of thousands of ads.",
            "default": 100
          },
          "maxItems": {
            "title": "Max ads in total",
            "minimum": 1,
            "type": "integer",
            "description": "Stop the whole run after this many ads (all searches and ad IDs together). Duplicates found by several searches are counted and charged once.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy is needed: LinkedIn's firewall blocks most IPs, the actor tries several until one passes (datacenter first, a few residential US tries last).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}