{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Ads Transparency Scraper API: Ad Library",
    "description": "Google Ads Transparency scraper API: the Search, Display and YouTube ads of any domain, advertiser name or ID from the Google Ads Transparency Center, Google's public ad library. Format, countries, first and last shown dates, image or preview link. Competitor ads by country. $1.20 per 1,000 ads.",
    "version": "1.0",
    "x-build-id": "rxm9hmwih6MIqePmO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/egra_van~google-ads-transparency/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-egra_van-google-ads-transparency",
        "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/egra_van~google-ads-transparency/runs": {
      "post": {
        "operationId": "runs-sync-egra_van-google-ads-transparency",
        "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/egra_van~google-ads-transparency/run-sync": {
      "post": {
        "operationId": "run-sync-egra_van-google-ads-transparency",
        "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": [
          "searchTerms"
        ],
        "properties": {
          "searchTerms": {
            "title": "Domains, advertiser names or IDs",
            "type": "array",
            "description": "One per line. A website domain (\"nike.com\": every advertiser that sends traffic to it), an advertiser name (\"Nike, Inc.\": the advertiser with this exact name and the most ads is picked; the log lists similar names), an advertiser ID (\"AR16735076323512287233\") or a Transparency Center advertiser link. Domains and IDs are the most precise.",
            "items": {
              "type": "string"
            }
          },
          "region": {
            "title": "Region (country where the ad was shown)",
            "type": "string",
            "description": "2-letter country code such as US, GB, DE, FR, IN, or \"anywhere\" for all countries.",
            "default": "anywhere"
          },
          "period": {
            "title": "Period (when the ad was shown)",
            "enum": [
              "anytime",
              "last7days",
              "last30days",
              "last90days",
              "custom"
            ],
            "type": "string",
            "description": "Only ads shown in this period. Google keeps the day-by-day data for about the last 12 months; for older periods it returns no ads.",
            "default": "anytime"
          },
          "startDate": {
            "title": "Start date (custom period)",
            "type": "string",
            "description": "First day, as YYYY-MM-DD. Used only when Period is \"Custom dates\"."
          },
          "endDate": {
            "title": "End date (custom period)",
            "type": "string",
            "description": "Last day, as YYYY-MM-DD. Empty = today. Used only when Period is \"Custom dates\"."
          },
          "format": {
            "title": "Ad format",
            "enum": [
              "all",
              "text",
              "image",
              "video"
            ],
            "type": "string",
            "description": "Text ads (Google Search), image ads (Display, Shopping) or video ads (YouTube).",
            "default": "all"
          },
          "maxAdsPerQuery": {
            "title": "Max ads per domain / advertiser",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many ads for each line above. Big brands have thousands of ads; you pay per ad stored.",
            "default": 50
          },
          "includeDetails": {
            "title": "Add countries and all variants",
            "type": "boolean",
            "description": "For each ad, also read its detail page: every country where it was shown and all its versions (images or previews). One extra request per ad, so runs take about twice as long. Same price.",
            "default": true
          },
          "requestDelaySecs": {
            "title": "Pause between requests (seconds)",
            "minimum": 1,
            "maximum": 30,
            "type": "number",
            "description": "The Actor sends one request at a time and waits this long between them, to stay within Google's limits. Minimum 1.",
            "default": 2
          },
          "maxBlockWaitSecs": {
            "title": "Max wait when Google asks to slow down (seconds)",
            "minimum": 0,
            "maximum": 900,
            "type": "integer",
            "description": "If Google answers with its rate-limit page, the Actor waits (30 s, then 60 s, 120 s...) and retries on the same IP. It never solves captchas and never switches IP to get around a block. After this much waiting the run stops and keeps the ads already read.",
            "default": 180
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Default: the Apify proxy (datacenter), one IP for the whole run. The Apify RESIDENTIAL and GOOGLE_SERP groups are not available in this Actor; for other IPs add your own proxy URLs.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}