{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Political Ads Spend & Transparency Exporter",
    "description": "Export Google's official political ad transparency bundle: advertiser lifetime spend, weekly spend, advertiser-by-state spend, state and district totals, creative spend ranges with targeting, and California/New Zealand declared advertiser filings. Public data, no login.",
    "version": "1.0",
    "x-build-id": "fMfcTAkzo1mfuIQok"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlyth-forge~google-political-ads-spend/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlyth-forge-google-political-ads-spend",
        "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/crawlyth-forge~google-political-ads-spend/runs": {
      "post": {
        "operationId": "runs-sync-crawlyth-forge-google-political-ads-spend",
        "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/crawlyth-forge~google-political-ads-spend/run-sync": {
      "post": {
        "operationId": "run-sync-crawlyth-forge-google-political-ads-spend",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "advertisers",
              "weeklySpend",
              "advertiserRegionSpend",
              "regionSpend",
              "creatives",
              "declaredAdvertisers"
            ],
            "type": "string",
            "description": "Official table to export. Advertisers returns lifetime totals with trends; Weekly spend returns one row per advertiser per week; Advertiser region spend returns advertiser by state; Region spend returns country, state and district totals; Creatives returns ad-level spend ranges and targeting; Declared advertisers returns California and New Zealand filings.",
            "default": "advertisers"
          },
          "country": {
            "title": "Country",
            "enum": [
              "any",
              "US",
              "BR",
              "IN",
              "AR",
              "AU",
              "CL",
              "IL",
              "GB",
              "MX",
              "TW",
              "NZ",
              "ZA"
            ],
            "type": "string",
            "description": "Only rows for this country. Leave on Any country for global coverage. Google publishes election-ad data for these 12 regions.",
            "default": "any"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start date (YYYY-MM-DD). Weekly spend uses the week start date; creatives match any ad active in the window; advertiser totals require weekly spend activity in the window. Leave empty for all dates."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End date (YYYY-MM-DD), inclusive. Leave empty for all dates."
          },
          "advertiserNameContains": {
            "title": "Advertiser name contains",
            "type": "string",
            "description": "Case-insensitive substring match on the advertiser name, for example Senate, PAC or a candidate name. Not used by Region spend mode, which has no advertiser column."
          },
          "advertiserIds": {
            "title": "Advertiser IDs",
            "type": "array",
            "description": "Google advertiser IDs (AR...) or pasted Ads Transparency Center advertiser URLs. Empty means all advertisers. Not used by Region spend mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "creativeIds": {
            "title": "Creative IDs (creatives mode)",
            "type": "array",
            "description": "Google creative IDs (CR...) or pasted Ads Transparency Center creative URLs. Only used by Creatives mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "currency": {
            "title": "Spend currency",
            "enum": [
              "USD",
              "EUR",
              "INR",
              "BGN",
              "CZK",
              "DKK",
              "HUF",
              "PLN",
              "RON",
              "SEK",
              "GBP",
              "NZD",
              "ILS",
              "AUD",
              "TWD",
              "BRL",
              "ARS",
              "ZAR",
              "CLP",
              "MXN"
            ],
            "type": "string",
            "description": "Currency used for minSpend, maxSpend, spendLocal and spend sorting. Google publishes spend in the advertiser's local reporting currency and never converts it.",
            "default": "USD"
          },
          "minSpend": {
            "title": "Minimum spend",
            "minimum": 0,
            "maximum": 1000000000000,
            "type": "number",
            "description": "Only rows with at least this amount in the selected currency. Creatives match when the top of Google's spend range reaches it; aggregates use the exact published total."
          },
          "maxSpend": {
            "title": "Maximum spend",
            "minimum": 0,
            "maximum": 1000000000000,
            "type": "number",
            "description": "Only rows with at most this amount in the selected currency. Creatives match when the bottom of Google's spend range is at or below it."
          },
          "adType": {
            "title": "Ad type (creatives mode)",
            "enum": [
              "any",
              "TEXT",
              "IMAGE",
              "VIDEO"
            ],
            "type": "string",
            "description": "Filter creatives by format. Only used by Creatives mode.",
            "default": "any"
          },
          "fundedByGoogleAdGrants": {
            "title": "Google Ad Grants (creatives mode)",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Keep only creatives funded or not funded by a Google Ad Grants in-kind donation. Only used by Creatives mode.",
            "default": "any"
          },
          "trendWindowWeeks": {
            "title": "Trend window (weeks)",
            "minimum": 1,
            "maximum": 52,
            "type": "integer",
            "description": "Advertiser totals compare the last N weeks of spend with the N weeks before. Only used by Advertiser totals mode.",
            "default": 4
          },
          "surgeOnly": {
            "title": "Only surging advertisers",
            "type": "boolean",
            "description": "Keep only advertisers whose recent spend doubled versus the prior window or who just started spending. Only used by Advertiser totals mode.",
            "default": false
          },
          "includeWeeklyHistory": {
            "title": "Include weekly history",
            "type": "boolean",
            "description": "Attach up to 52 most recent weekly spend rows per advertiser, in the selected currency. Only used by Advertiser totals mode.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "spendDesc",
              "spendAsc",
              "dateNewest",
              "dateOldest",
              "nameAsc"
            ],
            "type": "string",
            "description": "Order of the returned rows. Spend sorts use spendLocal for aggregates and the top of Google's spend range for creatives. Date sorts fall back to name in modes without dates.",
            "default": "spendDesc"
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Stop after this many matching records. Lower values keep runs fast and cheap.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}