{
  "openapi": "3.0.1",
  "info": {
    "title": "Google & YouTube Ads Scraper and Media Archive — Beta",
    "description": "Enter an advertiser website or ID to get Google and YouTube ads, stored media and observed changes. 10-day beta: no Actor fee; Apify usage applies.",
    "version": "0.1",
    "x-build-id": "2wiCMvqZEZc99yM2O"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magenta_courser~google-youtube-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magenta_courser-google-youtube-ads-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/magenta_courser~google-youtube-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-magenta_courser-google-youtube-ads-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/magenta_courser~google-youtube-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-magenta_courser-google-youtube-ads-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": {
          "query": {
            "title": "Advertiser website or name",
            "type": "string",
            "description": "Provide exactly one of query, advertiserId or adUrl. Searches advertiser names or websites, not all words inside ad copy. Website URLs are normalized to their hostname."
          },
          "advertiserId": {
            "title": "Google advertiser ID",
            "pattern": "^AR[0-9]{1,30}$",
            "type": "string",
            "description": "An AR-prefixed advertiser ID from Google Ads Transparency Center. Use this instead of query or adUrl."
          },
          "adUrl": {
            "title": "Single ad URL",
            "type": "string",
            "description": "A full HTTPS URL such as https://adstransparency.google.com/advertiser/AR.../creative/CR.... Use this instead of query or advertiserId. For this single-ad lookup, set country to ALL, platform to all, and leave dateFrom/dateTo empty; other values are rejected. URL query parameters are not imported as filters. adFormat may still filter the returned creative."
          },
          "country": {
            "title": "Country where ads were shown",
            "type": "string",
            "description": "Two-letter country code such as US, KR, GB or DE, or ALL. This is a serving-country filter, not the advertiser's registered country.",
            "default": "ALL"
          },
          "platform": {
            "title": "Google platform",
            "enum": [
              "all",
              "google_search",
              "youtube",
              "google_play",
              "google_maps",
              "google_shopping"
            ],
            "type": "string",
            "description": "YouTube and other Google ads come from the same Ads Transparency Center source. Google excludes ads shown before September 4, 2023 when a platform filter is selected.",
            "default": "all"
          },
          "adFormat": {
            "title": "Creative format",
            "enum": [
              "all",
              "text",
              "image",
              "video"
            ],
            "type": "string",
            "description": "Google's ad creative format. Video format alone does not prove that an ad ran on YouTube; use the YouTube platform filter when needed.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Shown on or after",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Optional YYYY-MM-DD lower bound for when ads were shown. This is not an ad creation date or a current-active filter."
          },
          "dateTo": {
            "title": "Shown on or before",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Optional YYYY-MM-DD upper bound for when ads were shown. Must not be earlier than dateFrom."
          },
          "maxAds": {
            "title": "Maximum ads",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum unique ad results per run. A bounded result set does not prove that every matching ad was collected.",
            "default": 30
          },
          "maxAdvertisers": {
            "title": "Maximum matching advertisers",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum matching advertiser accounts to follow for an advertiser-name search. A bounded selection may omit other businesses with the same or a similar name.",
            "default": 5
          },
          "maxCreativeVariants": {
            "title": "Maximum creative variants per ad",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Limit decoded creative variations per ad. Compare creative_variant_count, creative_variants_processed and creative_variants_complete to see whether variants were left out. More variants can add media and requests.",
            "default": 3
          },
          "includeDetails": {
            "title": "Include creative details",
            "type": "boolean",
            "description": "Fetch available creative details and variations. Fields absent from Google's response remain null. Additional requests count toward the run limits.",
            "default": true
          },
          "archiveMedia": {
            "title": "Store creative media",
            "type": "boolean",
            "description": "Download available image and direct video files into an Actor-specific named storage. Record URLs remain valid while the records and account are retained. Storage and later access can incur ongoing usage costs. A YouTube watch link is not a stored video file.",
            "default": true
          },
          "includeYouTubeDetails": {
            "title": "Include available YouTube channel details",
            "type": "boolean",
            "description": "When a creative contains a YouTube video ID, read its public watch page for the actual channel and displayed subscriber count. Counts can be rounded, unavailable or blocked; missing values stay null. This does not map every advertiser to a channel.",
            "default": true
          },
          "trackChanges": {
            "title": "Compare with previous runs",
            "type": "boolean",
            "description": "Remember previously observed ad IDs for the same filters and namespace. First observation is a baseline. Missing ads and old last-shown dates never establish that an ad has turned off.",
            "default": true
          },
          "historyNamespace": {
            "title": "History namespace",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "type": "string",
            "description": "Use a different name for independent monitoring histories. Keep the same filters and namespace to compare repeated runs.",
            "default": "default"
          },
          "maxFileSizeMb": {
            "title": "Maximum media file MiB",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum bytes accepted for one media file, in MiB. Oversized or unsupported files are reported in the media manifest.",
            "default": 20
          },
          "maxTotalMediaMb": {
            "title": "Maximum downloaded media MiB",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Shared media download budget across all results. Failed transfers can consume the budget; skipped assets remain visible.",
            "default": 100
          },
          "maxRequests": {
            "title": "Maximum HTTP requests",
            "minimum": 2,
            "maximum": 3000,
            "type": "integer",
            "description": "Shared cap covering source searches, details, creative decoding, YouTube details and media downloads. This is a request limit, not a guaranteed dollar spending limit.",
            "default": 200
          },
          "maxRunSeconds": {
            "title": "Source request time budget",
            "minimum": 30,
            "maximum": 480,
            "type": "integer",
            "description": "Stop starting source requests after this many seconds. Set the Actor timeout at least 60 seconds higher to allow output and history to finish.",
            "default": 240
          },
          "pageSize": {
            "title": "Requested ads per page",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Requested source page size. This affects pagination and does not create a separate monitoring history.",
            "default": 20
          },
          "requestDelayMs": {
            "title": "Minimum request interval (ms)",
            "minimum": 1000,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum spacing between HTTP requests. Keep a small result limit while validating a new advertiser or filter.",
            "default": 1500
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "US Apify residential proxy by default. The selected proxy must be available to your account. Proxy traffic incurs usage costs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "includeOcr": {
            "title": "Read screenshot-only text ads with OCR",
            "type": "boolean",
            "description": "When a text-format ad has no structured copy, read one preview image with local OCR. Returns separately labelled creative_text; does not invent title, body or destination fields. Uses additional compute, at most 15 seconds per image.",
            "default": true
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "eng",
              "kor+eng"
            ],
            "type": "string",
            "description": "Language models for screenshot-only text ads. OCR can misread text; inspect the source image and ocr_status. Other languages are not supported by this OCR configuration.",
            "default": "eng"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}