{
  "openapi": "3.0.1",
  "info": {
    "title": "HMDA Mortgage Lending Data - Loan-Level Records",
    "description": "The CFPB's public HMDA loan-level register (2018-2025): lender LEI, county, census tract, loan amount, interest rate, action taken, loan type and purpose, race, ethnicity, sex, denial reasons and tract demographics. One state or county slice per query; search or aggregate by a chosen dimension.",
    "version": "0.0",
    "x-build-id": "biahzv5cK4VEDvNVh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~hmda-mortgage-lending/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-hmda-mortgage-lending",
        "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/j0401~hmda-mortgage-lending/runs": {
      "post": {
        "operationId": "runs-sync-j0401-hmda-mortgage-lending",
        "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/j0401~hmda-mortgage-lending/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-hmda-mortgage-lending",
        "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": {
          "year": {
            "title": "Activity year",
            "type": "integer",
            "description": "HMDA activity year, 2018-2025.",
            "default": 2024
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Two-letter USPS state code. Required: the API only exports a state or county slice. The default query uses Delaware.",
            "default": "DE"
          },
          "county": {
            "title": "County FIPS",
            "type": "string",
            "description": "Optional 5-digit FIPS county code (e.g. \"48201\" for Harris County, TX). Overrides state as the slice selector."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "search",
              "aggregate"
            ],
            "type": "string",
            "description": "search = matching loan records. aggregate = one row per group. Leave blank: aggregate when groupBy is set, otherwise search."
          },
          "groupBy": {
            "title": "Group by (aggregate)",
            "enum": [
              "",
              "actionTaken",
              "loanType",
              "loanPurpose",
              "race",
              "ethnicity",
              "sex",
              "stateCode",
              "countyCode",
              "lenderLei",
              "denialReason1",
              "applicantAge",
              "dwellingCategory",
              "purchaserType",
              "constructionMethod",
              "totalUnits",
              "activityYear"
            ],
            "type": "string",
            "description": "Dimension for mode=aggregate. Defaults to loanPurpose."
          },
          "maxResults": {
            "title": "Max records",
            "type": "integer",
            "description": "Records to deliver in search mode (default 50, max 25000).",
            "default": 50
          },
          "actionTaken": {
            "title": "Action taken",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8"
            ],
            "type": "string",
            "description": "1 originated, 2 approved not accepted, 3 denied, 4 withdrawn, 5 incomplete, 6 purchased loan, 7 preapproval denied, 8 preapproval approved not accepted."
          },
          "loanType": {
            "title": "Loan type",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4"
            ],
            "type": "string",
            "description": "1 Conventional, 2 FHA, 3 VA, 4 USDA/RHS."
          },
          "loanPurpose": {
            "title": "Loan purpose",
            "enum": [
              "",
              "1",
              "2",
              "31",
              "32",
              "4",
              "5"
            ],
            "type": "string",
            "description": "1 home purchase, 2 home improvement, 31 refinancing, 32 cash-out refinancing, 4 other, 5 not applicable."
          },
          "constructionMethod": {
            "title": "Construction method",
            "enum": [
              "",
              "1",
              "2"
            ],
            "type": "string",
            "description": "1 site-built, 2 manufactured home."
          },
          "totalUnits": {
            "title": "Total units",
            "type": "string",
            "description": "One or more of 1, 2, 3, 4, 5-24, 25-49, 50-99, 100-149, >149 (comma separated)."
          },
          "lenderId": {
            "title": "Lender LEI",
            "type": "string",
            "description": "Exact 20-character lender LEI, e.g. \"254900NZOY3XB2DNSZ34\". Applied while streaming."
          },
          "censusTract": {
            "title": "Census tract",
            "type": "string",
            "description": "11-digit census tract code. Applied while streaming."
          },
          "race": {
            "title": "Derived race",
            "type": "string",
            "description": "Exact derived race label, e.g. \"Black or African American\", \"White\", \"Asian\", \"Joint\", \"Race Not Available\"."
          },
          "ethnicity": {
            "title": "Derived ethnicity",
            "type": "string",
            "description": "Exact derived ethnicity label, e.g. \"Hispanic or Latino\", \"Not Hispanic or Latino\"."
          },
          "sex": {
            "title": "Derived sex",
            "type": "string",
            "description": "Exact derived sex label: \"Male\", \"Female\", \"Joint\", \"Sex Not Available\"."
          },
          "denialReason": {
            "title": "Denial reason",
            "type": "string",
            "description": "Denial reason code 1-10 (matched against denial_reason 1-4)."
          },
          "minAmount": {
            "title": "Minimum loan amount",
            "type": "number",
            "description": "Minimum loan amount in dollars (0 = no minimum).",
            "default": 0
          },
          "maxAmount": {
            "title": "Maximum loan amount",
            "type": "number",
            "description": "Maximum loan amount in dollars (0 = no maximum).",
            "default": 0
          },
          "minInterestRate": {
            "title": "Minimum interest rate",
            "type": "number",
            "description": "Minimum interest rate percent (0 = no minimum).",
            "default": 0
          },
          "maxInterestRate": {
            "title": "Maximum interest rate",
            "type": "number",
            "description": "Maximum interest rate percent (0 = no maximum).",
            "default": 0
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}