{
  "openapi": "3.0.1",
  "info": {
    "title": "FDIC Bank Branch Openings, Closings & Market Exit Rollup",
    "description": "Net FDIC branch churn by bank, county and quarter: openings, closings, purchases, acquisitions, divestitures and relocations, with metro area and branch-desert flags, plus the verified standing branch count today from FDIC's own branch list, so a market exit is confirmed rather than inferred.",
    "version": "1.1",
    "x-build-id": "KtqphiEJFNsMrDdhE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malonestar~fdic-branch-network-churn-rollup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malonestar-fdic-branch-network-churn-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-branch-network-churn-rollup/runs": {
      "post": {
        "operationId": "runs-sync-malonestar-fdic-branch-network-churn-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-branch-network-churn-rollup/run-sync": {
      "post": {
        "operationId": "run-sync-malonestar-fdic-branch-network-churn-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": {
          "mode": {
            "title": "Output mode",
            "enum": [
              "churn",
              "events",
              "county",
              "bank"
            ],
            "type": "string",
            "description": "What shape of rows to emit. 'churn' = the bank x county x quarter rollup with net change and market entry/exit flags (the main product). 'events' = the typed raw branch-event stream. 'county' = county x quarter aggregate with bank counts and the branch-desert signal. 'bank' = per-bank network trajectory across the selected states.",
            "default": "churn"
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "REQUIRED. Two-letter USPS codes for the states whose branch networks you want, for example [\"TX\"] or [\"TX\",\"OK\"]. Filtering uses the FDIC field OFF_PSTALP, which is the BRANCH's state (not the bank's charter state), so out-of-state banks operating branches here are included. Maximum 10 states per run.",
            "default": [
              "TX"
            ],
            "items": {
              "type": "string"
            }
          },
          "sinceDate": {
            "title": "Since date",
            "type": "string",
            "description": "Only emit quarters on or after this date, as YYYY-MM-DD, for example \"2024-01-01\". This bounds the OUTPUT window only: the actor still replays the full FDIC branch history behind the scenes so that office counts and market entry/exit flags are correct. Leave blank to use the 'Quarters' field instead."
          },
          "untilDate": {
            "title": "Until date",
            "type": "string",
            "description": "Only emit quarters on or before this date, as YYYY-MM-DD, for example \"2026-06-30\". Leave blank to run through the current quarter."
          },
          "quarters": {
            "title": "Quarters (lookback)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Alternative to 'Since date': emit this many most recent quarters, counting back from the current quarter, for example 12 for a three-year view. Ignored when 'Since date' is set. Range 1 to 200."
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Optional county-name filter within the selected states, for example [\"HARRIS\",\"DALLAS\"]. FDIC stores county names in upper case and the actor upper-cases whatever you type. Leave empty for every county in the state.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on the number of dataset rows emitted, for example 500. This is what you are billed for, so it defaults to 500 - the same number as the prefill - and never silently sweeps a whole state. Raise it deliberately for a full sweep (a large state can produce tens of thousands of rows).",
            "default": 500
          },
          "thinningQuarters": {
            "title": "Thinning threshold (quarters)",
            "minimum": 2,
            "maximum": 40,
            "type": "integer",
            "description": "How many CONSECUTIVE quarters of negative county-wide net branch change are required before a county is flagged with is_branch_desert_signal, for example 3. A quarter with no events at all breaks the streak. Minimum 2.",
            "default": 3
          },
          "replayFullHistory": {
            "title": "Replay full branch history",
            "type": "boolean",
            "description": "When true (recommended) the actor pulls every FDIC branch event ever recorded for the selected states and replays it chronologically, so offices_start, offices_end, is_market_entry and is_market_exit are true running counts. Turn it off for a faster run that only reads the selected window, at the cost of office counts being window-relative and flagged office_count_estimated.",
            "default": true
          },
          "reconcileWithLocations": {
            "title": "Verify against the standing branch list",
            "type": "boolean",
            "description": "When true (recommended) the actor also pulls FDIC's current branch list for these states, so every row carries offices_current (the verified standing branch count today), the metro/micropolitan area, and a reconciliation flag against the event balance. Turn it off for a faster, history-only run; those fields then come back null rather than guessed.",
            "default": true
          },
          "includeRelocations": {
            "title": "Include branch relocations",
            "type": "boolean",
            "description": "When true (recommended) the actor also queries FDIC change code 520 on BOTH endpoints of each move, so a branch relocating out of a county is counted as a loss for that county and a gain for the destination. Turn it off to skip the extra query; relocation fields then come back null.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}