{
  "openapi": "3.0.1",
  "info": {
    "title": "Ultimate LinkedIn Ad Scraper",
    "description": "Extract LinkedIn ads at scale: search the Ad Library by keyword, advertiser or country, or scrape specific ad URLs. Export ad creatives, copy, impressions by country, run dates and audience targeting to JSON or CSV. No login required.",
    "version": "0.0",
    "x-build-id": "p5cPNBdWLVjaKMr4m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apt_marble~ultimate-linkedin-ad-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apt_marble-ultimate-linkedin-ad-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/apt_marble~ultimate-linkedin-ad-scraper/runs": {
      "post": {
        "operationId": "runs-sync-apt_marble-ultimate-linkedin-ad-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/apt_marble~ultimate-linkedin-ad-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-apt_marble-ultimate-linkedin-ad-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": {
          "adUrls": {
            "title": "Ad URLs or ad IDs",
            "maxItems": 1000,
            "type": "array",
            "description": "Specific Ad Library ads to scrape in full — one entry per line. Each entry is either a full detail URL like https://www.linkedin.com/ad-library/detail/1513233886 (query strings and trailing slashes are fine) or a bare numeric ad id like 1513233886. Every ad listed here returns a complete detail record. Optional — leave empty to only search. Up to 1000 ads per run; invalid entries are skipped with a warning.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Free-text search across ad content. To search, provide at least one of: keyword, companies, payer or account owner."
          },
          "companies": {
            "title": "Companies",
            "maxItems": 50,
            "type": "array",
            "description": "Filter to ads from specific advertisers. Accepts company names (\"Microsoft\"), numeric LinkedIn company IDs (\"1035\") or company page URLs (\"https://www.linkedin.com/company/microsoft\"). Names and URLs are resolved to the official company automatically; each company gets its own search with the other filters applied. At most 50 companies per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "payer": {
            "title": "Paid by (payer)",
            "type": "string",
            "description": "Filter by the entity that paid for the ad — the \"Paid for by\" name shown on each ad.",
            "default": ""
          },
          "accountOwner": {
            "title": "Account owner",
            "type": "string",
            "description": "Filter by the owner of the ad account that ran the ad.",
            "default": ""
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Only ads shown in these countries. Two-letter ISO codes like \"US\", \"FR\", \"DE\" — or \"ALL\" for worldwide. Leave empty for no country filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateOption": {
            "title": "Date shown",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year",
              "custom-date-range"
            ],
            "type": "string",
            "description": "Only ads that ran within this window.",
            "default": ""
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day of the custom range (YYYY-MM-DD). Only used when \"Date shown\" is set to Custom date range.",
            "default": ""
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day of the custom range (YYYY-MM-DD). Only used when \"Date shown\" is set to Custom date range.",
            "default": ""
          },
          "minImpressions": {
            "title": "Minimum impressions (thousands)",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads with at least this many impressions, in THOUSANDS — e.g. 50 means 50,000+ impressions. Leave empty for no minimum."
          },
          "maxImpressions": {
            "title": "Maximum impressions (thousands)",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads with at most this many impressions, in THOUSANDS — e.g. 100 means up to 100,000 impressions. Leave empty for no maximum."
          },
          "maxAds": {
            "title": "Maximum ads per search",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "How many ads to collect for each search combination (each company gets its own search). Does not limit the ad URLs list above.",
            "default": 50
          },
          "scrapeAdDetails": {
            "title": "Scrape full ad details",
            "type": "boolean",
            "description": "Open every search-result ad's detail page to add the deep fields: ad format, untruncated ad copy, who paid for the ad, and — for ads shown in the EU — exact run dates, total impressions, per-country impression share and full targeting parameters. One extra page fetch per ad, and each detailed ad additionally bills one \"full-ad-details\" event. Ads from the URL list above are always scraped in full.",
            "default": false
          },
          "proxyCountry": {
            "title": "IP country (advanced)",
            "type": "string",
            "description": "Two-letter country code for the request IP. Supported: us, gb, ca, au, de, fr, es, it, nl, ie, in, sg — any other code falls back to \"us\" (with a warning in the log). Leave as \"us\" unless you need the pages served from a specific country.",
            "default": "us"
          },
          "maxConcurrency": {
            "title": "Concurrency (advanced)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many ad pages to scrape in parallel.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}