{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Scraper",
    "description": "[💰 $0.5 / 1K] Extract ads from LinkedIn's public Ad Library — advertiser, headline, body, format, dates, impressions, CTAs. Search by keyword, advertiser, country, and date range. Optional detail enrichment for impressions-per-country and targeting.",
    "version": "1.0",
    "x-build-id": "b9e0nl0Gg3D9u0IZw"
  },
  "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.",
            "default": [],
            "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. Use the slug exactly as it appears in the URL — display names like \"Microsoft Corp\" are not deterministic and may return zero results.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "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.",
            "default": [],
            "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"
              ]
            },
            "default": []
          },
          "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.",
            "default": "last-30-days"
          },
          "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 (impressions per country + targeting)",
            "type": "boolean",
            "description": "When enabled, opens each ad's detail page to extract impressions-per-country and full targeting (languages, locations). Increases the per-ad price from $0.50 per 1,000 ads to $0.90 per 1,000 ads, and only enriches ads that LinkedIn discloses extra data for (typically EU-served ads). Leave off to keep cost low if you only need search-card data.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the total number of ads returned across all queries combined. Set to 0 for unlimited — though 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 watchdog limit. Pages contain 24 ads each, so the actor may overshoot your cap by up to 23 to keep the last page intact.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}