{
  "openapi": "3.0.1",
  "info": {
    "title": "Congressional Trading Signals — STOCK Act Intelligence",
    "description": "Turn US congressional STOCK Act disclosures into signals. Parses House filings into trades, then detects late disclosures, buying clusters, new positions, committee activity, behaviour changes, and consensus scores. Official House & Senate data — no AI, no third-party sources.",
    "version": "2.0",
    "x-build-id": "a8FXMyaeBWscOqX75"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~congress-stock-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-congress-stock-tracker",
        "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/ryanclinton~congress-stock-tracker/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-congress-stock-tracker",
        "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/ryanclinton~congress-stock-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-congress-stock-tracker",
        "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": {
          "members": {
            "title": "Member Names",
            "maxItems": 50,
            "type": "array",
            "description": "Congress members to search (e.g. [\"Pelosi\", \"Tuberville\"]). Partial match. Empty = all members.",
            "items": {
              "type": "string"
            }
          },
          "tickers": {
            "title": "Stock Tickers",
            "maxItems": 100,
            "type": "array",
            "description": "Filter House trades by extracted ticker (e.g. [\"NVDA\", \"AAPL\"]). Empty = all tickers.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "maxItems": 56,
            "type": "array",
            "description": "Two-letter state codes to filter by (e.g. [\"CA\", \"TX\"]). Applies to House records.",
            "items": {
              "type": "string"
            }
          },
          "chamber": {
            "title": "Chamber",
            "enum": [
              "both",
              "house",
              "senate"
            ],
            "type": "string",
            "description": "Filter by congressional chamber.",
            "default": "both"
          },
          "transactionType": {
            "title": "Transaction Side",
            "enum": [
              "both",
              "purchase",
              "sale",
              "exchange"
            ],
            "type": "string",
            "description": "Filter by transaction side, matched against the real extracted buy/sell/exchange code on House trades.",
            "default": "both"
          },
          "daysBack": {
            "title": "Days Back",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "How many days back to fetch filings.",
            "default": 90
          },
          "fromDate": {
            "title": "From Date (optional)",
            "type": "string",
            "description": "Lower bound (YYYY-MM-DD) applied to the date basis below. Refines the daysBack window."
          },
          "toDate": {
            "title": "To Date (optional)",
            "type": "string",
            "description": "Upper bound (YYYY-MM-DD) applied to the date basis below."
          },
          "dateBasis": {
            "title": "Date Basis",
            "enum": [
              "disclosureDate",
              "transactionDate"
            ],
            "type": "string",
            "description": "Which date the From/To range filters on. Transaction date = when the trade happened; disclosure date = when it was filed.",
            "default": "disclosureDate"
          },
          "minAmountMidpoint": {
            "title": "Minimum Trade Size (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return trades whose disclosed amount midpoint is at least this value. 0 = no minimum.",
            "default": 0
          },
          "minImportanceScore": {
            "title": "Minimum Importance Score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only return trades with importanceScore (0-100) at least this value. Importance = size + lateness + asset/owner flags + recency. 0 = no minimum.",
            "default": 0
          },
          "lateFilingsOnly": {
            "title": "Late Filings Only",
            "type": "boolean",
            "description": "Return only trades disclosed outside the STOCK Act 45-day window (late or severely-late).",
            "default": false
          },
          "newOnly": {
            "title": "New Trades Only",
            "type": "boolean",
            "description": "Watchlist mode only: emit only filings not seen in prior runs on the same watchlist. Ideal for scheduled alerts.",
            "default": false
          },
          "watchlistName": {
            "title": "Watchlist Name (optional)",
            "type": "string",
            "description": "Set a name to enable cross-run monitoring. Records are tagged changeFlag NEW or UNCHANGED versus prior runs."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum records returned. House PTR PDFs are parsed newest-first; higher values parse more filings.",
            "default": 50
          },
          "outputProfile": {
            "title": "Output Profile",
            "enum": [
              "full",
              "minimal",
              "dashboard",
              "monitoring"
            ],
            "type": "string",
            "description": "full = every field; minimal = headline trade columns; dashboard = member/ticker/side/amountMidpoint/compliance/importance (BI tools); monitoring = ids + signalTags/alertPriority/changeFlag (automations).",
            "default": "full"
          },
          "includeAggregates": {
            "title": "Include Aggregate Records",
            "type": "boolean",
            "description": "Emit one tickerSummary record per ticker and one memberSummary record per member (buy/sell counts, volume, late-filing rate). Not charged.",
            "default": false
          },
          "includeTrends": {
            "title": "Include Trend Records",
            "type": "boolean",
            "description": "Emit per-ticker time-bucketed trend records (purchase/sale counts + volume per period). Not charged.",
            "default": false
          },
          "includeEvents": {
            "title": "Include Event Records",
            "type": "boolean",
            "description": "Emit deterministic 'why it matters' event records: large_purchase / large_sale, late_filing / severely_late_filing, trade_cluster (3+ members buying one ticker within 30 days), congressional_accumulation, plus new_position / position_exit (watchlist mode) and committee_activity (when committeeData supplied). Not charged.",
            "default": false
          },
          "includeStories": {
            "title": "Include Story Records",
            "type": "boolean",
            "description": "Emit templated journalist 'story' records (headline + category) composed from the strongest events — committee clusters, buyer clusters, accumulation, severe late filings. Not charged.",
            "default": false
          },
          "committeeData": {
            "title": "Committee Data (optional)",
            "type": "object",
            "description": "Your own member -> committees map for committee enrichment, e.g. {\"Pelosi\": [\"Intelligence\"], \"Walberg\": [\"Energy and Commerce\"]}. Keys match member names loosely (last name OK). Enables committeeMemberships on trades + committee_activity events. The actor never bundles a roster — you supply authoritative data."
          },
          "trendBucket": {
            "title": "Trend Bucket",
            "enum": [
              "week",
              "month"
            ],
            "type": "string",
            "description": "Time bucket for trend records.",
            "default": "week"
          },
          "saveSourcePdfs": {
            "title": "Save Source PDFs",
            "type": "boolean",
            "description": "Store each parsed House PTR PDF to the key-value store and add sourcePdfKey to the record. Useful for audit / journalism.",
            "default": false
          },
          "saveRawText": {
            "title": "Save Raw Filing Text",
            "type": "boolean",
            "description": "Store the extracted PTR text to the key-value store and add rawTextKey to the record.",
            "default": false
          },
          "member": {
            "title": "Member Name (legacy alias)",
            "type": "string",
            "description": "Legacy alias for a single entry in Member Names. Prefer the members list."
          },
          "ticker": {
            "title": "Stock Ticker (legacy alias)",
            "type": "string",
            "description": "Legacy alias for a single entry in Stock Tickers. Prefer the tickers list."
          },
          "proxyConfiguration": {
            "title": "Proxy (for Senate EFD)",
            "type": "object",
            "description": "The Senate EFD portal restricts automated access from shared IPs. To include Senate data reliably, enable a residential proxy. House data needs no proxy."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}