{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library Scraper | Ads & Targeting | $0.50/1K",
    "description": "LinkedIn Ad Library Scraper and LinkedIn Ads API: competitor ads by company, keyword or payer for $0.50/1K. Impressions by country, targeting, payer, dates and CTA. No login.",
    "version": "0.1",
    "x-build-id": "JEjdHMxCHbDKilUug"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/monkey.d.scraping~linkedin-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-monkey.d.scraping-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/monkey.d.scraping~linkedin-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-monkey.d.scraping-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/monkey.d.scraping~linkedin-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-monkey.d.scraping-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": {
          "searchTerms": {
            "title": "Companies, keywords or Ad Library URLs",
            "type": "array",
            "description": "One per line: a company name (for example <code>hubspot</code>), a keyword, a payer, or a LinkedIn Ad Library search URL. What is searched depends on <b>Search by</b>.",
            "default": [
              "hubspot"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchBy": {
            "title": "Search by",
            "enum": [
              "advertiser",
              "keyword",
              "payer"
            ],
            "type": "string",
            "description": "Advertiser (company name), keyword in the ad, or the entity that paid for the ad.",
            "default": "advertiser"
          },
          "country": {
            "title": "Country where the ads were shown",
            "enum": [
              "",
              "US",
              "GB",
              "DE",
              "FR",
              "IT",
              "ES",
              "NL",
              "BE",
              "IE",
              "SE",
              "DK",
              "FI",
              "NO",
              "PL",
              "PT",
              "AT",
              "CH",
              "CZ",
              "RO",
              "GR",
              "HU",
              "CA",
              "AU",
              "NZ",
              "IN",
              "SG",
              "AE",
              "SA",
              "IL",
              "ZA",
              "BR",
              "MX",
              "AR",
              "JP"
            ],
            "type": "string",
            "description": "Only ads shown in this country. Leave on All countries for every ad.",
            "default": ""
          },
          "maxAdsPerSearch": {
            "title": "Maximum ads per search",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Ads to return for each company, keyword or URL. Start with 10 to check the output.",
            "default": 10
          },
          "dateRange": {
            "title": "Date range",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "When the ads ran. Ignored if you set <b>Shown from</b> or <b>Shown until</b>.",
            "default": ""
          },
          "includeDetails": {
            "title": "Include payer, dates, impressions and targeting",
            "type": "boolean",
            "description": "Opens each ad's detail page: payer, run dates, CTA and link, total impressions, impressions by country and targeting (published for ads shown in the EU). Turn off for a faster and cheaper list of ads.",
            "default": true
          },
          "exactAdvertiser": {
            "title": "Only this exact advertiser",
            "type": "boolean",
            "description": "LinkedIn also returns ads of advertisers whose name contains your term (for example partners). Turn on to keep only the advertiser whose name matches exactly. Applies to Search by advertiser.",
            "default": false
          },
          "adFormats": {
            "title": "Ad formats",
            "type": "array",
            "description": "Only these formats. Leave empty for all formats.",
            "items": {
              "type": "string",
              "enum": [
                "single-image",
                "video",
                "carousel",
                "document",
                "event",
                "message",
                "text",
                "spotlight",
                "follower",
                "job",
                "article"
              ],
              "enumTitles": [
                "Single image",
                "Video",
                "Carousel",
                "Document",
                "Event",
                "Message (InMail)",
                "Text ad",
                "Spotlight",
                "Follower",
                "Job",
                "Article"
              ]
            }
          },
          "impressionsMin": {
            "title": "Minimum impressions",
            "minimum": 1000,
            "type": "integer",
            "description": "Only ads with at least this many impressions (LinkedIn's own filter, for ads shown in the EU and Brazil). For example 10000."
          },
          "impressionsMax": {
            "title": "Maximum impressions",
            "minimum": 1000,
            "type": "integer",
            "description": "Only ads with at most this many impressions (EU and Brazil). For example 1000000."
          },
          "dateFrom": {
            "title": "Shown from",
            "type": "string",
            "description": "Custom start date (YYYY-MM-DD)."
          },
          "dateTo": {
            "title": "Shown until",
            "type": "string",
            "description": "Custom end date (YYYY-MM-DD)."
          },
          "adIds": {
            "title": "Ad IDs or ad URLs",
            "type": "array",
            "description": "Get details for specific ads: LinkedIn Ad Library ad IDs or detail URLs, one per line.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}