{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper",
    "description": "Scrape LinkedIn Ad Library ads by advertiser, keyword or payer. Every result page with full details: ad copy, images, video URLs, CTAs, payer, run dates and impressions by country. Filter by countries, dates and format. No login. From $0.001 per ad.",
    "version": "0.1",
    "x-build-id": "qVXy6XBHTt5C3C36D"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-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-lab~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-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-lab~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-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": {
          "searchQuery": {
            "title": "🏢 Advertiser name",
            "type": "string",
            "description": "Company or brand that runs the ads (LinkedIn's \"Advertiser\" search, which also matches similar names). Example: \"Salesforce\", \"HubSpot\". To search the ad text instead, use Keyword."
          },
          "keyword": {
            "title": "🔤 Keyword",
            "type": "string",
            "description": "Words in the ad text, for example \"webinar\", \"AI agents\" or \"free trial\". Use it alone to find every advertiser using those words, or with an advertiser to narrow their ads."
          },
          "payer": {
            "title": "💳 Paid for by",
            "type": "string",
            "description": "Organisation that paid for the ads (LinkedIn's \"Payer\" search), for example an agency name."
          },
          "advertiserUrls": {
            "title": "🔗 Advertiser URLs",
            "type": "array",
            "description": "LinkedIn company page URLs, one per line (e.g. https://www.linkedin.com/company/salesforce). Each is searched as an advertiser; the company's URL name is used for the search. When given, they take priority over Advertiser name.",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "🧭 Ad Library search URLs",
            "type": "array",
            "description": "Search URLs copied from your browser after setting filters on https://www.linkedin.com/ad-library/search, including impressions-range filters. Their own filters are used as-is.",
            "items": {
              "type": "string"
            }
          },
          "adUrls": {
            "title": "📄 Ad URLs",
            "type": "array",
            "description": "Single ad pages, e.g. https://www.linkedin.com/ad-library/detail/1634330003. Returns full details for each ad.",
            "items": {
              "type": "string"
            }
          },
          "maxAds": {
            "title": "Max ads (total)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of ads to save in this run, across all searches and URLs.",
            "default": 50
          },
          "maxAdsPerQuery": {
            "title": "Max ads per search",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Limit for each advertiser, keyword or search URL, so one big advertiser does not use the whole run. 0 means no per-search limit.",
            "default": 0
          },
          "countryCodes": {
            "title": "🌍 Countries",
            "type": "array",
            "description": "Only ads shown in these countries. Two-letter ISO codes, e.g. US, GB, DE. Leave empty for all countries. Note: LinkedIn publishes run dates and impressions only for ads shown in the EU and Brazil.",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "📅 Date range",
            "enum": [
              "all-time",
              "past-day",
              "past-week",
              "past-month",
              "current-month",
              "current-year",
              "past-year",
              "custom"
            ],
            "type": "string",
            "description": "When the ads ran. LinkedIn keeps about one year of ads. \"Custom\" uses Start date and End date.",
            "default": "all-time"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day for the custom date range, YYYY-MM-DD."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day for the custom date range, YYYY-MM-DD."
          },
          "adFormat": {
            "title": "🎨 Ad format",
            "enum": [
              "all",
              "SPONSORED_UPDATES",
              "IMAGE",
              "VIDEO",
              "DOCUMENT",
              "CAROUSEL",
              "EVENT",
              "TEXT_ADS",
              "DYNAMIC_ADS",
              "MESSAGE"
            ],
            "type": "string",
            "description": "Keep only ads of this format. Ads of other formats are skipped and not charged.",
            "default": "all"
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "RECENT",
              "OLDEST",
              "MOST_CLICKS"
            ],
            "type": "string",
            "description": "Newest or oldest ads first. (\"Most clicks\" is kept for older saved inputs; LinkedIn no longer offers it, so it sorts newest first.)",
            "default": "RECENT"
          },
          "countryCode": {
            "title": "Country (single, older inputs)",
            "type": "string",
            "description": "One two-letter country code. Kept for older saved inputs; use Countries instead."
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Attempts per LinkedIn page before giving up on it (at least 4 are used for bot-challenge recovery).",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}