{
  "openapi": "3.1.0",
  "info": {
    "title": "GovGreed Public API v1",
    "version": "1.0.0",
    "summary": "REST API for the GovGreed civic accountability dataset.",
    "description": "Read-only API for the integrated US civic accountability graph: 218M FEC contributions, 190K STOCK Act trades, 62K bills, 156 indexed tables. Free tier 20 calls/day per key. Paid tiers (Founders / Pro / Institutional) 750 calls/day. 5 req/sec burst limit. RFC 7807 errors. Docs: https://www.govgreed.com/docs",
    "contact": { "name": "GovGreed", "email": "team@mmamodel.ai", "url": "https://www.govgreed.com/docs" },
    "license":  { "name": "CC BY 4.0 (data) / MIT (code)", "url": "https://creativecommons.org/licenses/by/4.0/" }
  },
  "servers": [
    { "url": "https://www.govgreed.com/api/v1", "description": "Production gateway" }
  ],
  "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-API-Key", "description": "gg_pub_... API key" },
      "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API key", "description": "Authorization: Bearer gg_pub_..." }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": { "description": "Endpoint-specific payload (object, array, or scalar)." },
          "meta": {
            "type": "object",
            "properties": {
              "version":    { "type": "string", "example": "v1" },
              "request_id": { "type": "string", "example": "req_abc123def4" },
              "count":      { "type": "integer" },
              "tier":       { "type": "string", "enum": ["free", "pro"], "description": "free = 20 calls/day. pro = 750 calls/day (Founders, Pro, Institutional all share this quota). Founders ($24.50/mo locked forever) and Pro ($49/mo) are the public tiers." },
              "quota": {
                "type": "object",
                "properties": {
                  "limit":     { "type": "integer" },
                  "remaining": { "type": "integer" },
                  "reset_at":  { "type": "string", "format": "date-time" }
                }
              }
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 7807 problem+json error",
        "required": ["status", "code"],
        "properties": {
          "type":       { "type": "string", "format": "uri" },
          "title":      { "type": "string" },
          "status":     { "type": "integer" },
          "detail":     { "type": "string" },
          "instance":   { "type": "string" },
          "code":       { "type": "string" },
          "request_id": { "type": "string" }
        }
      }
    },
    "responses": {
      "Ok":          { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Envelope" } } } },
      "BadRequest":  { "description": "Bad request",  "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } },
      "Unauthorized":{ "description": "Auth failed",  "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } },
      "Forbidden":   { "description": "Forbidden",    "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } },
      "NotFound":    { "description": "Not found",    "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } },
      "RateLimited": { "description": "Rate limited", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } } }
    }
  },
  "tags": [
    { "name": "Meta",        "description": "Health, atlas, OpenAPI" },
    { "name": "Donors",      "description": "FEC individual contributors" },
    { "name": "Employers",   "description": "FEC employer aggregates" },
    { "name": "Politicians", "description": "Sitting members of Congress" },
    { "name": "Bills",       "description": "US federal bills" },
    { "name": "Companies",   "description": "Public companies (tickers)" },
    { "name": "Signals",     "description": "Composite trade signals + herd convergence" },
    { "name": "Predictions", "description": "Forward-looking trade predictions + EV-ranked opportunities" },
    { "name": "Sectors",     "description": "Sector-level congressional flow + positioning" },
    { "name": "Nominations", "description": "Senate confirmation tracker (Trump cabinet + judicial)" },
    { "name": "Nonprofits",  "description": "501(c)(3/4/5/6/19) + 527 organizations" },
    { "name": "Contracts",   "description": "Federal contracts (USASpending)" },
    { "name": "Government",  "description": "Federal equity stakes / loans / grants" },
    { "name": "OGE",         "description": "Executive branch financial disclosures (cabinet conflicts)" },
    { "name": "FARA",        "description": "Foreign Agents Registration Act" },
    { "name": "Macro",       "description": "FRED (Federal Reserve) + EIA (Energy) indicators" },
    { "name": "Markets",     "description": "Kalshi prediction markets with BPI overlay" },
    { "name": "Vessels",     "description": "AIS chokepoint vessel events" },
    { "name": "Districts",   "description": "Census ACS congressional district demographics" },
    { "name": "Account",     "description": "Your API key + usage" }
  ],
  "paths": {
    "/status": {
      "get": {
        "tags": ["Meta"], "operationId": "getStatus", "security": [],
        "summary": "Health check (no auth)",
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/openapi": {
      "get": {
        "tags": ["Meta"], "operationId": "getOpenapi", "security": [],
        "summary": "This OpenAPI 3.1 document",
        "responses": { "200": { "description": "OpenAPI document", "content": { "application/json": {} } } }
      }
    },
    "/atlas": {
      "get": {
        "tags": ["Meta"], "operationId": "getAtlas",
        "summary": "Full data catalog — START HERE for AI agents and integrations",
        "description": "Returns every queryable table with row count, current status (live/deprecated/empty), upstream source, RPCs that read it, frontend pages that consume it, last-reviewed date, and dedup verdicts. Recommended first call for any AI agent integrating this API — use it to discover what exists before composing chained queries to entity-specific endpoints.",
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "429": { "$ref": "#/components/responses/RateLimited" } }
      }
    },
    "/atlas/{table}": {
      "get": {
        "tags": ["Meta"], "operationId": "getAtlasOne",
        "summary": "Atlas entry for one table",
        "parameters": [{ "name": "table", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/donors/search": {
      "get": {
        "tags": ["Donors"], "operationId": "searchDonors",
        "summary": "Fuzzy-search FEC individual donors",
        "parameters": [
          { "name": "q",     "in": "query", "required": true,  "schema": { "type": "string" }, "description": "Donor name (any format)" },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/donors/{name}/profile": {
      "get": {
        "tags": ["Donors"], "operationId": "getDonorProfile",
        "summary": "Full profile for one donor",
        "parameters": [{ "name": "name", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Exact name_display from search_donors (URL-encoded)" }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/employers/search": {
      "get": {
        "tags": ["Employers"], "operationId": "searchEmployers",
        "summary": "Fuzzy-search FEC employers",
        "parameters": [
          { "name": "q",     "in": "query", "required": true,  "schema": { "type": "string" } },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/employers/{name}/profile": {
      "get": {
        "tags": ["Employers"], "operationId": "getEmployerProfile",
        "summary": "Full firm profile",
        "parameters": [{ "name": "name", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/politicians/{bioguide_id}": {
      "get": {
        "tags": ["Politicians"], "operationId": "getPolitician",
        "summary": "One politician's identity",
        "parameters": [{ "name": "bioguide_id", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Z]\\d{6}$" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/politicians/{bioguide_id}/donors": {
      "get": {
        "tags": ["Politicians"], "operationId": "getPoliticianDonors",
        "summary": "Donors who funded a politician",
        "parameters": [
          { "name": "bioguide_id", "in": "path",  "required": true, "schema": { "type": "string", "pattern": "^[A-Z]\\d{6}$" } },
          { "name": "q",     "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/bills/{bill_number}": {
      "get": {
        "tags": ["Bills"], "operationId": "getBill",
        "summary": "Full bill intelligence",
        "description": "bill_number is NOT unique across Congresses — every Congress recycles the same numbering. Defaults to the current (119th) Congress. Pass ?congress= for historical lookups. /bills/{n} and /bills/{n}/pass-likelihood share this default so they always reference the same bill.",
        "parameters": [
          { "name": "bill_number", "in": "path",  "required": true,  "schema": { "type": "string" }, "description": "Dotted form: HR.4521, S.5, HJRES.7" },
          { "name": "congress",    "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119], "default": 119 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/bills/{bill_number}/pass-likelihood": {
      "get": {
        "tags": ["Bills"], "operationId": "getBillPassLikelihood",
        "summary": "Deterministic 0-100 pass probability",
        "parameters": [
          { "name": "bill_number", "in": "path",  "required": true,  "schema": { "type": "string" } },
          { "name": "congress",    "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119] } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/companies/{ticker}": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompany",
        "summary": "Public-ticker metadata",
        "parameters": [{ "name": "ticker", "in": "path", "required": true, "schema": { "type": "string", "maxLength": 10 } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/companies/{ticker}/political-influence": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompanyPoliticalInfluence",
        "summary": "0-100 political influence score",
        "parameters": [{ "name": "ticker", "in": "path", "required": true, "schema": { "type": "string", "maxLength": 10 } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/companies/{ticker}/insider-signal": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompanyInsiderSignal",
        "summary": "Form 4 insider signal — open-market buys + executive comp (awards/exercises)",
        "description": "Returns two classes of insider activity: (1) open-market buys with score 0–100, signal_tier (S/A+/A/B/C/F), cluster detection, top 10 recent buys; (2) executive comp — award_count, award_total_value (stock grants valued at market price on grant date), exercise_count, exercise_total_value, recent_awards array. For defense primes (LMT, RTX, NOC, GD, BA) where execs receive stock as comp rather than buying open-market, the awards/exercises panel is the real signal. Use days=180 for full annual-cycle awards view.",
        "parameters": [
          { "name": "ticker", "in": "path",  "required": true,  "schema": { "type": "string", "maxLength": 10 } },
          { "name": "days",   "in": "query", "required": false, "schema": { "type": "integer", "default": 90, "minimum": 7, "maximum": 365 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/companies/{ticker}/carveouts": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompanyCarveouts",
        "summary": "Bill carveouts targeting one ticker (deduplicated server-side)",
        "description": "All bill_carveouts rows for a ticker, deduplicated on (bill_number, purpose, recipient). Highest-confidence LLM extraction wins per dedup key. Returns canonical list with duplicate_count showing how many raw extractions agreed. Example: LMT returns 8 canonical carveouts ~$9B (F-35 $4.3B, Sikorsky $3.6B, UH-60 $630M, Apache $504M).",
        "parameters": [
          { "name": "ticker", "in": "path",  "required": true,  "schema": { "type": "string", "maxLength": 10 } },
          { "name": "limit",  "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/companies/{ticker}/llm-analysis": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompanyLlmAnalysis",
        "summary": "LLM iron-triangle profile per ticker",
        "description": "Government_dependence, regulatory_density, lobbying_intensity scores + congressional_champions/critics + key_legislation_to_watch + regulatory_threats/opportunities. The narrative version of political-risk for a ticker.",
        "parameters": [{ "name": "ticker", "in": "path", "required": true, "schema": { "type": "string", "maxLength": 10 } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/politicians/{bioguide_id}/profile": {
      "get": {
        "tags": ["Politicians"], "operationId": "getPoliticianProfile",
        "summary": "Full LLM iron-triangle profile (45+ fields)",
        "description": "Conflict-of-interest summary, predicted_corruption_risk, top_donor_industries, sector_specializations, watchlist_signals, signature_legislation, expected_next_action, vulnerability_signal, forecast_thesis, recommended_watchlist_tickers.",
        "parameters": [{ "name": "bioguide_id", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Z]\\d{6}$" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/politicians/{bioguide_id}/conflict-score": {
      "get": {
        "tags": ["Politicians"], "operationId": "getPoliticianConflictScore",
        "summary": "Integer conflict score (0-100) + breakdowns",
        "description": "538 politicians pre-scored. Includes trade_activity, late_filing, committee_alignment, donor_alignment, voted_holdings sub-scores. Sub-100ms point lookup.",
        "parameters": [{ "name": "bioguide_id", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Z]\\d{6}$" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/bills/{bill_number}/carveouts": {
      "get": {
        "tags": ["Bills"], "operationId": "getBillCarveouts",
        "summary": "LLM-extracted line-item earmarks per bill",
        "description": "10K+ extracted carveouts across all bills. Returns section, dollar amount, recipient, ticker, sector, confidence, purpose. The follow-the-pork endpoint.",
        "parameters": [
          { "name": "bill_number", "in": "path",  "required": true,  "schema": { "type": "string" } },
          { "name": "congress",    "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119], "default": 119 } },
          { "name": "limit",       "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 200 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/bills/{bill_number}/timeline": {
      "get": {
        "tags": ["Bills"], "operationId": "getBillTimeline",
        "summary": "Unified bill event stream — state transitions + congressional + Form 4 + markups",
        "parameters": [
          { "name": "bill_number",      "in": "path",  "required": true,  "schema": { "type": "string" } },
          { "name": "congress",         "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119], "default": 119 } },
          { "name": "max_trades",       "in": "query", "required": false, "schema": { "type": "integer", "default": 200, "maximum": 500 } },
          { "name": "min_impact_ratio", "in": "query", "required": false, "schema": { "type": "number", "default": 0.02 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/politicians/search": {
      "get": {
        "tags": ["Politicians"], "operationId": "searchPoliticians",
        "summary": "Fuzzy politician search by name",
        "description": "Returns up to 100 matches ranked by trigram similarity then greediness. Use bioguide_id from result for follow-up calls (you don't have to know that P000197 = Pelosi anymore).",
        "parameters": [
          { "name": "q",     "in": "query", "required": true,  "schema": { "type": "string", "minLength": 2 } },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/politicians/{bioguide_id}/committees": {
      "get": {
        "tags": ["Politicians"], "operationId": "getPoliticianCommittees",
        "summary": "Active committee assignments",
        "description": "Returns all active committee + subcommittee memberships with role (Chair / Ranking / Member). Useful for understanding informational edge from committee position.",
        "parameters": [{ "name": "bioguide_id", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Z]\\d{6}$" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/bills/{bill_number}/votes": {
      "get": {
        "tags": ["Bills"], "operationId": "getBillVotes",
        "summary": "Roll call votes on a bill (tally + per-member positions)",
        "description": "Returns each roll call with chamber, date, question, result, tally (yea/nay/present/not_voting), and per-member positions ordered by party then name.",
        "parameters": [
          { "name": "bill_number", "in": "path",  "required": true,  "schema": { "type": "string" } },
          { "name": "congress",    "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119], "default": 119 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/signals/top": {
      "get": {
        "tags": ["Signals"], "operationId": "getSignalsTop",
        "summary": "Top-ranked composite trade signals",
        "description": "Flagship signal product. 7-layer fusion (politician quality, herd, bill correlation, technical, sector, contribution, lobbying). A+ tier has 72.7% backtested win rate. Filter by minimum tier.",
        "parameters": [
          { "name": "tier",  "in": "query", "required": false, "schema": { "type": "string", "enum": ["S","A+","A","B","C","D","F"], "default": "B" }, "description": "Minimum tier" },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } },
          { "name": "fresh", "in": "query", "required": false, "schema": { "type": "boolean", "default": true }, "description": "Only return freshness-flagged signals (last 30 days)" }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/herd-signals": {
      "get": {
        "tags": ["Signals"], "operationId": "getHerdSignals",
        "summary": "3+ politicians converging on the same ticker",
        "description": "Detected herd events: when N=3+ politicians buy/sell the same ticker within a tight window. Returns ticker, politician_count, herd_score, herd_tier, net_direction, committee_alignment_pct.",
        "parameters": [
          { "name": "tier",  "in": "query", "required": false, "schema": { "type": "string", "enum": ["S","A+","A","B","C","D","F"] } },
          { "name": "days",  "in": "query", "required": false, "schema": { "type": "integer", "default": 90, "maximum": 365 } },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/predictions/top": {
      "get": {
        "tags": ["Predictions"], "operationId": "getPredictionsTop",
        "summary": "Top active forward-looking trade predictions",
        "description": "Output of the 4 prediction engines (committee markup / pattern / signal-bridge / bill-correlation). Default returns ACTIVE A-tier+. ~819 active predictions across ~76 politicians.",
        "parameters": [
          { "name": "tier",   "in": "query", "required": false, "schema": { "type": "string", "enum": ["S","A+","A","B","C","D","F"], "default": "A" } },
          { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": ["ACTIVE","DARK_WINDOW","CONFIRMED","MISSED","EXPIRED"], "default": "ACTIVE" } },
          { "name": "limit",  "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/whale-opportunities": {
      "get": {
        "tags": ["Predictions"], "operationId": "getWhaleOpportunities",
        "summary": "EV-ranked bills (pass% × impact_ratio × insider tier)",
        "description": "Triple-confirmation alpha screen: bills with high pass probability + material market impact + corporate insider buying. Insider multiplier: S=2.0, A+=1.6, A=1.4, B=1.2, C=1.05.",
        "parameters": [
          { "name": "congress",         "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119], "default": 119 } },
          { "name": "min_pass_pct",     "in": "query", "required": false, "schema": { "type": "integer", "default": 40, "minimum": 0, "maximum": 100 } },
          { "name": "min_impact_ratio", "in": "query", "required": false, "schema": { "type": "number", "default": 0.05 } },
          { "name": "limit",            "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/sectors/{sector}/positioning": {
      "get": {
        "tags": ["Sectors"], "operationId": "getSectorPositioning",
        "summary": "Congressional buy/sell flow per sector over N days",
        "description": "Summary stats + top 10 politicians by volume + top 10 tickers by trade count. Sector match is case-insensitive against companies.sector (Technology, Healthcare, Energy, Financial Services, etc.).",
        "parameters": [
          { "name": "sector", "in": "path",  "required": true,  "schema": { "type": "string" } },
          { "name": "days",   "in": "query", "required": false, "schema": { "type": "integer", "default": 30, "maximum": 365 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/nominations/search": {
      "get": {
        "tags": ["Nominations"], "operationId": "searchNominations",
        "summary": "Search Senate nominations",
        "description": "Trump cabinet + judicial confirmations (6,727 across 117/118/119). Filter by status, congress, or fuzzy text on description/organization/citation.",
        "parameters": [
          { "name": "q",        "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "status",   "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "congress", "in": "query", "required": false, "schema": { "type": "integer", "enum": [117, 118, 119] } },
          { "name": "limit",    "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/nominations/{congress}/{number}": {
      "get": {
        "tags": ["Nominations"], "operationId": "getNomination",
        "summary": "One Senate nomination by (congress, number)",
        "parameters": [
          { "name": "congress", "in": "path", "required": true, "schema": { "type": "integer" } },
          { "name": "number",   "in": "path", "required": true, "schema": { "type": "integer" } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/nonprofits/search": {
      "get": {
        "tags": ["Nonprofits"], "operationId": "searchNonprofits",
        "summary": "Search 40K nonprofits (ProPublica)",
        "description": "501(c)(3/4/5/6/19) + 527. Subsection 4 = dark-money tracker. Filter by subsection, state, or political_only flag.",
        "parameters": [
          { "name": "q",          "in": "query", "required": true,  "schema": { "type": "string", "minLength": 2 } },
          { "name": "subsection", "in": "query", "required": false, "schema": { "type": "integer", "enum": [3, 4, 5, 6, 19, 527] } },
          { "name": "state",      "in": "query", "required": false, "schema": { "type": "string", "maxLength": 2 } },
          { "name": "political",  "in": "query", "required": false, "schema": { "type": "boolean", "default": false } },
          { "name": "limit",      "in": "query", "required": false, "schema": { "type": "integer", "default": 25, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/nonprofits/{ein}": {
      "get": {
        "tags": ["Nonprofits"], "operationId": "getNonprofitProfile",
        "summary": "Full Form 990 profile by EIN",
        "parameters": [{ "name": "ein", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^\\d{2}-?\\d{7}$" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/government-contracts": {
      "get": {
        "tags": ["Contracts"], "operationId": "getGovernmentContracts",
        "summary": "Federal contracts (USASpending)",
        "parameters": [
          { "name": "ticker",     "in": "query", "required": false, "schema": { "type": "string", "maxLength": 10 } },
          { "name": "agency",     "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "min_amount", "in": "query", "required": false, "schema": { "type": "number" } },
          { "name": "limit",      "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 200 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/companies/{ticker}/contracts": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompanyContracts",
        "summary": "Federal contracts for one ticker",
        "parameters": [
          { "name": "ticker",     "in": "path",  "required": true,  "schema": { "type": "string", "maxLength": 10 } },
          { "name": "agency",     "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "min_amount", "in": "query", "required": false, "schema": { "type": "number" } },
          { "name": "limit",      "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 200 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/government-equity-stakes": {
      "get": {
        "tags": ["Government"], "operationId": "getGovernmentEquityStakes",
        "summary": "Federal equity / loan / grant deals INTO public companies",
        "description": "Trump-era 'government as VC' asset class. Intel CHIPS, MP DoD $400M, USAR Commerce, GE Vernova LPO, Plug Power. Includes price reaction (t+1, t+30, return_30d_pct).",
        "parameters": [
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 200 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/oge/officials": {
      "get": {
        "tags": ["OGE"], "operationId": "searchOgeOfficials",
        "summary": "Search Trump cabinet + senior White House staff",
        "parameters": [
          { "name": "q",       "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "active",  "in": "query", "required": false, "schema": { "type": "boolean", "default": true } },
          { "name": "limit",   "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 100 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/oge/officials/{department_slug}": {
      "get": {
        "tags": ["OGE"], "operationId": "getOgeOfficialProfile",
        "summary": "OGE financial-disclosure profile per cabinet official",
        "description": "Identity + filings + top 25 holdings (by value) + conflict flags (critical mineral / defense / pharma / crypto exposure).",
        "parameters": [{ "name": "department_slug", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/companies/{ticker}/forecast": {
      "get": {
        "tags": ["Companies"], "operationId": "getCompanyForecast",
        "summary": "LLM 30-day politician trade forecast for a ticker",
        "description": "Forecasts include catalyst bill, expected position size range, historical precedent, concurrent corroborating signals. Coverage: 13 tickers (defense + select tech) as of 2026-04-30.",
        "parameters": [
          { "name": "ticker",     "in": "path",  "required": true,  "schema": { "type": "string", "maxLength": 10 } },
          { "name": "days_ahead", "in": "query", "required": false, "schema": { "type": "integer", "default": 60, "maximum": 365 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/fara/registrants/search": {
      "get": {
        "tags": ["FARA"], "operationId": "searchFaraRegistrants",
        "summary": "Search FARA primary registrants",
        "parameters": [
          { "name": "q",      "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "active", "in": "query", "required": false, "schema": { "type": "boolean", "default": true } },
          { "name": "limit",  "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 200 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/macro/fred": {
      "get": {
        "tags": ["Macro"], "operationId": "getMacroFred",
        "summary": "FRED macro time series",
        "description": "17 series (DFF/GS2/GS10/GS30/CPI/PCE/UNRATE/GDP/VIX/etc) 2012-now. Pass series= comma-separated to filter.",
        "parameters": [
          { "name": "series", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated series IDs" },
          { "name": "start",  "in": "query", "required": false, "schema": { "type": "string", "format": "date" } },
          { "name": "limit",  "in": "query", "required": false, "schema": { "type": "integer", "default": 200, "maximum": 1000 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/macro/eia": {
      "get": {
        "tags": ["Macro"], "operationId": "getMacroEia",
        "summary": "EIA petroleum / energy time series (weekly)",
        "parameters": [
          { "name": "series", "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "limit",  "in": "query", "required": false, "schema": { "type": "integer", "default": 200, "maximum": 1000 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/markets/kalshi": {
      "get": {
        "tags": ["Markets"], "operationId": "getMarketsKalshi",
        "summary": "Live Kalshi prediction markets with BPI overlay",
        "description": "For bill-linked markets, returns our bpi_score + edge_pp + signal_side alongside Kalshi market_implied_pct. Filter by category or minimum |edge_pp|.",
        "parameters": [
          { "name": "category", "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "min_edge", "in": "query", "required": false, "schema": { "type": "number" } },
          { "name": "limit",    "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "maximum": 200 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/vessels/chokepoints": {
      "get": {
        "tags": ["Vessels"], "operationId": "getVesselsChokepoints",
        "summary": "AIS vessel events at maritime chokepoints (Hormuz / Malacca / etc)",
        "parameters": [
          { "name": "chokepoint", "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "days",       "in": "query", "required": false, "schema": { "type": "integer", "default": 30, "maximum": 365 } },
          { "name": "limit",      "in": "query", "required": false, "schema": { "type": "integer", "default": 100, "maximum": 500 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    },
    "/districts/{state}/{district}/demographics": {
      "get": {
        "tags": ["Districts"], "operationId": "getDistrictDemographics",
        "summary": "Census ACS demographics for one congressional district",
        "parameters": [
          { "name": "state",    "in": "path", "required": true, "schema": { "type": "string", "minLength": 2, "maxLength": 2 } },
          { "name": "district", "in": "path", "required": true, "schema": { "type": "string", "maxLength": 3 } }
        ],
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/me": {
      "get": {
        "tags": ["Account"], "operationId": "getMe",
        "summary": "Your API key metadata",
        "responses": { "200": { "$ref": "#/components/responses/Ok" }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/me/usage": {
      "get": {
        "tags": ["Account"], "operationId": "getMeUsage",
        "summary": "Daily usage timeline",
        "parameters": [{ "name": "days", "in": "query", "required": false, "schema": { "type": "integer", "default": 30, "maximum": 90 } }],
        "responses": { "200": { "$ref": "#/components/responses/Ok" } }
      }
    }
  }
}
