{
  "openapi": "3.0.1",
  "info": {
    "title": "Ad Library Scraper: Google Ads Transparency & LinkedIn Ads",
    "description": "Get a company's ads from the Google Ads Transparency Center and LinkedIn Ad Library in one run: ad copy, creatives, first/last shown dates, impressions by country, targeting and payer. Competitor ad monitoring. $3 per 1,000 ads.",
    "version": "1.0",
    "x-build-id": "GKjW03GqhAz0E9wo4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gleanery_actors~ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gleanery_actors-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/gleanery_actors~ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-gleanery_actors-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/gleanery_actors~ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-gleanery_actors-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": {
          "advertisers": {
            "title": "Advertisers (company names or website domains)",
            "type": "array",
            "description": "Companies whose ads you want, as a name (\"HubSpot\") or website domain (\"hubspot.com\"). On Google, a name is matched to verified advertisers and a domain returns all ads pointing to that website. On LinkedIn, the name is searched in the Ad Library.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (LinkedIn only)",
            "type": "array",
            "description": "Find LinkedIn ads whose text mentions these words, from any advertiser, e.g. \"crm\", \"cybersecurity webinar\". Google doesn't offer keyword search.",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Ad libraries to search.",
            "items": {
              "type": "string",
              "enum": [
                "google",
                "linkedin"
              ],
              "enumTitles": [
                "Google Ads Transparency Center (Search, YouTube, Display...)",
                "LinkedIn Ad Library"
              ]
            },
            "default": [
              "google",
              "linkedin"
            ]
          },
          "countries": {
            "title": "Countries (ISO codes)",
            "type": "array",
            "description": "Only ads shown in these countries, as 2-letter codes, e.g. \"DE\", \"FR\", \"US\". Empty = anywhere. EU-served ads include the most detail (impressions by country and targeting) under the Digital Services Act.",
            "items": {
              "type": "string"
            }
          },
          "activeWithinDays": {
            "title": "Shown within the last (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only ads last shown within this many days. 0 = any time. Use 7 or 30 to see a competitor's current campaigns.",
            "default": 0
          },
          "exactAdvertiserMatch": {
            "title": "Only the advertiser itself (LinkedIn)",
            "type": "boolean",
            "description": "LinkedIn's advertiser search also returns partners and resellers whose name contains the company (e.g. \"Agency X 🧡 HubSpot\"). When on, only advertisers whose name starts with your input are kept.",
            "default": true
          },
          "includeDetails": {
            "title": "Include impressions, run dates and targeting",
            "type": "boolean",
            "description": "Fetch each ad's detail: first and last shown dates, impression ranges, impressions by country, targeting and payer (LinkedIn). Slower but much richer. Included in the price.",
            "default": true
          },
          "adTextMaxLength": {
            "title": "Max ad text length",
            "minimum": 0,
            "type": "integer",
            "description": "Cut ad text to this many characters. 0 = full text.",
            "default": 0
          },
          "omitEmptyFields": {
            "title": "Omit empty fields",
            "type": "boolean",
            "description": "Leave out null and empty fields for compact output (useful for AI agents).",
            "default": false
          },
          "maxAdsPerAdvertiser": {
            "title": "Max ads per advertiser and platform",
            "minimum": 1,
            "type": "integer",
            "description": "Newest ads first. Big advertisers can have thousands of ads.",
            "default": 100
          },
          "maxItems": {
            "title": "Max ads in total",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many ads. Caps your cost.",
            "default": 200
          },
          "onlyNewOrUpdated": {
            "title": "Only new or changed ads",
            "type": "boolean",
            "description": "For scheduled competitor monitoring: return (and charge for) only ads that are new, or whose impressions or last-shown date changed, since the previous run with the same input.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Optional name for the monitoring memory. Runs with the same key share it."
          },
          "proxyConfiguration": {
            "title": "Proxy (LinkedIn)",
            "type": "object",
            "description": "Used for LinkedIn only (Google needs no proxy). LinkedIn blocks datacenter IPs, so residential proxy is the default. Its cost is included in the price.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}