{
  "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.2",
    "x-build-id": "g3R6bKpuGos0bnYW2"
  },
  "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": {
          "mode": {
            "title": "What would you like to collect?",
            "enum": [
              "search",
              "adIds",
              "auto"
            ],
            "type": "string",
            "description": "Choose Search ads for companies, keywords or search URLs, or Get ads by ID or URL for specific ads. Automatic keeps existing API calls and saved tasks compatible.",
            "default": "auto"
          },
          "searchTerms": {
            "title": "Companies, keywords or Ad Library URLs",
            "type": "array",
            "description": "For Search ads: one company, keyword, payer or LinkedIn Ad Library search URL per line. Search URLs carry their own country and date filters.",
            "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"
          },
          "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
          },
          "includeDetails": {
            "title": "Include full details — $1.30 / 1,000 ads total on Free",
            "type": "boolean",
            "description": "Free plan: $0.50 per 1,000 ads plus $0.80 per 1,000 successful details, total $1.30. With details off: $0.50 per 1,000 ads. Platform usage included; paid-plan discounts are shown in Pricing. Adds payer, dates, creative media, landing page, UTM, impressions and targeting where published. Required for Get ads by ID or URL.",
            "default": true
          },
          "adIds": {
            "title": "Ad IDs or ad URLs",
            "type": "array",
            "description": "One LinkedIn Ad Library ad ID or detail URL per line. Every supplied value must identify an ad.",
            "items": {
              "type": "string"
            }
          },
          "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": ""
          },
          "dateRange": {
            "title": "Date range",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Choose a period, or use custom Shown from / Shown until dates in Search filters. Use Any time when entering custom dates.",
            "default": ""
          },
          "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)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}