Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,20 @@ CONGRESS_API_KEY=your_congress_api_key_here
# Without a token requests are anonymous (rate-limited to ~30 req/min)
# Free account + token: https://www.courtlistener.com/sign-in/
COURTLISTENER_API_KEY=your_courtlistener_token_here

# Google Civic Information API — elections, polling locations, representatives, voter info
# Enable at: https://console.cloud.google.com/apis/library/civicinfo.googleapis.com
# Free tier: 25,000 requests/day
GOOGLE_CIVIC_API_KEY=your_google_civic_api_key_here

# Open States API — California state bills, legislators, voting records
# Sign up: https://openstates.org/accounts/signup/
# Get key: https://openstates.org/accounts/profile/ (API Keys section)
# Free tier: generous limits
OPEN_STATES_API_KEY=your_open_states_api_key_here

# California Secretary of State API — election results, contests, county vote breakdowns
# Sign up: https://calicodev.sos.ca.gov/
# Subscribe to "Election Results API" product, then copy Primary Key from Profile
# Free tier: unlimited
CA_SOS_API_KEY=your_ca_sos_subscription_key_here
1 change: 1 addition & 0 deletions apps/scraper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"consola": "^3.4.2",
"dotenv": "^17.3.1",
"p-limit": "^7.3.0",
"playwright": "^1.58.2",
"sharp": "^0.34.5",
"turndown": "^7.2.2",
"yargs": "^18.0.0",
Expand Down
4 changes: 3 additions & 1 deletion apps/scraper/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { hideBin } from "yargs/helpers";
import { congress } from "./scrapers/congress.js";
import { scotus } from "./scrapers/scotus.js";
import { federalregister } from "./scrapers/federalregister.js";
import { santaClaraROV } from "./scrapers/santa-clara-rov.js";
import { vote411 } from "./scrapers/vote411.js";
import type { Scraper } from "./utils/types.js";
import { createLogger } from "./utils/log.js";
import { setConcurrency } from "./utils/concurrency.js";
import { resetMetrics, printMetricsSummary } from "./utils/db/metrics.js";

const logger = createLogger("main");

const scrapers: Scraper[] = [federalregister, congress, scotus];
const scrapers: Scraper[] = [federalregister, congress, scotus, santaClaraROV, vote411];
const scraperNames = scrapers.map((s) => s.name);

const argv = await yargs(hideBin(process.argv))
Expand Down
Loading
Loading