{
  "openapi": "3.0.1",
  "info": {
    "title": "FEC Campaign Finance Intelligence MCP",
    "description": "Follow the money in US politics — FEC campaign finance data via MCP.",
    "version": "0.1",
    "x-build-id": "YsyDAzwgxIzDjdQDC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/andrew_avina~fec-intelligence-mcp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-andrew_avina-fec-intelligence-mcp",
        "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/andrew_avina~fec-intelligence-mcp/runs": {
      "post": {
        "operationId": "runs-sync-andrew_avina-fec-intelligence-mcp",
        "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/andrew_avina~fec-intelligence-mcp/run-sync": {
      "post": {
        "operationId": "run-sync-andrew_avina-fec-intelligence-mcp",
        "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": "Query Mode",
            "enum": [
              "candidates",
              "committees",
              "totals",
              "contributions"
            ],
            "type": "string",
            "description": "Which type of FEC data to query. 'candidates' = search candidate records, 'committees' = search PACs and committees, 'totals' = get fundraising totals for a specific candidate (requires candidateId), 'contributions' = search individual contribution records.",
            "default": "candidates"
          },
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "Name or keyword to search. For candidates: 'Biden', 'Warren', 'Smith'. For committees: 'EMILY List', 'Club for Growth'. Leave empty to browse all records.",
            "default": ""
          },
          "state": {
            "title": "State Filter",
            "type": "string",
            "description": "Two-letter state abbreviation to filter by. Examples: 'CA', 'TX', 'NY', 'FL', 'OH'. Leave empty for all states.",
            "default": ""
          },
          "office": {
            "title": "Office Sought (Candidates)",
            "enum": [
              "",
              "president",
              "senate",
              "house"
            ],
            "type": "string",
            "description": "For candidates mode: filter by office. 'president', 'senate', or 'house'. Leave empty for all offices.",
            "default": ""
          },
          "party": {
            "title": "Party Code (Candidates)",
            "type": "string",
            "description": "For candidates mode: filter by party code. 'DEM' = Democrat, 'REP' = Republican, 'IND' = Independent, 'LIB' = Libertarian, 'GRE' = Green. Leave empty for all parties.",
            "default": ""
          },
          "cycle": {
            "title": "Election Cycle Year",
            "minimum": 1980,
            "maximum": 2030,
            "type": "integer",
            "description": "Two-year election cycle (even years only). 2024 = 2023–2024, 2022 = 2021–2022, etc. Defaults to 2024.",
            "default": 2024
          },
          "candidateId": {
            "title": "Candidate ID (Totals mode)",
            "type": "string",
            "description": "FEC candidate ID for the 'totals' mode. Format: P/S/H + 8 digits. Examples: 'P80001571' (Biden), 'P80000722' (Trump). Get this from a candidates search first.",
            "default": ""
          },
          "contributorName": {
            "title": "Contributor Name (Contributions mode)",
            "type": "string",
            "description": "Donor name to search in contribution records. Partial match supported. Examples: 'Soros', 'Koch', 'Bloomberg', 'Gates'.",
            "default": ""
          },
          "contributorEmployer": {
            "title": "Contributor Employer (Contributions mode)",
            "type": "string",
            "description": "Donor's employer to search in contribution records. Examples: 'Google', 'Goldman Sachs', 'Apple Inc', 'Harvard University'.",
            "default": ""
          },
          "minAmount": {
            "title": "Minimum Contribution Amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return contributions at or above this dollar amount. The 2024 individual contribution limit per candidate per election is $3,300.",
            "default": 0
          },
          "maxAmount": {
            "title": "Maximum Contribution Amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return contributions at or below this dollar amount. Set to 0 for no upper limit.",
            "default": 0
          },
          "limit": {
            "title": "Result Limit",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of records to return (max 200). The FEC API paginates at 100 per page — larger limits will make multiple API calls.",
            "default": 20
          },
          "serveMcp": {
            "title": "MCP Server Mode",
            "type": "boolean",
            "description": "When enabled, starts an MCP-compatible HTTP server on port 4321 instead of returning a batch dataset. Use this mode to connect Claude Desktop, Cursor, or any MCP client directly to live FEC campaign finance data. The actor will run continuously until stopped.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}