{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper",
    "description": "LinkedIn Ad Library Scraper pulls the ads any company runs on LinkedIn, by company, keyword or payer. Returns ad text, headline, image or video, advertiser and payer, plus run dates, impressions by country and targeting for ads shown in the EU. Monitor mode returns only new ads.",
    "version": "0.1",
    "x-build-id": "HwcVjJXRmeghF4VM6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/agnes.developer.queen~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-agnes.developer.queen-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/agnes.developer.queen~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-agnes.developer.queen-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/agnes.developer.queen~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-agnes.developer.queen-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": {
          "companies": {
            "title": "Companies",
            "maxItems": 100,
            "type": "array",
            "description": "Advertiser names as they appear on LinkedIn, for example HubSpot. Returns the ads that company runs, from the Ad Library's account owner search.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "maxItems": 100,
            "type": "array",
            "description": "Optional. Words that appear in the ad, for example webinar or CRM. Each keyword is its own search.",
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "Payers",
            "maxItems": 100,
            "type": "array",
            "description": "Optional. The name of the entity that paid for the ads, when it differs from the advertiser.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Ad Library search URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Optional. Search URLs copied from linkedin.com/ad-library/search, with any filters already set.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "countries": {
            "title": "Countries",
            "maxItems": 50,
            "type": "array",
            "description": "ISO two-letter country codes such as US, GB or DE. Only ads shown in those countries are returned. EU is not a code and matches nothing; list the member states instead. Leave empty for all countries.",
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "When the ads ran.",
            "default": "last-30-days"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "For the custom range, YYYY-MM-DD."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "For the custom range, YYYY-MM-DD."
          },
          "minImpressions": {
            "title": "Minimum impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only ads with at least this many impressions. LinkedIn publishes impressions only for ads shown in the European Union, so this filter drops every other ad."
          },
          "maxImpressions": {
            "title": "Maximum impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only ads with at most this many impressions. Same EU limit as above."
          },
          "maxAdsPerSearch": {
            "title": "Maximum ads per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many ads for each company, keyword, payer or URL. Only ads with an ID, an advertiser and content (text, picture or video) are charged.",
            "default": 100
          },
          "withDetails": {
            "title": "Open each ad's detail page",
            "type": "boolean",
            "description": "Reads the advertiser link, the payer, run dates, impressions by country and targeting for every ad. Off, the run is about five times faster and returns what the search results show: advertiser, text, headline, picture and link.",
            "default": true
          },
          "onlyNewSinceLastRun": {
            "title": "Only ads new since my last run (monitor mode)",
            "type": "boolean",
            "description": "Monitor mode. The first run delivers current ads up to your limit and remembers every ad it saw. Later runs of the same search deliver only ads that appeared since. Schedule it daily or weekly to watch competitors.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The Ad Library answers browsers on residential IPs. Datacenter IPs are blocked.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}