{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper: Competitor Ads",
    "description": "See every LinkedIn ad a competitor runs: search the LinkedIn Ad Library by company, keyword, country and date, and get ad text, images, videos, landing pages, who paid, run dates, impressions by country and targeting. No login. CSV, Excel, JSON.",
    "version": "0.1",
    "x-build-id": "Ih53gBWHgcedxj7V4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~linkedin-competitor-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-linkedin-competitor-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/neverempty~linkedin-competitor-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-linkedin-competitor-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/neverempty~linkedin-competitor-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-linkedin-competitor-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": {
          "companies": {
            "title": "Advertiser names",
            "type": "array",
            "description": "Company names whose LinkedIn ads you want, one per line, such as HubSpot or Siemens. Each name is searched as the advertiser in LinkedIn's Ad Library and returns that company's ads. If every search list is empty, the example advertiser HubSpot is read.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords in the ad",
            "type": "array",
            "description": "Words to find in ad text, one per line, such as hiring or CRM software. Each keyword returns the ads from any advertiser that use it.",
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "Paid by (legal entity)",
            "type": "array",
            "description": "The company that paid for the ads, one per line, when it differs from the brand name (for example an agency or a parent company).",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "Ad Library URLs",
            "type": "array",
            "description": "Paste LinkedIn Ad Library addresses, one per line: a search results page (https://www.linkedin.com/ad-library/search?accountOwner=HubSpot&countries=US) is read with its own filters, and one ad (https://www.linkedin.com/ad-library/detail/970353693) returns that ad.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries the ads were shown in",
            "type": "array",
            "description": "Two-letter country codes, one per line, such as US, GB or DE. Empty means all countries.",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "When the ads ran",
            "enum": [
              "all-time",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Pick a period, or leave empty for all time (LinkedIn keeps ads for one year). To set exact days, use Start date and End date instead."
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Only ads that ran on or after this day (YYYY-MM-DD). The earliest is one year before today."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Only ads that ran on or before this day (YYYY-MM-DD). Empty means today."
          },
          "minImpressions": {
            "title": "Minimum impressions",
            "minimum": 1000,
            "type": "integer",
            "description": "Only ads with at least this many impressions, in thousands (1000, 5000, 1000000)."
          },
          "maxImpressions": {
            "title": "Maximum impressions",
            "minimum": 1000,
            "type": "integer",
            "description": "Only ads with at most this many impressions, in thousands (1000, 5000, 1000000)."
          },
          "maxAdsPerSearch": {
            "title": "Ads per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many ads to return for each name, keyword or search URL, newest first as LinkedIn lists them (1 to 5000). Empty means 50. With details, a run reads about 70 ads a minute, so the default 1-hour Timeout fits about 3,500; raise the Timeout for more."
          },
          "includeDetails": {
            "title": "Include full ad details",
            "type": "boolean",
            "description": "On by default: each ad also gets its detail page: who paid, run dates, impressions range, impressions by country, targeting (location, language, job, company), call to action, landing page URL, video and every version of the ad. Off: only what the search list shows (advertiser, format, ad text, headline, image), at a lower price per ad.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}