{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper",
    "description": "Scrape LinkedIn Ad Library ads by keyword, advertiser company or Ad Library URL: ad text, headline, CTA, landing page, images, videos, documents, run dates, impressions, impressions by country and targeting. Monitor mode returns only new ads.",
    "version": "0.1",
    "x-build-id": "zOmLDm1Ga4sjDwKvl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wakeful_outhouse~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wakeful_outhouse-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/wakeful_outhouse~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-wakeful_outhouse-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/wakeful_outhouse~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-wakeful_outhouse-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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "One search per line. Finds ads whose text contains the keyword (<code>CRM</code>, <code>cybersecurity</code>).",
            "items": {
              "type": "string"
            }
          },
          "companies": {
            "title": "Advertisers (companies)",
            "type": "array",
            "description": "One advertiser per line: a company name (<code>HubSpot</code>), a numeric LinkedIn company ID (<code>1879</code>) or a company page URL (<code>https://www.linkedin.com/company/1035</code>). Numeric IDs give exact matches; names match the advertiser name as LinkedIn does.",
            "items": {
              "type": "string"
            }
          },
          "adLibraryUrls": {
            "title": "Ad Library URLs",
            "type": "array",
            "description": "Any <code>https://www.linkedin.com/ad-library/search?...</code> URL copied from your browser (its filters are used as they are), or ad pages <code>https://www.linkedin.com/ad-library/detail/123</code>.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Two-letter codes of the countries where the ads were shown (<code>US</code>, <code>DE</code>, <code>GB</code>…). Empty means all countries.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "all-time",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Only ads that ran in this period. Ignored when you set a start or end date below.",
            "default": "all-time"
          },
          "startDate": {
            "title": "Ran from",
            "type": "string",
            "description": "Only ads that ran on or after this date. LinkedIn accepts custom dates within the last 12 months."
          },
          "endDate": {
            "title": "Ran until",
            "type": "string",
            "description": "Only ads that ran on or before this date."
          },
          "includeAdDetails": {
            "title": "Include run dates, impressions and targeting",
            "type": "boolean",
            "description": "Open each ad page to add the full ad text, CTA, landing page, all media, Paid by, start and end date, total impressions, impressions by country and targeting (languages, locations, audience, company, job, demographic). LinkedIn publishes run dates, impressions and targeting only for ads shown in the EU; the detail fee is charged only for ads that have them. Turn off for the cheapest list of ads from search results only.",
            "default": true
          },
          "monitorName": {
            "title": "Monitor name (only new ads)",
            "type": "string",
            "description": "Turn on monitoring: give this search any name, for example <code>competitors-us</code>. Each run then saves only ads that earlier runs with the same name have not returned, so you pay only for new ads. Use it with an Apify Schedule. The first run returns everything. The list of seen ads is kept in the <code>linkedin-ads-monitor</code> key-value store of your account. Leave empty for a normal run."
          },
          "maxAdsPerQuery": {
            "title": "Max ads per query",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many ads for each input line. 0 means no limit. In monitor mode this counts all ads checked, new and already seen.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many queries run in parallel.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Residential proxy is recommended.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}