{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Ads Library Scraper - Ad Creatives & Advertisers",
    "description": "Scrape LinkedIn's Ad Library for company ads — get ad type, body text, headlines, images, advertiser logo, and ad detail deeplinks. B2B competitor ad spy.",
    "version": "0.1",
    "x-build-id": "VDNzoOYLfksJlxUUN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s-r~linkedin-ads-library/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s-r-linkedin-ads-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/s-r~linkedin-ads-library/runs": {
      "post": {
        "operationId": "runs-sync-s-r-linkedin-ads-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/s-r~linkedin-ads-library/run-sync": {
      "post": {
        "operationId": "run-sync-s-r-linkedin-ads-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",
        "required": [
          "search"
        ],
        "properties": {
          "search": {
            "title": "Company / advertiser",
            "type": "string",
            "description": "Company or advertiser name to search (e.g. \"hubspot\", \"salesforce\"). Required."
          },
          "max_ads": {
            "title": "Max ads",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many ads to collect. LinkedIn serves 24 per page, so higher values walk more pages and take longer. Large advertisers have thousands of ads.",
            "default": 96
          },
          "payer": {
            "title": "Payer name",
            "type": "string",
            "description": "Filter by the party that paid for the ads, which is often a media agency rather than the brand."
          },
          "keyword": {
            "title": "Keyword in ad copy",
            "type": "string",
            "description": "Only return ads whose text contains this word or phrase."
          },
          "country": {
            "title": "Country",
            "pattern": "^([a-zA-Z]{2})?$",
            "type": "string",
            "description": "ISO 2-letter country code (e.g. NL, US, DE). Leave blank for all countries."
          },
          "date_range": {
            "title": "Date range",
            "enum": [
              "",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Limit results by recency. LinkedIn publishes no running-versus-stopped filter, so this window is the only way to separate current advertising from an advertiser's back catalogue.",
            "default": ""
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "NEWEST",
              "OLDEST"
            ],
            "type": "string",
            "description": "Order results by recency.",
            "default": "NEWEST"
          },
          "only_total": {
            "title": "Count only",
            "type": "boolean",
            "description": "Return one row with how many ads match and no ads at all. Costs one page fetch and no per-ad charge. LinkedIn serves 24 ads per page, so counting a large advertiser by paging costs hundreds of requests for one number.",
            "default": false
          },
          "impressions_min": {
            "title": "Minimum impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Only return ads above this impression count. Combined with the unit below, so 10 + thousand means 10,000 impressions."
          },
          "impressions_min_unit": {
            "title": "Minimum impressions unit",
            "enum": [
              "thousand",
              "million"
            ],
            "type": "string",
            "description": "Unit for the minimum impressions value.",
            "default": "thousand"
          },
          "impressions_max": {
            "title": "Maximum impressions",
            "minimum": 0,
            "type": "integer",
            "description": "Only return ads below this impression count."
          },
          "impressions_max_unit": {
            "title": "Maximum impressions unit",
            "enum": [
              "thousand",
              "million"
            ],
            "type": "string",
            "description": "Unit for the maximum impressions value.",
            "default": "thousand"
          },
          "targeting_included": {
            "title": "Targeting used",
            "type": "array",
            "description": "Only return ads that targeted on these parameters. Useful for finding who runs tightly targeted campaigns.",
            "items": {
              "type": "string",
              "enum": [
                "LANGUAGE",
                "LOCATION",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "COMPANY",
                "EDUCATION",
                "JOB_EXPERIENCE",
                "INTEREST"
              ]
            },
            "default": []
          },
          "targeting_excluded": {
            "title": "Targeting not used",
            "type": "array",
            "description": "Only return ads that did NOT target on these parameters.",
            "items": {
              "type": "string",
              "enum": [
                "LANGUAGE",
                "LOCATION",
                "AUDIENCE",
                "DEMOGRAPHIC",
                "COMPANY",
                "EDUCATION",
                "JOB_EXPERIENCE",
                "INTEREST"
              ]
            },
            "default": []
          },
          "proxy_url": {
            "title": "Your own proxy (optional)",
            "type": "string",
            "description": "A residential proxy URL, scheme plus credentials plus host and port. LinkedIn refuses datacenter ranges, so supply your own exit if runs come back empty. Leave blank to use the Actor's own routing."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}