{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Scraper",
    "description": "[💰 $0.5 / 1K] Extract ads from LinkedIn's public Ad Library: advertiser, ad copy, format, image and ad URL on every run, headline when present. Search by keyword, advertiser, country and date range. Detail mode adds destination link and paying entity. Dates, impressions and targeting are EU-only.",
    "version": "1.0",
    "x-build-id": "5RTa4LHFfobDeKEXh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/solidcode~linkedin-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-solidcode-linkedin-ads-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/solidcode~linkedin-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-solidcode-linkedin-ads-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/solidcode~linkedin-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-solidcode-linkedin-ads-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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text search terms (e.g. \"AI marketing\", \"crypto\"). Each keyword runs its own search and the results are combined. Leave empty to search by advertiser or by direct URLs.",
            "items": {
              "type": "string"
            }
          },
          "advertisers": {
            "title": "Advertisers",
            "type": "array",
            "description": "LinkedIn company slugs (e.g. \"nvidia\", \"microsoft\", \"hubspot\"). The slug comes from the LinkedIn company URL — `linkedin.com/company/<slug>`. Each advertiser runs its own search and returns **only that company's own ads** — partners, resellers and agencies with the same brand in their company name are excluded. Use the slug exactly as it appears in the URL; display names like \"Microsoft Corp\" are not deterministic and may return zero results.",
            "items": {
              "type": "string"
            }
          },
          "includeRelatedAdvertisers": {
            "title": "Include partners and agencies with the advertiser's name",
            "type": "boolean",
            "description": "Off by default: an advertiser search returns only that company's own ads. Switch this on to go back to matching on company *name*, which also pulls in resellers, partners and agencies that carry the brand in their own name (searching \"hubspot\" then also returns \"Systony - HubSpot Elite Partner\", \"Avidly HubSpot Solutions\" and similar). Useful for mapping a partner ecosystem, wasteful if you're tracking one competitor — you're billed for those extra ads too. Only affects the Advertisers field."
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Paste full LinkedIn Ad Library search URLs directly. Useful when you've built a search in the LinkedIn UI and want the same results. Bypasses the keyword and advertiser fields above.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "uniqueItems": true,
            "type": "array",
            "description": "Restrict results to ads served in these countries. Leave empty to include every country.",
            "items": {
              "type": "string",
              "enum": [
                "US",
                "GB",
                "CA",
                "AU",
                "IE",
                "NZ",
                "ZA",
                "IN",
                "DE",
                "FR",
                "ES",
                "IT",
                "NL",
                "BE",
                "PT",
                "SE",
                "NO",
                "DK",
                "FI",
                "PL",
                "AT",
                "CH",
                "BR",
                "MX",
                "AR",
                "CL",
                "CO",
                "JP",
                "KR",
                "SG",
                "HK",
                "TW",
                "ID",
                "TH",
                "VN",
                "PH",
                "MY",
                "AE",
                "SA",
                "TR",
                "IL",
                "EG"
              ],
              "enumTitles": [
                "United States",
                "United Kingdom",
                "Canada",
                "Australia",
                "Ireland",
                "New Zealand",
                "South Africa",
                "India",
                "Germany",
                "France",
                "Spain",
                "Italy",
                "Netherlands",
                "Belgium",
                "Portugal",
                "Sweden",
                "Norway",
                "Denmark",
                "Finland",
                "Poland",
                "Austria",
                "Switzerland",
                "Brazil",
                "Mexico",
                "Argentina",
                "Chile",
                "Colombia",
                "Japan",
                "South Korea",
                "Singapore",
                "Hong Kong",
                "Taiwan",
                "Indonesia",
                "Thailand",
                "Vietnam",
                "Philippines",
                "Malaysia",
                "United Arab Emirates",
                "Saudi Arabia",
                "Turkey",
                "Israel",
                "Egypt"
              ]
            }
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "Time window for when the ad was active. LinkedIn's Ad Library only retains ~12 months of history regardless of the option chosen."
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Only used when 'Date range' is set to 'Custom date range'. Format YYYY-MM-DD. Must be within the last 12 months."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Only used when 'Date range' is set to 'Custom date range'. Format YYYY-MM-DD. Must be within the last 12 months."
          },
          "fetchDetails": {
            "title": "Fetch full ad details (full copy, destination link, impressions + targeting)",
            "type": "boolean",
            "description": "Opens each ad's own page to collect what the search results don't carry. **Worth switching on in any country, not just the EU.** For every ad, anywhere: the complete body copy instead of the 121-character preview (measured up to 2,999 characters on a US-only run), the destination link, the paying entity, the advertiser's LinkedIn profile link, and the direct video file on video ads. **EU-served ads only:** LinkedIn additionally publishes dates active, total impressions, impressions per country and full targeting (languages, locations, audience facets) — those stay empty on US and other non-EU ads no matter what. Only the ads carrying that EU disclosure are billed at $0.90 per 1,000 instead of $0.50 per 1,000; on a measured US-only detail run 72.5% of rows stayed at the basic price. Leave off if the search-result fields are enough."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the total number of ads returned across all queries combined. Leave the box empty and the run stops at 1,000 ads — type 0 if you want no cap at all. Either way each individual search is capped at roughly 4,800 ads (200 pages × 24) by LinkedIn's pagination depth, and the actor stops when it reaches that limit. Pages contain 24 ads each, so the actor may overshoot your cap by up to 23 to keep the last page intact."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}