{
  "openapi": "3.0.1",
  "info": {
    "title": "Bank & Credit-Union Financial Health API — FDIC/NCUA QoQ",
    "description": "Bank & credit-union financial-health API on keyless FDIC data (NCUA v1.1): unified per-institution assets, deposits, equity, ROA, ROE, NIM and asset quality, with quarter-over-quarter deltas, peer-percentile scoring, and derived health flags (deposit outflow, low ROA, rising NPL).",
    "version": "1.3",
    "x-build-id": "rIgwf227nUyjsXYZM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~fdic-ncua-health-rollup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-fdic-ncua-health-rollup",
        "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~fdic-ncua-health-rollup/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-fdic-ncua-health-rollup",
        "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~fdic-ncua-health-rollup/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-fdic-ncua-health-rollup",
        "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": {
          "state": {
            "title": "State (2-letter)",
            "type": "string",
            "description": "US state to scope the cohort, e.g. CA, TX, NY. Strongly recommended: it focuses the run and makes peer percentiles state-level. Empty = the entire country (slower; national peer scoring)."
          },
          "institutionType": {
            "title": "Institution type",
            "enum": [
              "bank",
              "credit_union",
              "all"
            ],
            "type": "string",
            "description": "Which institutions to include. 'bank' = FDIC-insured banks, fully supported, the only option that returns data today. 'credit_union' = NCUA — NOT AVAILABLE YET (ships in v1.3); selecting it alone fails the run immediately and bills nothing, rather than quietly handing back bank data. 'all' = runs the bank half now and picks up credit unions automatically the moment v1.3 lands.",
            "default": "bank"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "snapshot",
              "delta",
              "score",
              "stress"
            ],
            "type": "string",
            "description": "Every mode returns the SAME full field set — capital ratios, uninsured deposits, unrealized losses, CRE concentration, credit quality and quarter-over-quarter deltas. Mode changes the ordering only. snapshot = largest institutions first. delta = biggest quarter-over-quarter deposit move first (the headline run-risk signal). score = highest peer asset percentile first. stress = most health flags first, the triage view.",
            "default": "snapshot"
          },
          "peerBasis": {
            "title": "Peer group for percentile scoring",
            "enum": [
              "cohort",
              "business_line",
              "asset_band",
              "community_bank"
            ],
            "type": "string",
            "description": "What counts as a 'peer' when computing peer_asset_percentile, peer_roa_percentile, peer_cre_percentile and peer_uninsured_percentile. 'cohort' scores against everything you pulled (a state cohort mixes a $27M agricultural bank with a $200B trust bank, so the percentile means little). 'business_line' uses the FDIC SPECGRP business-model peer group — the cut a bank examiner uses. 'asset_band' uses FFIEC-style size bands. 'community_bank' splits on the FDIC community-bank research flag. Groups with fewer than 5 institutions fall back to the full cohort rather than ranking a bank against two neighbours.",
            "default": "cohort"
          },
          "benchmark": {
            "title": "Peer benchmark",
            "enum": [
              "none",
              "national",
              "state"
            ],
            "type": "string",
            "description": "Adds asset-weighted benchmark ratios and this bank's distance from them, in percentage points: benchmark_uninsured_deposit_ratio, benchmark_cre_to_tier1_pct, benchmark_unrealized_loss_to_equity_pct plus uninsured_vs_benchmark_pts, cre_vs_benchmark_pts, unrealized_vs_benchmark_pts. 'national' compares against all ~4,350 FDIC-insured banks; 'state' against the banks in your state. Costs exactly ONE extra request thanks to server-side aggregation — not a second full download. 'none' skips it.",
            "default": "national"
          },
          "creGrowth": {
            "title": "Evaluate the 36-month CRE growth prong",
            "type": "boolean",
            "description": "The 2006 interagency CRE guidance is TWO tests: construction >= 100% of capital, OR (CRE >= 300% of capital AND CRE grew >= 50% over 36 months). Leaving this on fetches the quarter from 12 quarters ago — one extra request — and fills cre_growth_36m_pct, cre_total_loans_36m_ago, cre_baseline_date and cre_guidance_prong, plus the cre_guidance_both_prongs flag. Turn it off to skip that request; the level tests still run.",
            "default": true
          },
          "minAssets": {
            "title": "Min total assets (in $000s)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include institutions with at least this many total assets, in thousands of dollars (FDIC reports assets in $000s, so 1000000 = $1B). Use with maxAssets to build a peer band. 0 = no floor.",
            "default": 0
          },
          "maxAssets": {
            "title": "Max total assets (in $000s)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include institutions with at most this many total assets, in thousands of dollars. 0 = no ceiling. Combine with minAssets to score within an asset-size peer band (e.g. community banks $250M–$1B).",
            "default": 0
          },
          "priorItems": {
            "title": "Prior items (delta baseline)",
            "type": "array",
            "description": "Optional. In delta mode, an array of institution rows from a previous run (each needs id, total_assets, total_deposits) to diff the current quarter against, instead of auto-fetching the prior quarter. Lets you compare two arbitrary runs.",
            "default": []
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of institution-health records to return after filtering, scoring, and ranking. This is your cost cap: one record = one billable result. 500 covers a full mid-size state; TX has ~380 banks, CA ~180.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}