{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Keyword & Advertiser Scraper",
    "description": "Search the public LinkedIn Ad Library by keyword, advertiser, country, or date range, and get headline, body copy, advertiser info, media URLs, and call-to-action for the ads each search returns.",
    "version": "2.0",
    "x-build-id": "wrUve4WlpfpUTcaYq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nimbryxo-studio~linkedin-ad-library-keyword-and-advertiser-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nimbryxo-studio-linkedin-ad-library-keyword-and-advertiser-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/nimbryxo-studio~linkedin-ad-library-keyword-and-advertiser-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nimbryxo-studio-linkedin-ad-library-keyword-and-advertiser-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/nimbryxo-studio~linkedin-ad-library-keyword-and-advertiser-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nimbryxo-studio-linkedin-ad-library-keyword-and-advertiser-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "adDetails",
              "directUrls",
              "count"
            ],
            "type": "string",
            "description": "What to collect: search the library, open specific ads, process pasted URLs, or count matches only.",
            "default": "search"
          },
          "searchTerms": {
            "title": "Keywords",
            "type": "array",
            "description": "One or more keyword searches, e.g. 'AI' or 'cloud computing'. Each keyword is an independent search (union), not a combination.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "advertisers": {
            "title": "Advertisers",
            "type": "array",
            "description": "Advertiser names (fuzzy accountOwner search) or LinkedIn company URLs. Each name is an independent search. Use companyIds for exact matching.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "companyIds": {
            "title": "LinkedIn Company IDs",
            "type": "array",
            "description": "Exact numeric LinkedIn company IDs (for example, Microsoft is 1035). Multiple IDs are OR-ed in one exact search. Company URLs are accepted too.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "companyUrls": {
            "title": "Company URLs",
            "type": "array",
            "description": "LinkedIn company page URLs. The actor resolves each public page to its numeric organization ID and searches it exactly.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "payer": {
            "title": "Paid for by (payer)",
            "type": "array",
            "description": "Search ads by the legal entity that paid for them, e.g. 'Microsoft Corporation'. Each payer is an independent search.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "advertiserMatch": {
            "title": "Advertiser Name Match",
            "enum": [
              "any",
              "startsWith",
              "exact"
            ],
            "type": "string",
            "description": "Client-side precision for advertiser-name searches. Exact company IDs are never filtered. 'Starts with' removes partner-noise results while keeping names such as 'Microsoft in Business'.",
            "default": "startsWith"
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "ISO-3166 alpha-2 delivery country codes (US, GB, DE, ...) or ALL. Multiple codes are sent in one comma-separated filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "dateOption": {
            "title": "Date Range",
            "enum": [
              "any-time",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "LinkedIn's date window. Use custom-date-range with startDate/endDate for an exact period (maximum 12 months back).",
            "default": "last-30-days"
          },
          "startDate": {
            "title": "Start Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Start of a custom range (YYYY-MM-DD). Required when dateOption is custom-date-range."
          },
          "endDate": {
            "title": "End Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "End of a custom range (YYYY-MM-DD). Required when dateOption is custom-date-range."
          },
          "sortOrder": {
            "title": "Sort Order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Newest first or oldest first.",
            "default": "newest"
          },
          "impressionsMinValue": {
            "title": "Minimum Impressions Value",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Lower bound of the impression range (EU transparency data only). LinkedIn requires both a minimum and a maximum value."
          },
          "impressionsMinUnit": {
            "title": "Minimum Impressions Unit",
            "enum": [
              "none",
              "thousand",
              "million"
            ],
            "type": "string",
            "description": "Unit for the minimum impression value.",
            "default": "none"
          },
          "impressionsMaxValue": {
            "title": "Maximum Impressions Value",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Upper bound of the impression range (EU transparency data only). Required together with the minimum value."
          },
          "impressionsMaxUnit": {
            "title": "Maximum Impressions Unit",
            "enum": [
              "none",
              "thousand",
              "million"
            ],
            "type": "string",
            "description": "Unit for the maximum impression value.",
            "default": "none"
          },
          "targetingIncluded": {
            "title": "Included Targeting Facets",
            "type": "array",
            "description": "Filters ads that target any of these categories (EU transparency data only). Values: LANGUAGE, LOCATION, AUDIENCE, DEMOGRAPHIC, COMPANY, EDUCATION, JOB, INTERESTS_AND_TRAITS.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "targetingExcluded": {
            "title": "Excluded Targeting Facets",
            "type": "array",
            "description": "Filters ads that exclude any of these categories (EU transparency data only). Values: LANGUAGE, LOCATION, AUDIENCE, DEMOGRAPHIC, COMPANY, EDUCATION, JOB, INTERESTS_AND_TRAITS.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "includeDetails": {
            "title": "Include Detail Pages",
            "type": "boolean",
            "description": "Open each ad's detail page for full copy, CTA, landing URL, video, payer, and EU transparency data. Adds one request per ad.",
            "default": true
          },
          "decodeShortLinks": {
            "title": "Decode Short Links",
            "type": "boolean",
            "description": "Resolve lnkd.in and similar short links to their final landing URL. Adds one request per short link.",
            "default": false
          },
          "adIds": {
            "title": "Ad IDs or Detail URLs",
            "type": "array",
            "description": "Numeric ad IDs or linkedin.com/ad-library/detail/... URLs. Used by mode adDetails.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "directUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Pasted Ad Library search URLs, ad detail URLs, or LinkedIn company page URLs. Search filters are preserved.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Maximum Records",
            "minimum": 1,
            "maximum": 4800,
            "type": "integer",
            "description": "Global cap on ads returned across all searches (1-4800). Each search can return at most 4,800 ads (200 pages of 24).",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}