{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper: Ads, Media & Targeting",
    "description": "Scrape LinkedIn Ad Library by company, keyword or ad URL. Get ad copy, images, videos, payer, dates and available targeting. Export unique ads as JSON, CSV or Excel. No LinkedIn login needed.",
    "version": "0.1",
    "x-build-id": "hxumYHwDLQWZfpMrp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/whoareyouanas~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-whoareyouanas-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/whoareyouanas~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-whoareyouanas-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/whoareyouanas~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-whoareyouanas-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": {
          "searches": {
            "title": "Independent searches",
            "maxItems": 1000,
            "type": "array",
            "description": "Objects with type (companyId, companyUrl, advertiser, keyword, searchUrl, adUrl), string value, optional label and per-search filters. Organization IDs must be strings. URL filters are authoritative; contradictory structured filters are rejected. Invalid searches are recorded while other valid searches continue.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "title": "Search type",
                  "description": "Selector interpretation.",
                  "type": "string",
                  "enum": [
                    "companyId",
                    "companyUrl",
                    "advertiser",
                    "keyword",
                    "searchUrl",
                    "adUrl"
                  ]
                },
                "value": {
                  "title": "Search value",
                  "description": "Nonempty selector text, string ID, or public URL.",
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "title": "Search label",
                  "description": "Optional label for the query ledger.",
                  "type": "string"
                },
                "filters": {
                  "title": "Search filters",
                  "description": "Optional overrides of global countries, payer, and date filters.",
                  "type": "object"
                }
              },
              "required": [
                "type",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "companies": {
            "title": "Companies or advertisers",
            "type": "array",
            "description": "Advertiser name text or a public LinkedIn company URL. Names are text matches; URL slugs must resolve to a verified organization ID.",
            "items": {
              "type": "string"
            }
          },
          "companyIds": {
            "title": "Exact organization IDs",
            "type": "array",
            "description": "Positive numeric organization IDs supplied as strings. Returned advertiser identity is verified before exact matches are delivered.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Independent text searches across ad copy.",
            "items": {
              "type": "string"
            }
          },
          "adUrls": {
            "title": "Direct ad URLs",
            "type": "array",
            "description": "HTTPS public /ad-library/detail/<numeric-id> or /ad-library/employer-brand/<numeric-id> URLs. Search filters do not apply to direct ads.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Collection mode",
            "enum": [
              "listing",
              "full"
            ],
            "type": "string",
            "description": "Defaults to full in the Actor code. Listing records only source-visible card fields and marks truncated copy. Full additionally fetches each eligible unique detail. Missing source disclosure is not invented. Direct ad URLs always require full retrieval."
          },
          "allowListingFallback": {
            "title": "Allow listing fallback after detail failures",
            "type": "boolean",
            "description": "In full mode, deliver usable card data at the listing event price when detail retrieval fails. False withholds those ads and records their failures.",
            "default": true
          },
          "filters": {
            "title": "Global filters",
            "type": "object",
            "description": "Optional countries (ISO alpha-2 array), payer text, dateRange, startDate and endDate. No country constraint by default. Date presets: all-time, last-30-days, current-month, current-year, last-year, custom. Custom dates require both YYYY-MM-DD dates. Unknown filters are rejected; last-7-days and last-90-days are not currently advertised.",
            "properties": {
              "countries": {
                "title": "Countries",
                "description": "ISO country codes; empty means no restriction.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "payer": {
                "title": "Payer",
                "description": "Entity paying for the ad.",
                "type": "string"
              },
              "dateRange": {
                "title": "Date range",
                "description": "A supported source preset or custom dates.",
                "type": "string",
                "enum": [
                  "all-time",
                  "last-30-days",
                  "current-month",
                  "current-year",
                  "last-year",
                  "custom"
                ]
              },
              "startDate": {
                "title": "Custom start date",
                "description": "YYYY-MM-DD; requires an end date.",
                "type": "string",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
              },
              "endDate": {
                "title": "Custom end date",
                "description": "YYYY-MM-DD; requires a start date.",
                "type": "string",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
              }
            },
            "additionalProperties": false
          },
          "maxResults": {
            "title": "Global maximum unique ads",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Global delivered-ad limit; defaults to 100 in the Actor code. Zero removes this row limit while request/time/charge budgets still apply."
          },
          "maxResultsPerSearch": {
            "title": "Maximum unique ads per search",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Per-search unique usable match limit. Zero removes this row limit.",
            "default": 100
          },
          "maxRequests": {
            "title": "Maximum HTTP attempts",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Includes retries and company resolution. Reaching this budget produces an explicit partial summary.",
            "default": 5000
          },
          "maxRunSeconds": {
            "title": "Maximum run duration",
            "minimum": 1,
            "maximum": 86400,
            "type": "integer",
            "description": "Operational deadline in seconds. Reaching it produces an explicit partial summary.",
            "default": 900
          },
          "maxConcurrency": {
            "title": "Concurrency ceiling",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Upper request ceiling. Host pacing can reduce actual concurrency.",
            "default": 8
          },
          "adFormats": {
            "title": "Post-extraction format filter",
            "type": "array",
            "description": "Optional canonical labels: SINGLE_IMAGE, VIDEO, CAROUSEL, DOCUMENT, TEXT, MESSAGE, CONVERSATION, THOUGHT_LEADER, EVENT, SPOTLIGHT, EMPLOYER_BRAND. Filter runs after scanning. Full detail acceptance is verified for image, video, carousel, document and thought-leader layouts; other formats may return listing fallbacks.",
            "items": {
              "type": "string"
            }
          },
          "includeEvidence": {
            "title": "Include bounded extraction evidence",
            "type": "boolean",
            "description": "Preserve bounded source excerpts and hashes for extraction audits.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Standard Apify proxy settings. Cloud runs use datacenter proxy by default; explicit settings override it. Local development uses direct access by default."
          },
          "startUrls": {
            "title": "Compatibility start URLs",
            "type": "array",
            "description": "Public LinkedIn search, company, standard detail, or employer-brand URLs. String URLs or {url} objects are accepted. Only GET is supported.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "resultsLimit": {
            "title": "Compatibility global results limit",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Alias of maxResults. Unlike Silva's per-URL setting, this alias is GLOBAL; use maxResultsPerSearch for per-URL limits. Conflicting aliases are rejected."
          },
          "skipDetails": {
            "title": "Compatibility skip details",
            "type": "boolean",
            "description": "True maps to listing; false maps to full. Conflicting mode aliases are rejected."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}