{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC DOB Permits & Violations Scraper",
    "description": "Scrape NYC Department of Buildings (DOB) construction permits and code violations from the public NYC Open Data API. Filter by borough, address, BIN, block/lot, job/permit type, permit status, violation category, and date range.",
    "version": "1.0",
    "x-build-id": "jzX0uM0n0bVgfcZKT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~nyc-dob-permits-violations-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-nyc-dob-permits-violations-scraper",
        "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/crawlerbros~nyc-dob-permits-violations-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-nyc-dob-permits-violations-scraper",
        "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/crawlerbros~nyc-dob-permits-violations-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-nyc-dob-permits-violations-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "permits",
              "permitsByJob",
              "violations",
              "violationsByNumber"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "permits"
          },
          "borough": {
            "title": "Borough",
            "enum": [
              "",
              "MANHATTAN",
              "BROOKLYN",
              "QUEENS",
              "BRONX",
              "STATEN ISLAND"
            ],
            "type": "string",
            "description": "Filter to a single NYC borough (mode=permits / mode=violations).",
            "default": ""
          },
          "houseNumber": {
            "title": "House number",
            "type": "string",
            "description": "Street/house number, e.g. `60` (mode=permits / mode=violations). Combine with `streetName` for an exact address lookup."
          },
          "streetName": {
            "title": "Street name",
            "type": "string",
            "description": "Street name as it appears in DOB records, e.g. `BAY 34 ST` (mode=permits / mode=violations). Case-insensitive."
          },
          "bin": {
            "title": "Building Identification Number (BIN)",
            "type": "string",
            "description": "NYC Building Identification Number, e.g. `3185434` (mode=permits / mode=violations)."
          },
          "block": {
            "title": "Tax block",
            "type": "string",
            "description": "Borough-Block-Lot (BBL) tax block number (mode=permits / mode=violations). Combine with `lot`."
          },
          "lot": {
            "title": "Tax lot",
            "type": "string",
            "description": "Borough-Block-Lot (BBL) tax lot number (mode=permits / mode=violations). Combine with `block`."
          },
          "zipCode": {
            "title": "ZIP code (mode=permits)",
            "type": "string",
            "description": "Filter permits to a single 5-digit NYC ZIP code, e.g. `10013`."
          },
          "jobType": {
            "title": "Job type (mode=permits)",
            "enum": [
              "",
              "A1",
              "A2",
              "A3",
              "DM",
              "NB",
              "SG"
            ],
            "type": "string",
            "description": "Filter by DOB job type classification.",
            "default": ""
          },
          "permitType": {
            "title": "Permit type (mode=permits)",
            "enum": [
              "",
              "AL",
              "DM",
              "EQ",
              "EW",
              "FO",
              "NB",
              "PL",
              "SG"
            ],
            "type": "string",
            "description": "Filter by DOB permit type.",
            "default": ""
          },
          "permitSubtype": {
            "title": "Permit subtype (mode=permits)",
            "enum": [
              "",
              "BL",
              "CH",
              "EA",
              "FA",
              "FB",
              "FN",
              "FP",
              "FS",
              "MH",
              "OT",
              "SC",
              "SD",
              "SF",
              "SH",
              "SP"
            ],
            "type": "string",
            "description": "Filter by the more specific permit subtype (subset of equipment-work / construction-equipment permit types).",
            "default": ""
          },
          "workType": {
            "title": "Work type (mode=permits)",
            "enum": [
              "",
              "BL",
              "CC",
              "EQ",
              "FA",
              "FB",
              "FP",
              "FS",
              "MH",
              "NB",
              "OT",
              "PL",
              "SD",
              "SP"
            ],
            "type": "string",
            "description": "Filter by the DOB-designated work type covered by the permit.",
            "default": ""
          },
          "permitteeLicenseType": {
            "title": "Permittee license type (mode=permits)",
            "enum": [
              "",
              "DM",
              "FS",
              "GC",
              "HI",
              "MP",
              "NW",
              "OB",
              "OW",
              "PE",
              "RA",
              "SI"
            ],
            "type": "string",
            "description": "Filter by the professional license type of the person the permit was issued to.",
            "default": ""
          },
          "ownerBusinessType": {
            "title": "Owner business type (mode=permits)",
            "enum": [
              "",
              "CORPORATION",
              "INDIVIDUAL",
              "PARTNERSHIP",
              "CONDO/CO-OP",
              "OTHER",
              "OTHER GOV'T AGENCY",
              "NYCHA/HHC",
              "NYC AGENCY",
              "NYCHA",
              "HPD",
              "HHC",
              "DCAS",
              "NY STATE",
              "DOE"
            ],
            "type": "string",
            "description": "Filter by the property owner's business type.",
            "default": ""
          },
          "selfCertifiedOnly": {
            "title": "Self-certified only (mode=permits)",
            "type": "boolean",
            "description": "Only emit permits where the filing was self-certified by the applicant (no DOB plan review).",
            "default": false
          },
          "nonProfitOwnerOnly": {
            "title": "Non-profit owner only (mode=permits)",
            "type": "boolean",
            "description": "Only emit permits where the property owner is flagged as a non-profit organization.",
            "default": false
          },
          "permitStatus": {
            "title": "Permit status (mode=permits)",
            "enum": [
              "",
              "IN PROCESS",
              "ISSUED",
              "RE-ISSUED",
              "REVOKED"
            ],
            "type": "string",
            "description": "Filter by current permit status.",
            "default": ""
          },
          "filingStatus": {
            "title": "Filing status (mode=permits)",
            "enum": [
              "",
              "INITIAL",
              "RENEWAL"
            ],
            "type": "string",
            "description": "Filter by whether the permit filing was an initial filing or a renewal.",
            "default": ""
          },
          "residentialOnly": {
            "title": "Residential only (mode=permits)",
            "type": "boolean",
            "description": "Only emit permits flagged as residential work.",
            "default": false
          },
          "dateField": {
            "title": "Date field to filter/sort by (mode=permits)",
            "enum": [
              "filingDate",
              "issuanceDate",
              "expirationDate",
              "jobStartDate"
            ],
            "type": "string",
            "description": "Which permit date column `dateFrom`/`dateTo`/sorting apply to.",
            "default": "filingDate"
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop records before this date. For permits, applies to the field chosen in `dateField`; for violations, applies to the field chosen in `violationDateField`."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop records after this date. For permits, applies to the field chosen in `dateField`; for violations, applies to the field chosen in `violationDateField`."
          },
          "keyword": {
            "title": "Keyword search",
            "type": "string",
            "description": "Full-text search. For permits, matches across permittee/owner names and other text fields (mode=permits). For violations, matches the violation description (mode=violations)."
          },
          "jobNumbers": {
            "title": "Job numbers (mode=permitsByJob)",
            "type": "array",
            "description": "DOB job numbers to fetch all permits for, e.g. `340733647`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "violationCategory": {
            "title": "Violation category (mode=violations)",
            "enum": [
              "",
              "V-DOB VIOLATION - ACTIVE",
              "V*-DOB VIOLATION - DISMISSED",
              "V*-DOB VIOLATION - Resolved",
              "V%-DOB VIOLATION",
              "V%*-DOB VIOLATION - DISMISSED",
              "VW-VIOLATION WORK WITHOUT PERMIT - ACTIVE",
              "VW*-VIOLATION - WORK W/O PERMIT DISMISSED",
              "VP-VIOLATION UNSERVED ECB-ACTIVE",
              "VP*-VIOLATION UNSERVED ECB- DISMISSED",
              "VPW-VIOLATION UNSERVED ECB-WORK WITHOUT PERMIT-ACTIVE",
              "VPW*-VIOLATION UNSERVED ECB-WORK WITHOUT PERMIT-DISMISSED",
              "VH-VIOLATION HAZARDOUS - ACTIVE",
              "VH*-VIOLATION HAZARDOUS DISMISSED",
              "VWH-VIOLATION WORK W/OUT PMT HAZARDOUS - ACTIVE",
              "VWH*-VIOLATION WORK W/OUT PMT HAZARDOUS DISMISSED"
            ],
            "type": "string",
            "description": "Filter by DOB violation category/status.",
            "default": ""
          },
          "violationTypeCode": {
            "title": "Violation type code (mode=violations)",
            "enum": [
              "",
              "7A",
              "7S",
              "A",
              "ACC1",
              "ACH1",
              "ACJ1",
              "AEUHAZ1",
              "B",
              "BENCH",
              "C",
              "CLOS",
              "CMQ",
              "COMPBLD",
              "CS",
              "E",
              "EARCX",
              "EB",
              "EGNCY",
              "EGRADE",
              "ES",
              "EVCAT1",
              "EVCAT5",
              "FISP",
              "FISPFCS",
              "FISPHAZ",
              "FISPNRF",
              "HBLVIO",
              "HVCAT5",
              "HVIOS",
              "IMD",
              "IMEGNCY",
              "JVCAT5",
              "JVIOS",
              "L1198",
              "LANDMK",
              "LANDMRK",
              "LBLVIO",
              "LL10/80",
              "LL10/81",
              "LL1080",
              "LL1081",
              "LL11/98",
              "LL1198",
              "LL16",
              "LL2604",
              "LL2604E",
              "LL2604S",
              "LL41",
              "LL5",
              "LL6291",
              "P",
              "PA",
              "RWNRF",
              "UB",
              "UB*",
              "V*",
              "VCAT1",
              "Z"
            ],
            "type": "string",
            "description": "Filter by DOB violation type code (e.g. elevator, boiler, facade, construction).",
            "default": ""
          },
          "deviceNumber": {
            "title": "Device number (mode=violations)",
            "type": "string",
            "description": "Filter to a specific equipment device number (elevators, boilers), e.g. `5P182`."
          },
          "ecbNumber": {
            "title": "ECB number (mode=violations)",
            "type": "string",
            "description": "Filter to violations linked to a specific Environmental Control Board (ECB) violation number, e.g. `34254160K`. Only ~8% of violations have an associated ECB number."
          },
          "violationDateField": {
            "title": "Violation date field to filter/sort by (mode=violations)",
            "enum": [
              "issueDate",
              "dispositionDate"
            ],
            "type": "string",
            "description": "Which violation date column `dateFrom`/`dateTo`/sorting apply to.",
            "default": "issueDate"
          },
          "violationNumbers": {
            "title": "Violation numbers (mode=violationsByNumber)",
            "type": "array",
            "description": "Exact violation numbers to fetch, e.g. `1391F/03`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sortAscending": {
            "title": "Sort ascending (oldest first)",
            "type": "boolean",
            "description": "By default results are sorted newest-first by date. Enable to sort oldest-first instead.",
            "default": false
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free Socrata app token to raise API rate limits. Get one at https://data.cityofnewyork.us/profile/app_tokens. Not required - the actor works without it."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}