{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper - LinkedIn Ads Library Search",
    "description": "Scrape the LinkedIn Ads Library by company, ad-text keyword, or payer name. Get ad copy, headlines, creatives and landing pages in fast mode; add impressions, targeting and transparency fields in full mode. Track competitor B2B campaigns across countries in a single run.",
    "version": "0.2",
    "x-build-id": "ThtCcM159jYMfWvLi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jy-labs~linkedin-ad-library-multi-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jy-labs-linkedin-ad-library-multi-search-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/jy-labs~linkedin-ad-library-multi-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-jy-labs-linkedin-ad-library-multi-search-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/jy-labs~linkedin-ad-library-multi-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-jy-labs-linkedin-ad-library-multi-search-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": {
          "companyNames": {
            "title": "Company or advertiser names",
            "maxItems": 20,
            "type": "array",
            "description": "Company or advertiser names to search. You can combine these with keyword and payer searches, up to 20 unique searches in total.",
            "items": {
              "type": "string",
              "maxLength": 500
            }
          },
          "keywords": {
            "title": "Ad text keywords",
            "maxItems": 20,
            "type": "array",
            "description": "Keywords to search in public LinkedIn ads.",
            "items": {
              "type": "string",
              "maxLength": 500
            }
          },
          "payerNames": {
            "title": "Payer names",
            "maxItems": 20,
            "type": "array",
            "description": "Names shown in LinkedIn's “Paid for by” transparency field.",
            "items": {
              "type": "string",
              "maxLength": 500
            }
          },
          "countries": {
            "title": "Countries",
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "description": "Up to five two-letter country codes. Use ALL by itself to search all countries.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 3
            },
            "default": [
              "ALL"
            ]
          },
          "dateOption": {
            "title": "Date range",
            "enum": [
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "Select a LinkedIn date preset or choose a custom range within the last year. LinkedIn accepts completed UTC days only.",
            "default": "last-30-days"
          },
          "startDate": {
            "title": "Custom start date",
            "type": "string",
            "description": "Required with a custom date range. Use YYYY-MM-DD and stay within the most recent year."
          },
          "endDate": {
            "title": "Custom end date",
            "type": "string",
            "description": "Required with a custom date range. Use YYYY-MM-DD and choose no later than the previous UTC day."
          },
          "detailMode": {
            "title": "Detail mode",
            "enum": [
              "fast",
              "full"
            ],
            "type": "string",
            "description": "Fast collects search cards. Full costs twice as much per result (see the Pricing tab) and also opens each detail page for payer, run period, public impressions, targeting, and landing URL.",
            "default": "fast"
          },
          "maxResultsPerSearch": {
            "title": "Maximum results per search",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum unique ads collected for each company, keyword, or payer search.",
            "default": 50
          },
          "maxTotalResults": {
            "title": "Maximum total results",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum unique ads returned and billed after merging duplicates across all searches.",
            "default": 500
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave this as is (Apify Proxy, automatic) for the recommended setup: the Actor connects directly first and switches the run to Apify Proxy (datacenter) only if LinkedIn rate-limits it (HTTP 429/999); a search LinkedIn keeps blocking (HTTP 403) moves on its own to Apify Proxy (datacenter), then to residential (US) if still blocked. Any other setting — proxy groups such as Residential, a country, your own proxy URLs, or no proxy — is used exactly as set for every request.",
            "default": {
              "useApifyProxy": true
            }
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time for each HTTP or browser navigation, in seconds.",
            "default": 45
          },
          "debugMode": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Enable additional operational logs. Cookies, tokens, and page HTML are never logged.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}