{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC HPD Housing Complaints - Heat, Plumbing & Sanitation",
    "description": "New York City housing complaints from HPD (public open data, 16.4M records): building and apartment, the reported condition by category and code, the emergency tier, received and closed dates and the outcome. Screen a building by HPD id, or filter by borough, category, type, status, ZIP or date.",
    "version": "0.0",
    "x-build-id": "WNAGELN1Oopurh3eb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~nyc-hpd-complaints/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-nyc-hpd-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-hpd-complaints/runs": {
      "post": {
        "operationId": "runs-sync-j0401-nyc-hpd-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-hpd-complaints/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-nyc-hpd-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": {
          "borough": {
            "title": "Borough",
            "enum": [
              "",
              "BROOKLYN",
              "BRONX",
              "MANHATTAN",
              "QUEENS",
              "STATEN ISLAND"
            ],
            "type": "string",
            "description": "The borough the building is in. Blank = any.",
            "default": ""
          },
          "majorCategory": {
            "title": "Major category",
            "enum": [
              "",
              "HEAT/HOT WATER",
              "HEATING",
              "PLUMBING",
              "PAINT/PLASTER",
              "GENERAL",
              "UNSANITARY CONDITION",
              "ELECTRIC",
              "NONCONST",
              "DOOR/WINDOW",
              "WATER LEAK",
              "APPLIANCE",
              "FLOORING/STAIRS",
              "SAFETY",
              "OUTSIDE BUILDING",
              "ELEVATOR",
              "CONSTRUCTION",
              "LINE OF TRAVEL"
            ],
            "type": "string",
            "description": "The condition category, e.g. HEAT/HOT WATER, PLUMBING, PAINT/PLASTER, UNSANITARY CONDITION. Blank = any.",
            "default": ""
          },
          "type": {
            "title": "Emergency tier",
            "enum": [
              "",
              "EMERGENCY",
              "NON EMERGENCY",
              "IMMEDIATE EMERGENCY",
              "HAZARDOUS",
              "REFERRAL"
            ],
            "type": "string",
            "description": "The complaint's severity tier. Blank = any.",
            "default": ""
          },
          "problemStatus": {
            "title": "Problem status",
            "enum": [
              "",
              "OPEN",
              "CLOSE"
            ],
            "type": "string",
            "description": "OPEN = not yet resolved; CLOSE = resolved. Blank = any.",
            "default": ""
          },
          "complaintStatus": {
            "title": "Complaint status",
            "enum": [
              "",
              "OPEN",
              "CLOSE"
            ],
            "type": "string",
            "description": "OPEN = the complaint is still open; CLOSE = closed. Blank = any.",
            "default": ""
          },
          "unitType": {
            "title": "Unit type",
            "enum": [
              "",
              "APARTMENT",
              "BUILDING-WIDE",
              "BUILDING",
              "PUBLIC AREA",
              "PUBLIC PARTS",
              "B-ROOM"
            ],
            "type": "string",
            "description": "Where the condition was reported: one apartment, a building-wide problem, or a public area. Blank = any.",
            "default": ""
          },
          "zip": {
            "title": "ZIP (contains)",
            "type": "string",
            "description": "Substring match on the ZIP code, e.g. '11206', '104'. Blank = any.",
            "default": ""
          },
          "street": {
            "title": "Street name (contains)",
            "type": "string",
            "description": "Substring match on the street name, e.g. 'BROADWAY', 'GRAND'. Blank = any.",
            "default": ""
          },
          "buildingId": {
            "title": "HPD building id",
            "type": "string",
            "description": "Every complaint on one building by its HPD building id, e.g. '374378'. This is the key that joins the HPD violations table. Blank = any.",
            "default": ""
          },
          "dateFrom": {
            "title": "Received on or after",
            "type": "string",
            "description": "Earliest received date, YYYY-MM-DD. Blank = any.",
            "default": ""
          },
          "dateTo": {
            "title": "Received on or before",
            "type": "string",
            "description": "Latest received date, YYYY-MM-DD. Blank = any.",
            "default": ""
          },
          "recentDays": {
            "title": "Received within the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Only complaints received within the last N days. Cannot be combined with 'Received on or after' (an overlap is rejected). 0 = off.",
            "default": 0
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = complaint records matching your filters (default). aggregate = one count row per group (see groupBy).",
            "default": "rows"
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "majorCategory",
              "minorCategory",
              "borough",
              "type",
              "complaintStatus",
              "problemStatus",
              "unitType",
              "spaceType",
              "nta"
            ],
            "type": "string",
            "description": "Which dimension to aggregate over (mode=aggregate). Blank = majorCategory. Every group is returned - aggregate mode is not cut off by maxResults.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap the number of records pushed in rows mode (0 = default 50; up to 2,000 per run). Each record is metered individually, so there is no per-run charge cap. Aggregate mode returns every group.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}