{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper & New Ads Monitor",
    "description": "Track competitors' LinkedIn ads from the public LinkedIn Ad Library. Search by company, keyword or payer and country, get ONLY NEW ads since the last run: ad copy, headline, CTA, format, images/video, landing page, payer, EU run dates, impressions and targeting.",
    "version": "1.0",
    "x-build-id": "Hy9xZpErtqVGD6s15"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ivan-petrus-g~linkedin-ad-library-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ivan-petrus-g-linkedin-ad-library-monitor",
        "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/ivan-petrus-g~linkedin-ad-library-monitor/runs": {
      "post": {
        "operationId": "runs-sync-ivan-petrus-g-linkedin-ad-library-monitor",
        "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/ivan-petrus-g~linkedin-ad-library-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-ivan-petrus-g-linkedin-ad-library-monitor",
        "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 (advertisers)",
            "type": "array",
            "description": "Company / advertiser names as shown on LinkedIn, e.g. 'HubSpot'. LinkedIn company URLs (linkedin.com/company/hubspot) are accepted too. LinkedIn matches names loosely; turn on 'Exact company match' to drop partners and lookalikes.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (in ad copy)",
            "type": "array",
            "description": "Find ads that mention these words or phrases, e.g. 'crm', 'sales automation'. Each keyword is one search.",
            "items": {
              "type": "string"
            }
          },
          "payers": {
            "title": "Payers",
            "type": "array",
            "description": "Search by the 'Paid for by' entity, e.g. 'HubSpot, Inc.'. Each payer is one search.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Only ads shown in these countries (2-letter codes: US, GB, DE, FR...). Empty = all countries.",
            "items": {
              "type": "string"
            }
          },
          "dateRange": {
            "title": "Date range",
            "enum": [
              "any",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom"
            ],
            "type": "string",
            "description": "When the ads ran. 'custom' uses startDate/endDate. LinkedIn keeps ads for about one year.",
            "default": "any"
          },
          "startDate": {
            "title": "Start date (custom range)",
            "type": "string",
            "description": "YYYY-MM-DD, used when Date range = custom."
          },
          "endDate": {
            "title": "End date (custom range)",
            "type": "string",
            "description": "YYYY-MM-DD, defaults to today."
          },
          "includeDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Opens each ad's detail page (1 extra request per ad, charged as 'ad details'): full ad copy, CTA button, landing page URL, 'Paid for by', all carousel cards / document pages and, for ads shown in the EU, run dates, total impressions range, impressions by country and targeting (language, location, audience, company, job...).",
            "default": false
          },
          "maxAdsPerSearch": {
            "title": "Max ads per search",
            "minimum": 0,
            "type": "integer",
            "description": "Newest ads first. 0 = all ads (can be thousands for big advertisers and keywords).",
            "default": 50
          },
          "exactCompanyMatch": {
            "title": "Exact company match",
            "type": "boolean",
            "description": "Keep only ads whose advertiser name equals the company you entered (LinkedIn's search also returns partners and similarly named pages).",
            "default": false
          },
          "skipMemberAds": {
            "title": "Skip ads posted by individual members",
            "type": "boolean",
            "description": "Drop 'thought leader' ads that are posted from a person's profile. They are never output with personal data anyway: the member's name, photo and profile are always removed.",
            "default": false
          },
          "onlyNewAds": {
            "title": "Only new ads since last run",
            "type": "boolean",
            "description": "Remember which ads were already seen (in a named key-value store) and output only new ones. Perfect for daily schedules.",
            "default": true
          },
          "firstRunBehavior": {
            "title": "First run",
            "enum": [
              "outputAll",
              "baselineOnly"
            ],
            "type": "string",
            "description": "outputAll = the first run returns all current ads (up to the limit). baselineOnly = the first run only records current ads; later runs return what's new (cheaper).",
            "default": "outputAll"
          },
          "stateStoreName": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Named key-value store that keeps seen ad IDs. Use different names for independent monitors.",
            "default": "linkedin-ads-monitor-state"
          },
          "includeSummary": {
            "title": "Summary row per search",
            "type": "boolean",
            "description": "Adds one free summary row per search: ads fetched, new ads, formats, top advertisers and a link to the same search on LinkedIn.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Searches processed in parallel, each with its own proxy session.",
            "default": 2
          },
          "requestDelaySecs": {
            "title": "Delay between requests (s)",
            "minimum": 1,
            "maximum": 15,
            "type": "number",
            "description": "Pause between two requests of one worker (polite pacing; LinkedIn rate-limits fast clients).",
            "default": 2.5
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Retries with backoff and a new proxy IP on 429/999/5xx/login walls.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is required for reliable runs. Datacenter proxy is used first.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Residential proxy fallback",
            "type": "boolean",
            "description": "If datacenter IPs get rate-limited (HTTP 429) repeatedly, switch that worker to Apify residential proxy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}