{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Scraper",
    "description": "Scrape LinkedIn ads from the LinkedIn Ad Library by keyword, advertiser, payer or company: ad copy, headline, format, image, video, carousel, CTA, landing page, who paid, run dates, impressions by country and targeting. Only-new-ads mode for daily monitoring. No login.",
    "version": "0.1",
    "x-build-id": "JswEbIPcEVpRAuza7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blueskyscraper~linkedin-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blueskyscraper-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/blueskyscraper~linkedin-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-blueskyscraper-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/blueskyscraper~linkedin-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-blueskyscraper-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": {
          "searchTerms": {
            "title": "🔍 Search terms",
            "type": "array",
            "description": "One search per line. What a line means depends on <b>Search by</b>: a keyword from the ad copy (<code>crm</code>), an advertiser name (<code>hubspot</code>), a payer name, or a LinkedIn company ID (<code>1337</code>). Each line is billed only for the ads it returns.",
            "default": [
              "crm"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "🔎 Search by",
            "enum": [
              "keyword",
              "advertiser",
              "payer",
              "companyId"
            ],
            "type": "string",
            "description": "How to read the search terms. <b>Keyword</b> finds ads whose copy contains the word; <b>Advertiser</b> matches the company or person shown on the ad (partial names match: <code>hubspot</code> also returns HubSpot partners); <b>Payer</b> matches the \"Paid for by\" entity; <b>Company ID</b> returns exactly one company's ads.",
            "default": "keyword"
          },
          "countries": {
            "title": "🌍 Countries",
            "type": "array",
            "description": "Keep only ads shown in these countries — two-letter codes: <code>US</code>, <code>GB</code>, <code>DE</code>, <code>FR</code>… Empty = all countries. Impressions and targeting are published for ads that reached the EU, so <code>DE</code> or <code>FR</code> gives the fullest detail rows.",
            "items": {
              "type": "string"
            }
          },
          "maxAdsPerSearch": {
            "title": "💯 Ads per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many ads to take from each search line, newest first. LinkedIn serves 24 per page; up to 5,000 per search per run.",
            "default": 24
          },
          "includeDetails": {
            "title": "📊 Add impressions, countries, targeting and landing page ($ $0.0032 per ad instead of $0.0016)",
            "type": "boolean",
            "description": "Opens each ad's page in the Ad Library: full ad text, who paid, run dates, total impressions and impressions by country, targeted languages and locations, which targeting criteria were used (audience, company, job, demographic…), call-to-action button, landing page URL with its UTM parameters, video file. Impressions and targeting exist only for ads LinkedIn reports under the EU Digital Services Act; for other ads those fields stay empty. Such an ad is billed as an ad with details.",
            "default": false
          },
          "companies": {
            "title": "🏢 Companies",
            "type": "array",
            "description": "Competitors whose LinkedIn ads you want, one per line: a LinkedIn company page (<code>https://www.linkedin.com/company/hubspot/</code>), a company ID (<code>68529</code>) or a name (<code>HubSpot</code>). A page URL or ID returns exactly that company's ads; a name uses LinkedIn's advertiser-name search, which also matches partners with the name in theirs.",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "📅 Date range",
            "enum": [
              "any",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Keep only ads that ran in this period. For exact dates use Start date / End date below instead.",
            "default": "any"
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Custom range start, YYYY-MM-DD (for example <code>2026-01-01</code>). Overrides Date range."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Custom range end, YYYY-MM-DD (for example <code>2026-03-31</code>). Overrides Date range."
          },
          "sortOrder": {
            "title": "Order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Newest ads first (LinkedIn's default) or oldest first.",
            "default": "newest"
          },
          "startUrls": {
            "title": "🔗 Ad Library URLs",
            "type": "array",
            "description": "Paste LinkedIn Ad Library links as you see them in the browser — a search (<code>https://www.linkedin.com/ad-library/search?keyword=crm&countries=US,GB</code>, every filter of the page kept) or a single ad (<code>https://www.linkedin.com/ad-library/detail/1560106944</code>, always returned with details).",
            "items": {
              "type": "string"
            }
          },
          "onlyNewRowsStore": {
            "title": "🔁 Only new ads — memory name",
            "pattern": "^[A-Za-z0-9-]{0,63}$",
            "type": "string",
            "description": "Give this run a name — <code>my-ads-watch</code> — and the Actor remembers every ad it delivered under that name. Every later run with the same name writes and charges <b>only ads you have not received before</b>. Schedule the Actor daily to get a feed of new LinkedIn ads instead of the whole list each time. Leave empty to get everything found, every time."
          },
          "maxConcurrency": {
            "title": "Parallel ad pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many ad pages to open at once when details are on. 4 is safe; higher is faster but gets more refusals.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}