{
  "openapi": "3.0.1",
  "info": {
    "title": "NJ Statewide Construction Permits",
    "description": "New Jersey construction permits (public open data, 2.68M records): the single statewide register every NJ municipality files into - permit type, status, use group, fee breakdown, construction cost, square feet, block+lot, municipality, county. Filter by county/type/cost/date or aggregate.",
    "version": "0.0",
    "x-build-id": "gI7WCOc9i28ccIRdp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~nj-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-nj-permits",
        "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~nj-permits/runs": {
      "post": {
        "operationId": "runs-sync-j0401-nj-permits",
        "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~nj-permits/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-nj-permits",
        "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": "Mode",
            "enum": [
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = permits matching your filters (default). aggregate = one count row per group (see groupBy).",
            "default": "rows"
          },
          "status": {
            "title": "Status",
            "enum": [
              "",
              "P",
              "C"
            ],
            "type": "string",
            "description": "Row type: P = Permit (~1.37M), C = Certificate (~1.31M, the sign-off that closes a permit). Blank = both.",
            "default": ""
          },
          "permitType": {
            "title": "Permit type",
            "enum": [
              "",
              "06",
              "04",
              "05",
              "13"
            ],
            "type": "string",
            "description": "06 = Alteration (~2.39M), 04 = New (~113k), 05 = Addition (~65k), 13 = Demolition (~111k). Blank = any.",
            "default": ""
          },
          "useGroup": {
            "title": "Use group",
            "type": "string",
            "description": "ICC use group code: R-5 (residential, ~1.9M), R-3, R-2, B (business), M, A-2, E, U, ... Blank = any.",
            "default": ""
          },
          "certificateType": {
            "title": "Certificate type",
            "type": "string",
            "description": "Certificate type description (fuzzy): Certificate of Approval, Certificate of Occupancy, ... Blank = any.",
            "default": ""
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "County name, e.g. 'BERGEN', 'MONMOUTH' (22 counties). Blank = any.",
            "default": ""
          },
          "municipality": {
            "title": "Municipality",
            "type": "string",
            "description": "Municipality name substring, e.g. 'TOMS RIVER', 'EDISON' (549 municipalities). Blank = any.",
            "default": ""
          },
          "permitNumber": {
            "title": "Permit number",
            "type": "string",
            "description": "Exact permit number.",
            "default": ""
          },
          "block": {
            "title": "Block",
            "type": "string",
            "description": "Local block (parcel key). Combine with lot to pull one parcel's permits.",
            "default": ""
          },
          "lot": {
            "title": "Lot",
            "type": "string",
            "description": "Local lot (parcel key).",
            "default": ""
          },
          "constCostMin": {
            "title": "Construction cost >= ",
            "type": "number",
            "description": "Minimum reported construction cost (USD). ~2.6M rows carry a value."
          },
          "constCostMax": {
            "title": "Construction cost <= ",
            "type": "number",
            "description": "Maximum reported construction cost (USD)."
          },
          "totalFeeMin": {
            "title": "Total permit fee >= ",
            "type": "number",
            "description": "Minimum total permit fee (USD) - the sum of every code fee on the record."
          },
          "totalFeeMax": {
            "title": "Total permit fee <= ",
            "type": "number",
            "description": "Maximum total permit fee (USD)."
          },
          "squareFeetMin": {
            "title": "Square feet >= ",
            "type": "number",
            "description": "Minimum floor area (sq ft). ~150k rows carry a value."
          },
          "squareFeetMax": {
            "title": "Square feet <= ",
            "type": "number",
            "description": "Maximum floor area (sq ft)."
          },
          "issuedFrom": {
            "title": "Permit issued on or after",
            "type": "string",
            "description": "Only rows with a permit date on/after this date (YYYY-MM-DD).",
            "default": ""
          },
          "issuedTo": {
            "title": "Permit issued before",
            "type": "string",
            "description": "Only rows with a permit date before this date (YYYY-MM-DD).",
            "default": ""
          },
          "processedFrom": {
            "title": "Processed on or after",
            "type": "string",
            "description": "Only rows processed by the state on/after this date (YYYY-MM-DD). The source updates roughly monthly, so this tracks the state's own processing.",
            "default": ""
          },
          "processedTo": {
            "title": "Processed before",
            "type": "string",
            "description": "Only rows processed before this date (YYYY-MM-DD).",
            "default": ""
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "county",
              "municipality",
              "status",
              "permitType",
              "permitTypeDescription",
              "useGroup",
              "useGroupDescription",
              "certificateType"
            ],
            "type": "string",
            "description": "Which dimension to aggregate over. county / municipality -> where; permitTypeDescription -> what kind of work; useGroupDescription -> what it is.",
            "default": "county"
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of records pushed in rows mode (0 = up to ~10k per run; each record is metered individually, so there is no per-run charge cap). Aggregate mode returns every group (up to the dimension's cardinality, e.g. 549 municipalities); maxResults applies to rows only.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}