{
  "openapi": "3.0.1",
  "info": {
    "title": "Early Vote & Mail Ballot Tracker — County Turnout & Results",
    "description": "County-level US election data in one sweep: daily early-vote & mail-ballot returns by county, party, method and day, voter-registration statistics with history, and county results history 2000-2024. Honest per-state coverage labels; built for forecasting and analysis agents.",
    "version": "0.0",
    "x-build-id": "zQ0aCgSeiGx4b9sRK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/shelvick~early-vote-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-shelvick-early-vote-tracker",
        "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/shelvick~early-vote-tracker/runs": {
      "post": {
        "operationId": "runs-sync-shelvick-early-vote-tracker",
        "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/shelvick~early-vote-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-shelvick-early-vote-tracker",
        "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": {
          "datasets": {
            "title": "Datasets",
            "type": "array",
            "description": "Which county-level election datasets to sweep. Any combination of: early_vote (daily early-vote & mail-ballot returns by county × party × method × day), registration (voter-registration stats by county × party, current + history), results (county results history — president 2000-2024 + Senate 2022), ballot_progress (post-election count and outstanding-ballot progress). Empty = all four. Coverage and source availability differ by dataset and change as sources come online, so the authoritative list is the run's COVERAGE record rather than any state list written here. Billed per county row; results rows bill lower, volume rate on large sweeps (see the Pricing tab).",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter US state postal codes to scope the sweep, e.g. [\"NC\",\"FL\",\"PA\"]. Empty = every state currently covered for each requested dataset. Coverage differs per dataset and changes as states come online and as election seasons open, so the authoritative list is the run's COVERAGE record rather than any list written here: early_vote spans the states publishing daily county files, registration the states publishing party-registration snapshots, and results all 50 states plus DC. A requested state that is not covered returns a labeled coverage row (not_covered / gateway_deferred / in_season_pending) explaining which case it is — never a silent empty, and never charged.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start date (ISO YYYY-MM-DD, inclusive) bounding early_vote returns (by snapshot date) and registration statistics (by 'as of' date). Setting a date window disables the default electionId=\"latest\" filter, so historical elections inside the window are included. Ignored for results (use resultsYears). Empty = no lower bound. Example: \"2026-09-01\"."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End date (ISO YYYY-MM-DD, inclusive) bounding early_vote returns and registration statistics. Setting a date window disables the default electionId=\"latest\" filter. Ignored for results. Empty = no upper bound. Example: \"2026-11-03\"."
          },
          "counties": {
            "title": "Counties (FIPS)",
            "type": "array",
            "description": "Filter to specific counties by 5-digit FIPS code, e.g. [\"37183\"] (Wake County, NC). Empty = all counties in the requested states. FIPS is the county key across every dataset; a single-county filter turns the sweep into a targeted lookup over the same index.",
            "items": {
              "type": "string"
            }
          },
          "resultsYears": {
            "title": "Results years",
            "type": "array",
            "description": "Filter the results dataset to specific election years, e.g. [\"2020\",\"2024\"]. Applies only to results (county president 2000, 2004, 2008, 2012, 2016, 2020, 2024; Senate 2022). Empty = all available years. Ignored for early_vote / registration.",
            "items": {
              "type": "string"
            }
          },
          "electionId": {
            "title": "Election ID (early_vote)",
            "type": "string",
            "description": "Pin the early_vote / ballot_progress sweep to one election, keyed by election-day date (ISO YYYY-MM-DD, e.g. \"2026-11-03\"), or the sentinel \"latest\" for each state's most recent election. DEFAULT when electionId, dateFrom, and dateTo are all empty: \"latest\" — a plain state query serves the current race, never an old archived election. Set an explicit electionId or a date window for historical elections. Ignored for registration / results."
          },
          "districts": {
            "title": "Districts (early_vote)",
            "type": "array",
            "description": "Scope the early_vote sweep to specific districts, e.g. [\"NC-09\"] or [\"PA-SH-101\",\"PA-SS-05\"]. Formats: congressional \"NC-09\" (\"NC-9\" and at-large \"NC-AL\" are accepted and normalized); state house \"PA-SH-101\"; state senate \"PA-SS-05\". What the number means depends on the state, and the run's COVERAGE record says which you got. Where the state publishes district information at source, rows are true district totals with no county FIPS. Where it publishes county totals only, a congressional district resolves to the counties it covers and you receive those counties' WHOLE counts — a county sweep scoped by district, not a district total, flagged in each row's field_notes; state house and senate districts are not available there. Some states redrew congressional maps for 2026; where the new map's county composition cannot be verified, the district is refused by name rather than answered from the old map. Any district we cannot answer returns a labeled row explaining why and is never charged. Applies only to early_vote; ignored for registration, results and ballot_progress. Empty = no district filter, and results are identical to previous runs.",
            "items": {
              "type": "string"
            }
          },
          "maxRows": {
            "title": "Max county rows",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "Safety cap on the total number of county data rows returned AND billed in one run — protects a broad national sweep from an unbounded charge. When the cap truncates a time series, the NEWEST rows are kept (the current snapshot survives, history is dropped). Coverage rows (not_covered, etc.) are free and do not count against this. Default 200000 (a full national results-history sweep is ~110k rows); the per-run maximum charge (maxTotalChargeUsd) is the hard budget stop.",
            "default": 200000
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}