{"_id":"@capitoltrace/govwatch","_rev":"3-ea2a308b476fa2d741abc0abde9eaf51","name":"@capitoltrace/govwatch","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@capitoltrace/govwatch","version":"0.1.0","keywords":["government","api","health-check","monitoring","civic-tech","congress","fec","cisa","uptime"],"author":{"url":"https://capitoltrace.com","name":"Capitol Trace"},"license":"MIT","_id":"@capitoltrace/govwatch@0.1.0","maintainers":[{"name":"shane278","email":"admin@capitoltrace.com"}],"homepage":"https://github.com/CapitolTrace/govwatch#readme","bugs":{"url":"https://github.com/CapitolTrace/govwatch/issues"},"bin":{"govwatch":"dist/cli.js"},"dist":{"shasum":"d582bad9dc161259b4ea9e88328a4ee15b56d83d","tarball":"https://registry.npmjs.org/@capitoltrace/govwatch/-/govwatch-0.1.0.tgz","fileCount":21,"integrity":"sha512-3lT6o6eMlqurA7pWYfUnxV4mQgwDBHZyaFtsEnytE69RGHrSISW2IiBflCWvVdi9yaonM5ncPL8JXho1EdVrTQ==","signatures":[{"sig":"MEQCIHkO/TTkuegKwYmcCc+7y1ltmr3QFsL5lCIorStbrvFcAiAeAPJsvuCnsBKEe5X1XDgjTgG+rWhH5THw4/nCOXdrDg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44778},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.17"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepare":"npm run build","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"shane278","email":"admin@capitoltrace.com"},"repository":{"url":"git+https://github.com/CapitolTrace/govwatch.git","type":"git"},"_npmVersion":"11.9.0","description":"Health checks for government APIs — Congress.gov, FEC, CISA KEV, NVD, GDELT, and more. CLI + TypeScript library.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.5.0","@types/node":"^20.14.0"},"_npmOperationalInternal":{"tmp":"tmp/govwatch_0.1.0_1784419674019_0.07863816479207619","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capitoltrace/govwatch","version":"0.1.1","keywords":["government","api","health-check","monitoring","civic-tech","congress","fec","cisa","uptime"],"author":{"url":"https://capitoltrace.com","name":"Capitol Trace"},"license":"MIT","_id":"@capitoltrace/govwatch@0.1.1","maintainers":[{"name":"shane278","email":"admin@capitoltrace.com"}],"homepage":"https://github.com/CapitolTrace/govwatch#readme","bugs":{"url":"https://github.com/CapitolTrace/govwatch/issues"},"bin":{"govwatch":"dist/cli.js"},"dist":{"shasum":"0409725623f3daf666c0279e14309c5c3d2a0b23","tarball":"https://registry.npmjs.org/@capitoltrace/govwatch/-/govwatch-0.1.1.tgz","fileCount":21,"integrity":"sha512-/R4ZdyYwEffZS71x9kcRPrf7YJ8lBL5n9OXA0N89sQcn2CbH4feNzHwyOiMOMt4j5CuZjJPrNlDC6jAnmPXhhA==","signatures":[{"sig":"MEQCIDEz+ZPJPUheelW9j7ZoreJ0TsD8D7TDcK9c7vOSXqgxAiBwJKxLVLziO61dchyITDMdvMSSfkzEgSN+r7q09uPjJg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capitoltrace%2fgovwatch@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46418},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.17"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"bba06ee17a48c85b7c83b25befe513edabd2878a","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepare":"npm run build","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:243532e3-51cf-4781-8863-a2a752f5d551"}},"repository":{"url":"git+https://github.com/CapitolTrace/govwatch.git","type":"git"},"_npmVersion":"12.0.2","description":"Health checks for government APIs — Congress.gov, FEC, CISA KEV, NVD, GDELT, and more. CLI + TypeScript library.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.7","typescript":"^5.5.0","@types/node":"^20.14.0"},"_npmOperationalInternal":{"tmp":"tmp/govwatch_0.1.1_1786444423780_0.6296382990065386","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"_id":"@capitoltrace/govwatch@0.1.2","bin":{"govwatch":"dist/cli.js"},"bugs":{"url":"https://github.com/CapitolTrace/govwatch/issues"},"dist":{"shasum":"826458b1a93eea7420aadce845baf3f502aaaa63","tarball":"https://registry.npmjs.org/@capitoltrace/govwatch/-/govwatch-0.1.2.tgz","fileCount":21,"integrity":"sha512-pRd1j9BhwYIAjB6Ysl6Vm/LxhkfX2Z+c+0Wdbfs41+rzCwLS/VjI0/4G9QzkSdtZ28Li4GKais9TVjl5yP6ADQ==","signatures":[{"sig":"MEUCIQDdLRy7tl413TE/cacFHy3PpTAqfPOVxtdsSOmqSud7NQIgHPhpCNkCDFC9wG55+qTFsJsQZVfKM8p7A9POWfmq83M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAKnGGx8FxFePXrFCKkuXHq2LIlEJOCz0Dk7ZNfLKBfHAiAefIkbUbepSrNDXLEX5n/TDQgRfgHLZpf/BlYFY7WDcQ=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capitoltrace%2fgovwatch@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50747},"main":"./dist/index.js","name":"@capitoltrace/govwatch","type":"module","types":"./dist/index.d.ts","author":{"url":"https://capitoltrace.com","name":"Capitol Trace"},"engines":{"node":">=18.17"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a9cadd6513949f5791f8c9bf142a3a83328b9a29","license":"MIT","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepare":"npm run build","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"version":"0.1.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:243532e3-51cf-4781-8863-a2a752f5d551"}},"homepage":"https://github.com/CapitolTrace/govwatch#readme","keywords":["government","api","health-check","monitoring","civic-tech","congress","fec","cisa","uptime"],"repository":{"url":"git+https://github.com/CapitolTrace/govwatch.git","type":"git"},"_npmVersion":"12.0.2","description":"Health checks for government APIs — Congress.gov, FEC, CISA KEV, NVD, GDELT, and more. CLI + TypeScript library.","directories":{},"maintainers":[{"name":"shane278","email":"admin@capitoltrace.com"}],"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.7","typescript":"^5.5.0","@types/node":"^20.14.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/govwatch_0.1.2_1787445933023_0.3514099388067129"}}},"time":{"created":"2026-07-19T00:07:53.818Z","modified":"2026-08-23T00:45:33.560Z","0.1.0":"2026-07-19T00:07:54.143Z","0.1.1":"2026-08-11T10:33:43.934Z","0.1.2":"2026-08-23T00:45:33.106Z"},"bugs":{"url":"https://github.com/CapitolTrace/govwatch/issues"},"author":{"url":"https://capitoltrace.com","name":"Capitol Trace"},"license":"MIT","homepage":"https://github.com/CapitolTrace/govwatch#readme","keywords":["government","api","health-check","monitoring","civic-tech","congress","fec","cisa","uptime"],"repository":{"url":"git+https://github.com/CapitolTrace/govwatch.git","type":"git"},"description":"Health checks for government APIs — Congress.gov, FEC, CISA KEV, NVD, GDELT, and more. CLI + TypeScript library.","maintainers":[{"name":"shane278","email":"admin@capitoltrace.com"}],"readme":"<h1 align=\"center\">🔍 govwatch</h1>\n\n<p align=\"center\">\n  <strong>Open-source health monitor for government APIs</strong><br/>\n  <em>Is Congress.gov up? Is FEC responding? Are CISA feeds current? Find out in seconds.</em>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@capitoltrace/govwatch\"><img src=\"https://img.shields.io/npm/v/%40capitoltrace%2Fgovwatch?style=flat-square&logo=npm&color=CB3837\" alt=\"npm\" /></a>\n  <img src=\"https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white\" alt=\"TypeScript\" />\n  <img src=\"https://img.shields.io/badge/CLI_+_Library-black?style=flat-square\" alt=\"CLI + Library\" />\n  <img src=\"https://img.shields.io/badge/17_APIs_Monitored-brightgreen?style=flat-square\" alt=\"17 APIs\" />\n  <img src=\"https://img.shields.io/badge/Zero_Dependencies-blue?style=flat-square\" alt=\"Zero Dependencies\" />\n  <img src=\"https://img.shields.io/badge/License-MIT-blue?style=flat-square\" alt=\"MIT\" />\n</p>\n\n---\n\n> **Status: v0.1.0 on npm** — try it right now: `npx @capitoltrace/govwatch check`\n>\n> **📊 [Live status page](https://status.capitoltrace.com/)** — these checks running every 30 minutes, with 30-day uptime history.\n\n---\n\n### Why this exists\n\nGovernment APIs go down. A lot. They rate-limit without warning, return empty responses instead of errors, and break backwards compatibility on federal holidays. If you're building civic tech, you need to know when your data sources are healthy — before your users find out.\n\n`govwatch` is the health check layer extracted from [Capitol Trace](https://capitoltrace.com), where we monitor 25+ government APIs every 15 minutes in production.\n\n### Usage\n\n#### CLI\n\n```bash\n# Check all supported APIs\nnpx govwatch check\n\n# Check specific services\nnpx govwatch check congress fec cisa-kev\n\n# Watch mode — continuous monitoring\nnpx govwatch watch --interval 5m\n\n# JSON output for CI/scripts\nnpx govwatch check --json\n\n# List services and their API key requirements\nnpx govwatch list\n```\n\n```\n  ✅ Congress.gov API      200      469ms\n  ✅ FEC OpenFEC           200      510ms\n  ✅ Senate LDA            200      345ms\n  ✅ GovInfo API           200    2,842ms\n  ✅ Federal Register      200      346ms\n  ⚠️ USAspending.gov      200    8,735ms  (slow: 8,735ms exceeds 8,000ms budget)\n  ✅ BLS Public Data API   200      288ms\n  ✅ CISA KEV Catalog      200      365ms\n  ✅ NVD (NIST)            200      179ms\n  ✅ State Dept Travel     200      242ms\n  ❌ GDELT Project         429   10,335ms  (rate limited)\n  ✅ CelesTrak NORAD       200      390ms\n  ✅ SEC EDGAR             200      220ms\n  ◌ Open States v3          —          —  (skipped: no API key — set OPENSTATES_API_KEY)\n\n  12/14 healthy · 1 degraded · 1 rate limited · 1 skipped (no API key)\n```\n\nExit codes are CI-friendly: `0` when everything is healthy (degraded and rate-limited don't fail the run unless you pass `--strict`), `1` when any service is unhealthy.\n\n#### As a library\n\n```typescript\nimport { govwatch } from '@capitoltrace/govwatch';\n\n// Check a single API\nconst result = await govwatch.check('congress');\n// { service: 'congress', status: 'healthy', statusCode: 200, responseTime: 469, ... }\n\n// Check all APIs\nconst results = await govwatch.checkAll();\n\n// Custom health check\ngovwatch.register({\n  name: 'my-state-api',\n  url: 'https://api.mystate.gov/v1/bills',\n  assertions: [\n    { type: 'status', expected: 200 },\n    { type: 'jsonPath', path: '$.results', check: 'isNotNull' },\n    { type: 'responseTime', maxMs: 5000 },\n  ],\n});\nconst custom = await govwatch.check('my-state-api');\n```\n\nNamed exports (`check`, `checkAll`, `register`, `listServices`) and full TypeScript types are also available.\n\n### APIs monitored\n\n| Category | Services (CLI slugs) |\n|:---------|:---------------------|\n| 🏛️ Congressional | `congress`, `fec`, `senate-lda`, `govinfo` |\n| 📊 Federal | `federal-register`, `usaspending`, `openstates`, `census`, `bls` |\n| 🛡️ National Security | `cisa-kev`, `nvd`, `state-travel`, `gdelt`, `celestrak`, `acled` |\n| 💰 Financial | `sec-edgar`, `quiver` |\n\n### API keys\n\nMost services work with no configuration. Services on api.data.gov (Congress.gov, FEC, GovInfo) fall back to the shared `DEMO_KEY` (30 requests/hour per IP), so casual checks work out of the box — set your own free keys for anything regular. Keyed services are **skipped** (not failed) when no key is set.\n\n| Env var | Service | Notes |\n|:--------|:--------|:------|\n| `DATA_GOV_API_KEY` | Congress.gov, FEC, GovInfo | One [api.data.gov key](https://api.data.gov/signup/) covers all three |\n| `CONGRESS_API_KEY` / `FEC_API_KEY` / `GOVINFO_API_KEY` | Per-service overrides | Take precedence over `DATA_GOV_API_KEY` |\n| `OPENSTATES_API_KEY` | Open States v3 | [Free key](https://open.pluralpolicy.com/accounts/signup/) |\n| `CENSUS_API_KEY` | Census Bureau ACS | [Free key](https://api.census.gov/data/key_signup.html) — the API returns HTTP 200 with an HTML error page without one |\n| `NVD_API_KEY` | NVD (NIST) | Optional — raises rate limits |\n| `ACLED_API_KEY` + `ACLED_EMAIL` | ACLED | [Registration](https://acleddata.com/register/) |\n| `QUIVER_API_KEY` | Quiver Quantitative | Paid API |\n\n### Health check anatomy\n\nEach check validates:\n- **Status code** — Is the API returning 2xx? (429 is reported as `rate-limited`, distinct from an outage)\n- **Response time** — Is it within acceptable latency? Slow-but-working services are reported as `degraded`, not down\n- **Content validation** — Does the response body contain expected data? Catches the classic government-API failure mode of HTTP 200 with an empty or HTML error body\n- **Freshness** — For data feeds (e.g. CISA KEV), is the content recent?\n\nTransport failures — DNS, refused connections, TLS, reset sockets — get one retry before a service is called down, since that class of failure is routinely momentary. Timeouts and HTTP responses are never retried.\n\nA few upstreams throttle shared datacenter IP ranges at the edge, where a refusal is indistinguishable from an outage: those are marked `bestEffort` (currently only GDELT), and a repeated transport failure against them reports `degraded` with the reason attached rather than `unhealthy`. Their HTTP responses, content assertions, and timeouts still fail normally, and `--strict` still fails on the degrade. Set `bestEffort: true` on your own `register()`ed services to opt in.\n\n### Installation\n\n```bash\n# Global CLI\nnpm install -g @capitoltrace/govwatch\n\n# Project dependency\nnpm install @capitoltrace/govwatch\n```\n\nRequires Node.js 18.17+. Zero runtime dependencies.\n\n### GitHub Action\n\nAdd govwatch to any workflow with [govwatch-action](https://github.com/CapitolTrace/govwatch-action):\n\n```yaml\n- uses: CapitolTrace/govwatch-action@v1\n  with:\n    services: congress fec cisa-kev   # empty = all services\n```\n\nIt prints per-service results, writes a table to the job summary, exposes `results` (JSON) and `outcome` outputs, and fails the step when an API is unhealthy.\n\n### Use cases\n\n- **CI pipelines** — Fail fast if a government API your app depends on is down\n- **Monitoring dashboards** — Integrate with Grafana, Datadog, or Checkly via `--json`, or see the [hosted status page](https://status.capitoltrace.com/)\n- **Incident response** — Quickly determine if an outage is your code or an upstream dependency\n- **Civic tech community** — Shared visibility into the reliability of public data sources\n\n### Ecosystem\n\ngovwatch powers a family of tools — each one is this package, reused:\n\n| | |\n|:--|:--|\n| 📊 [status.capitoltrace.com](https://status.capitoltrace.com/) | Live status page with 30-day uptime history, rechecked every 30 minutes ([source](https://github.com/CapitolTrace/govwatch-status)). JSON endpoints: [`status.json`](https://status.capitoltrace.com/status.json), [`history-30d.json`](https://status.capitoltrace.com/history-30d.json) |\n| ⚙️ [govwatch-action](https://github.com/CapitolTrace/govwatch-action) | GitHub Action — two lines of YAML to gate CI on upstream health |\n| 🤖 [@capitoltrace/mcp-server](https://www.npmjs.com/package/@capitoltrace/mcp-server) | The `check_api_health` tool lets AI assistants answer \"is Congress.gov up right now?\" |\n| 🏛️ [capitoltrace.com/source-health](https://capitoltrace.com/source-health) | Capitol Trace's own transparency page, built on these checks |\n\n### Contributing\n\nThis is an open-source project by [Capitol Trace](https://github.com/CapitolTrace). We'd love help with:\n- Adding new government API endpoints (see `src/registry.ts` — a service is ~20 lines)\n- Regional/international government API support\n- Webhook/Slack/Discord alert integrations\n- New assertion types (JSON schema validation, richer freshness checks)\n\n```bash\ngit clone https://github.com/CapitolTrace/govwatch\ncd govwatch\nnpm install\nnpm test\nnode dist/cli.js check\n```\n\n### License\n\nMIT\n\n---\n\n<p align=\"center\">\n  <strong>Part of the <a href=\"https://github.com/CapitolTrace\">Capitol Trace</a> ecosystem.</strong><br/>\n  <em>Because democracy runs on uptime.</em>\n</p>\n","readmeFilename":"README.md"}