{
  "openapi": "3.0.1",
  "info": {
    "title": "FEC Campaign-Finance Delta, Concentration & Donor Graph API",
    "description": "Track FEC filings & receipts: new-filing delta feed, donor/vendor concentration (HHI) analytics, and a contributor-committee graph. OpenFEC source.",
    "version": "1.1",
    "x-build-id": "P5VQMvGcy2zIwgXtE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~fec-campaign-finance-delta/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-fec-campaign-finance-delta",
        "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/malonestar~fec-campaign-finance-delta/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-fec-campaign-finance-delta",
        "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/malonestar~fec-campaign-finance-delta/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-fec-campaign-finance-delta",
        "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": {
          "apiKey": {
            "title": "api.data.gov API key",
            "type": "string",
            "description": "Your FREE api.data.gov key for the OpenFEC API, sent as ?api_key=. Register in seconds at https://api.open.fec.gov/developers . DEMO_KEY is prefilled and works for a demo, but api.data.gov caps it at roughly 30 requests/hour shared across every user of that key - a real run needs your own key. If OpenFEC refuses the key the run FAILS loudly rather than returning an empty dataset."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "delta",
              "concentration",
              "graph"
            ],
            "type": "string",
            "description": "search = list matching filings/receipts/disbursements; delta = only NEW rows (since a date and/or not seen in a prior run); concentration = top donors/vendors by summed amount with a Herfindahl (HHI) score; graph = contributor<->committee edge list.",
            "default": "search"
          },
          "dataType": {
            "title": "Data type",
            "enum": [
              "receipts",
              "disbursements",
              "filings"
            ],
            "type": "string",
            "description": "Which OpenFEC feed to pull: receipts = itemized contributions (schedule_a), disbursements = committee spending / vendor payments (schedule_b), filings = report filings feed (/filings). Concentration/graph work on receipts (donors) or disbursements (vendors).",
            "default": "receipts"
          },
          "committeeId": {
            "title": "Committee ID",
            "type": "string",
            "description": "FEC committee id to scope to, e.g. C00401224 (ActBlue). Strongly recommended for receipts/disbursements — narrows the huge itemized tables and avoids rate limits."
          },
          "candidateId": {
            "title": "Candidate ID",
            "type": "string",
            "description": "FEC candidate id to scope to, e.g. P80001571. Returns rows tied to that candidate's committees."
          },
          "name": {
            "title": "Contributor / recipient name",
            "type": "string",
            "description": "Free-text name filter. For receipts it matches the contributor name; for disbursements it matches the recipient/payee name. Ignored for filings."
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Two-letter state code, e.g. CA. For receipts = contributor state; for disbursements = recipient state; for filings = committee state."
          },
          "sinceDate": {
            "title": "Since date (YYYY-MM-DD)",
            "pattern": "^$|^\\d{4}-\\d{1,2}-\\d{1,2}$",
            "type": "string",
            "description": "Lower date bound. Maps to min_date (receipts/disbursements) or min_receipt_date (filings), and is also compared against each row's ISO date in delta mode. MUST be YYYY-MM-DD (e.g. 2023-01-15) - any other format FAILS the run before anything is fetched or billed, rather than silently returning the whole fetched window or none of it. Measured on 3 fixture rows whose true answer was 2: \"01/15/2023\" returned 3, \"Jan 2023\" returned 0, \"2023-13-45\" returned 1, and the unpadded \"2023-1-1\" returned 1. An unpadded 2023-1-1 IS accepted and zero-padded (it is unambiguous); slash forms are rejected on purpose because 05/06/2025 is ambiguous between US and EU order. Empty = no lower bound."
          },
          "untilDate": {
            "title": "Until date (YYYY-MM-DD)",
            "pattern": "^$|^\\d{4}-\\d{1,2}-\\d{1,2}$",
            "type": "string",
            "description": "Upper date bound. Maps to max_date (receipts/disbursements) or max_receipt_date (filings). MUST be YYYY-MM-DD (e.g. 2023-12-31) - any other format FAILS the run before anything is fetched or billed. An unpadded 2023-1-1 IS accepted and zero-padded; slash forms are rejected on purpose because 05/06/2025 is ambiguous between US and EU order. Empty = no upper bound."
          },
          "minAmount": {
            "title": "Minimum amount",
            "type": "string",
            "description": "Only return transactions at or above this dollar amount (receipts/disbursements only). Empty = no minimum."
          },
          "priorItems": {
            "title": "Prior items (delta mode)",
            "type": "array",
            "description": "Delta mode: the previous run's results (or a list of sub_id strings). Any row already present is treated as seen and excluded, leaving only new activity. The actor also keeps its own rolling seen-set in the key-value store for scheduled runs.",
            "default": []
          },
          "concentrationBy": {
            "title": "Concentration / graph entity",
            "enum": [
              "contributor",
              "employer",
              "recipient",
              "committee"
            ],
            "type": "string",
            "description": "Which entity to roll up for concentration/graph modes: contributor = donor name, employer = donor employer (industry concentration), recipient = vendor/payee (disbursements), committee = receiving committee.",
            "default": "contributor"
          },
          "topN": {
            "title": "Top N (concentration / graph)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Keep only the top N entities (concentration) or edges (graph), ranked by summed amount. The HHI on the concentration_summary row is always computed over ALL entities, not just the ones kept.",
            "default": 100
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Maximum number of itemized rows to fetch before delta, concentration or graph processing. Rows come back NEWEST FIRST, so a cap gives you the most recent slice - not a ranked or representative sample. Concentration and graph rows computed over a capped fetch are labelled analysis_basis=\"sample\" rather than being presented as the population figure.",
            "default": 1000
          },
          "includeMemoRows": {
            "title": "Include FEC memo entries in totals",
            "type": "boolean",
            "description": "FEC MEMO entries are sub-itemisations of a transaction already reported on a parent line, so summing them double-counts money. They are EXCLUDED from concentration and graph totals by default and counted in analysis_memo_rows_excluded. Turn this on only if you specifically want the memo detail folded in. Every row carries is_memo either way.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}