{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Search Scraper",
    "description": "Search public LinkedIn Ad Library ads by advertiser or keyword, with normalized creatives and EU transparency fields.",
    "version": "1.1",
    "x-build-id": "OEK71puh789dI1WRJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~linkedin-ad-library-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-linkedin-ad-library-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/khadinakbar~linkedin-ad-library-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-linkedin-ad-library-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/khadinakbar~linkedin-ad-library-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-linkedin-ad-library-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": {
          "advertisers": {
            "title": "Advertiser names",
            "type": "array",
            "description": "Use this when you know the company or advertiser whose public ads you want to review. Enter a list of display names such as Microsoft or HubSpot. Defaults to Microsoft only when neither advertisers nor keywords is supplied. This is not a LinkedIn company URL or a private Campaign Manager account ID.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Creative keywords",
            "type": "array",
            "description": "Use this when you want public ads whose creative matches a phrase instead of one known advertiser. Enter plain keywords such as CRM software or data warehouse. Defaults to no keyword searches, and each keyword becomes an independent search. This is not a Boolean LinkedIn profile query or a list of campaign IDs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Use this when results should be limited to countries reported by the Ad Library. Enter ISO alpha-2 codes such as US, DE, or GB. Defaults to no country filter, while supplied codes are sent together to each search. This is not a proxy location setting or a city-level targeting filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Use this when limiting ads by the beginning of their reported run window. Enter an ISO date such as 2026-01-01. Defaults to no lower date boundary and may be used with or without an end date. This is not a timestamp, a relative date phrase, or a campaign launch prediction.",
            "default": ""
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Use this when limiting ads by the end of their reported run window. Enter an ISO date such as 2026-06-30. Defaults to no upper date boundary and must not be before startDate when both are supplied. This is not an expiry estimate or a relative date phrase.",
            "default": ""
          },
          "maxResults": {
            "title": "Maximum ad records",
            "type": "integer",
            "description": "Use this to cap the number of normalized ad records saved and billed in this run. Enter an integer such as 20 between 1 and 100. Defaults to 20, which also caps the primary event charge before platform usage. This is not a page number or a guarantee that the Ad Library contains that many matches.",
            "default": 20
          },
          "maxPagesPerSearch": {
            "title": "Maximum pages per search",
            "type": "integer",
            "description": "Use this to bound provider pagination for every advertiser or keyword search. Enter an integer such as 2 between 1 and 10. Defaults to 1 page so the actor remains fast and cost-predictable. This is not an overall record limit because maxResults controls persisted ads.",
            "default": 1
          },
          "fetchAdDetails": {
            "title": "Fetch optional details",
            "type": "boolean",
            "description": "Use this when you need a second verified provider call per saved ad for richer public transparency data. Set true to request details and false to use the normalized search response only. Defaults to true and adds the documented detail-enrichment event only after a successful detail fetch. This is not a request for private advertiser, member, or Campaign Manager data.",
            "default": true
          },
          "providerPreference": {
            "title": "Provider preference",
            "enum": [
              "scrapecreators-first",
              "sociavault-first"
            ],
            "type": "string",
            "description": "Use this to choose which configured public-data provider is attempted first. Select scrapecreators-first or sociavault-first. Defaults to scrapecreators-first, and the other configured provider is tried after a route failure. This is not a user API key field or a promise that one provider has private LinkedIn data.",
            "default": "scrapecreators-first"
          },
          "responseFormat": {
            "title": "Response format",
            "enum": [
              "concise",
              "detailed"
            ],
            "type": "string",
            "description": "Use this to choose the token budget of each saved ad record. Select concise for core creative and transparency fields or detailed for bounded media and targeting arrays. Defaults to concise for agent-friendly output under the normal result cap. This is not a raw-provider-payload option and never exposes credentials.",
            "default": "concise"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}