{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC DOB Complaints - Building Complaints & Outcomes",
    "description": "NYC Department of Buildings complaints (3,153,645 rows, 1988-2026): premises, BIN, community board and borough, complaint category with DOB's description, handling unit, disposition and dates. Search, aggregate by category or year, or roll up one building.",
    "version": "0.0",
    "x-build-id": "thg0vj3kBLq6bRV3r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~nyc-dob-complaints/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-nyc-dob-complaints",
        "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~nyc-dob-complaints/runs": {
      "post": {
        "operationId": "runs-sync-j0401-nyc-dob-complaints",
        "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~nyc-dob-complaints/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-nyc-dob-complaints",
        "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",
              "profile",
              "building",
              "codes"
            ],
            "type": "string",
            "description": "rows = complaints (default). aggregate = one row per group; year and month are built from one grouped query over the text date column. profile = the complaint (or the two different complaints that share a number) by complaint number. building = every complaint at one BIN with its summary (bin required). codes = the category and disposition dictionaries with counts.",
            "default": ""
          },
          "complaintNumber": {
            "title": "Complaint number",
            "type": "string",
            "description": "The DOB complaint number, e.g. \"3A43468\" or \"3619872\" (letters are matched upper-case)."
          },
          "bin": {
            "title": "BIN",
            "type": "string",
            "description": "Building Identification Number."
          },
          "zip": {
            "title": "ZIP code",
            "type": "string",
            "description": "Exact 5-digit ZIP code. Accepts ZIP+4 (\"12345-6789\"); matched on the 5-digit core."
          },
          "communityBoard": {
            "title": "Community board",
            "type": "string",
            "description": "Board id as published, e.g. \"302\" (3 = Brooklyn)."
          },
          "borough": {
            "title": "Borough",
            "enum": [
              "",
              "Manhattan",
              "Bronx",
              "Brooklyn",
              "Queens",
              "Staten Island"
            ],
            "type": "string",
            "description": "Derived from the first digit of the community board. 342 rows have no board and no borough.",
            "default": ""
          },
          "specialDistrict": {
            "title": "Special district",
            "type": "string",
            "description": "IBZ, SCD, HY, GC or WC."
          },
          "category": {
            "title": "Category code",
            "type": "string",
            "description": "DOB complaint category, e.g. \"45\" (illegal conversion), \"05\" (permit none), \"4B\". The feed has 197 codes."
          },
          "status": {
            "title": "Status",
            "enum": [
              "",
              "CLOSED",
              "ACTIVE"
            ],
            "type": "string",
            "description": "CLOSED (3,132,790 rows) or ACTIVE (20,855).",
            "default": ""
          },
          "dispositionCode": {
            "title": "Disposition code",
            "type": "string",
            "description": "Exact code, e.g. \"I2\" or \"A8\". 160 codes are published; 159 appear in the feed."
          },
          "dobUnit": {
            "title": "DOB unit contains",
            "type": "string",
            "description": "The unit that handled the complaint: QNS., BKLYN, MAN., BRONX, ST.IS, ELCTR, PLUMB, BOILR, ..."
          },
          "street": {
            "title": "Street contains",
            "type": "string",
            "description": "Case-insensitive substring on the street name, e.g. \"FORDHAM\"."
          },
          "houseNumber": {
            "title": "House number",
            "type": "string",
            "description": "Exact house number as published, e.g. \"320\" or \"87-77\"."
          },
          "year": {
            "title": "Entered year",
            "type": "integer",
            "description": "Exact year, 1988-2026. Sorting is chronological only when a year is set (the source stores dates as text)."
          },
          "month": {
            "title": "Entered month",
            "type": "integer",
            "description": "1-12. Combine with year for a single month."
          },
          "hasDisposition": {
            "title": "Has disposition",
            "enum": [
              "",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "no = 9,069 rows with no disposition code (mostly still active).",
            "default": ""
          },
          "groupBy": {
            "title": "Aggregate dimension",
            "enum": [
              "",
              "category",
              "status",
              "dispositionCode",
              "communityBoard",
              "dobUnit",
              "zip",
              "specialDistrict",
              "borough",
              "year",
              "month"
            ],
            "type": "string",
            "description": "Used only with mode=aggregate. Default category.",
            "default": ""
          },
          "metric": {
            "title": "Aggregate metric",
            "enum": [
              "",
              "count",
              "buildings"
            ],
            "type": "string",
            "description": "count = complaints; buildings = distinct BINs.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "type": "integer",
            "description": "Records delivered in rows mode (default 50, max 5000). building returns the whole building history up to its 5,000 ceiling and profile returns the matching complaint(s) regardless of this value; aggregate and codes ignore it. 0 uses the default 50.",
            "default": 50
          },
          "offset": {
            "title": "Offset",
            "type": "integer",
            "description": "Rows to skip in rows mode (default 0). Use it to page through a filter whose match count is above the 5,000-row run ceiling, e.g. maxResults=5000 with offset=5000 for the second page. Ignored by the other modes.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}