{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Ads Transparency Center Scraper: Ad Library",
    "description": "Returns ads from Google Ads Transparency Center (Google's ad library) by brand, domain or advertiser ID: ad copy (OCR), format, media, regions, first/last shown. No login. Example: searchQueries=[\"Shopify\"]. Pay per event: $0.002 per ad, $0.003 per ad copy, $0.003 per advertiser.",
    "version": "0.1",
    "x-build-id": "vKJZzXgomuaziE3Ki"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kyungminlee~ads-transparency-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kyungminlee-ads-transparency-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/kyungminlee~ads-transparency-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kyungminlee-ads-transparency-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/kyungminlee~ads-transparency-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kyungminlee-ads-transparency-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": {
          "searchQueries": {
            "title": "Advertiser names or domains to search",
            "type": "array",
            "description": "List of free-text advertiser searches as on adstransparency.google.com, e.g. [\"Shopify\", \"nike.com\"]. The best matches are scraped (count set by maxAdvertisersPerQuery). Provide at least one of searchQueries, advertiserIds, advertiserUrls or domains.",
            "items": {
              "type": "string"
            }
          },
          "advertiserIds": {
            "title": "Advertiser IDs",
            "type": "array",
            "description": "Optional list of Google advertiser IDs starting with 'AR' followed by 20 digits, e.g. [\"AR01614014350098432001\"] (from /advertiser/AR... URLs). Scraped in addition to searchQueries.",
            "items": {
              "type": "string"
            }
          },
          "advertiserUrls": {
            "title": "Advertiser or creative URLs",
            "type": "array",
            "description": "Optional list of full adstransparency.google.com URLs, e.g. [\"https://adstransparency.google.com/advertiser/AR01614014350098432001?region=US\"]. Advertiser or creative URLs; scraped in addition to the other inputs.",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Domains (all advertisers)",
            "type": "array",
            "description": "Optional list of website domains, e.g. [\"nike.com\"]. Returns ads from ANY advertiser linking to that domain (Google's search-by-website view), up to maxAdsPerAdvertiser per domain. Different from searchQueries, which finds advertisers by name.",
            "items": {
              "type": "string"
            }
          },
          "maxAdvertisersPerQuery": {
            "title": "Max advertisers per query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Integer 1-20 (default 1): how many best-matching advertisers to scrape for each searchQueries item. Does not affect advertiserIds, advertiserUrls or domains.",
            "default": 1
          },
          "maxAdsPerAdvertiser": {
            "title": "Max ads per advertiser",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Integer 1-100000 (default 100): max ads per advertiser (and per domain), newest first, fetched 40 per page. Each ad saved is a charged 'ad' event ($0.002); ad copy adds a second event. With onlyNewAds it limits how many newest ads are checked.",
            "default": 100
          },
          "format": {
            "title": "Ad format",
            "enum": [
              "ALL",
              "TEXT",
              "IMAGE",
              "VIDEO"
            ],
            "type": "string",
            "description": "Enum ALL, TEXT, IMAGE or VIDEO (default ALL): only return ads of this format.",
            "default": "ALL"
          },
          "regions": {
            "title": "Regions (country codes)",
            "type": "array",
            "description": "Optional list of ISO 3166-1 alpha-2 country codes, e.g. [\"US\", \"GB\", \"KR\"]: only ads shown in these countries. Empty list = all regions.",
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Shown after",
            "type": "string",
            "description": "Optional date string YYYY-MM-DD, e.g. \"2026-01-01\": only ads shown on or after this date. null = no limit."
          },
          "endDate": {
            "title": "Shown before",
            "type": "string",
            "description": "Optional date string YYYY-MM-DD, e.g. \"2026-06-30\": only ads shown on or before this date. null = no limit."
          },
          "topic": {
            "title": "Topic",
            "enum": [
              "ALL",
              "POLITICAL"
            ],
            "type": "string",
            "description": "Enum ALL or POLITICAL (default ALL). POLITICAL restricts to election/political ads where Google provides that view.",
            "default": "ALL"
          },
          "includeAdText": {
            "title": "Extract ad copy (text, links, images)",
            "type": "boolean",
            "description": "true (default) = also extract ad copy (headline, body, links, images; YouTube ID and thumbnail for videos). Text ads exist only as screenshots, so copy comes from OCR when ocrAdText is true. Adds 1-2 requests per ad and a separate 'ad-text' event ($0.003) charged only for ads where something was extracted. false = cheaper, metadata only.",
            "default": true
          },
          "ocrAdText": {
            "title": "OCR screenshot ads",
            "type": "boolean",
            "description": "true (default) = read the text of screenshot-only ads (most Search text ads) with Tesseract OCR, about 1 s per ad. Only used when includeAdText is true. false skips OCR; those ads then have no copy and no ad-text charge.",
            "default": true
          },
          "includeAdvertiserInfo": {
            "title": "Include advertiser profile items",
            "type": "boolean",
            "description": "true (default) = also output one item per advertiser with type \"advertiser\" (name, ID, legal name, region, approximate ad count). Charged as one 'advertiser' event ($0.003) each. Set false to return only ad rows.",
            "default": true
          },
          "onlyNewAds": {
            "title": "Only new ads (monitor mode)",
            "type": "boolean",
            "description": "Monitor mode (default false). true = remember seen ad IDs per advertiser/domain in historyStoreName and output and charge only ads not seen before; first run returns everything. Also adds a free 'advertiser-summary' row per advertiser. Schedule weekly with the same input.",
            "default": false
          },
          "historyStoreName": {
            "title": "History store name",
            "type": "string",
            "description": "Name of the key-value store holding seen ad IDs for onlyNewAds, e.g. 'google-ads-monitor' (default). Use one name per monitoring project and the same name on every scheduled run. Ignored when onlyNewAds is false.",
            "default": "google-ads-monitor"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings object, default {\"useApifyProxy\": true} (rotating datacenter IPs). Google shows a CAPTCHA after ~20 requests from one IP, so keep it enabled except for tiny runs.",
            "default": {
              "useApifyProxy": true
            }
          },
          "adTextConcurrency": {
            "title": "Ad text concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Integer 1-8 (default 4): how many ads fetch their preview/screenshot in parallel. Only speeds up CDN downloads; Google API calls stay sequential. Use 1 if many 'blocked' warnings appear.",
            "default": 4
          },
          "debug": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Boolean (default false). true logs raw responses for troubleshooting; leave false.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}