{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ad Library API",
    "description": "LinkedIn Ad Library scraper: the LinkedIn ads of any advertiser, keyword or payer, with text, image or video, format and link. With details: landing page, button, who paid, plus dates, impressions by country and targeting for ads shown in the EU. Optional company facts and funding. No login.",
    "version": "0.1",
    "x-build-id": "7B9dssSsEKexv3cKK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deepmine~linkedin-ad-library/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deepmine-linkedin-ad-library",
        "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/deepmine~linkedin-ad-library/runs": {
      "post": {
        "operationId": "runs-sync-deepmine-linkedin-ad-library",
        "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/deepmine~linkedin-ad-library/run-sync": {
      "post": {
        "operationId": "run-sync-deepmine-linkedin-ad-library",
        "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": "Advertisers, keywords or links",
            "type": "array",
            "description": "One per line: an advertiser name (HubSpot, Salesforce), or a keyword or payer name when you pick that below. Links work too: a company or showcase page (linkedin.com/company/nvidia: that company's ads only), a search link copied from linkedin.com/ad-library (its own filters are used) or a link to one ad.",
            "default": [
              "HubSpot",
              "Salesforce"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search by",
            "enum": [
              "advertiser",
              "keyword",
              "payer"
            ],
            "type": "string",
            "description": "What the text lines are: advertiser names (like the Ad Library's Advertiser box: LinkedIn also returns similar names, such as partners), keywords in the ad, or the name of who paid for it.",
            "default": "advertiser"
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Only ads shown in these countries: two-letter codes such as US, GB or DE. Empty: every country.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxAdsPerSearch": {
            "title": "Max ads per search",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop each search after this many ads. You pay per ad, so this caps the cost of each search. Ads come in LinkedIn's order, newest first. About 3 minutes per 1,000 ads with details (1,000 took 183 s): above about 18,000 ads, raise the run timeout.",
            "default": 100
          },
          "includeAdDetails": {
            "title": "Include ad details",
            "type": "boolean",
            "description": "Read each ad's page: the whole ad text, landing page, button, video, advertiser page and who paid, and for ads shown in the EU the dates it ran, impressions by country and targeting. An ad with details costs more than a plain ad (see Pricing); without them a row has the advertiser, format, headline, the start of the text and the picture. An ad whose details fail is charged as a plain ad.",
            "default": true
          },
          "includeCompanyData": {
            "title": "Include company details",
            "type": "boolean",
            "description": "Add each advertiser's company facts to its ads: website, industry, size, employees on LinkedIn, followers, headquarters, type, year founded, specialties, description, offices, similar companies, and funding (total raised, rounds, investors) when CB Insights lists the company. Needs ad details (or a company link). Each company is looked up once per run; an ad with company details costs more (see Pricing), and an ad whose company page isn't found isn't charged for it.",
            "default": false
          },
          "dateRange": {
            "title": "Shown in",
            "enum": [
              "all",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Only ads shown in this period. Ignored when you set dates below.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Shown on or after",
            "type": "string",
            "description": "Only ads shown on or after this date (YYYY-MM-DD). The Ad Library's dates go back 12 months."
          },
          "dateTo": {
            "title": "Shown on or before",
            "type": "string",
            "description": "Only ads shown on or before this date (YYYY-MM-DD)."
          },
          "sortOrder": {
            "title": "Order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Newest ads first (LinkedIn's default) or oldest first.",
            "default": "newest"
          },
          "targetingIncluded": {
            "title": "Targeting used",
            "type": "array",
            "description": "Only ads that target people by the kinds you pick (for example Job: job titles, functions or seniority). LinkedIn publishes targeting for ads shown in the EU only, so with this filter you get EU ads, and LinkedIn ignores Countries.",
            "items": {
              "type": "string",
              "enum": [
                "language",
                "location",
                "audience",
                "demographic",
                "company",
                "education",
                "job",
                "interests"
              ],
              "enumTitles": [
                "Language",
                "Location",
                "Audience",
                "Demographic",
                "Company",
                "Education",
                "Job",
                "Member interests and traits"
              ]
            },
            "default": []
          },
          "targetingExcluded": {
            "title": "Targeting used to leave people out",
            "type": "array",
            "description": "Only ads that exclude people by the kinds you pick (for example Company: an exclusion list of companies). EU ads only, like the filter above.",
            "items": {
              "type": "string",
              "enum": [
                "language",
                "location",
                "audience",
                "demographic",
                "company",
                "education",
                "job",
                "interests"
              ],
              "enumTitles": [
                "Language",
                "Location",
                "Audience",
                "Demographic",
                "Company",
                "Education",
                "Job",
                "Member interests and traits"
              ]
            },
            "default": []
          },
          "onlyThisAdvertiser": {
            "title": "Only this advertiser's own ads",
            "type": "boolean",
            "description": "For advertiser searches: keep only ads whose advertiser is named like your search (HubSpot keeps HubSpot, not a partner such as IXTENSA HubSpot; Salesforce keeps Salesforce Data 360). Ads left out aren't charged.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify residential proxies are the default: LinkedIn refuses datacenter IPs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}