{
  "openapi": "3.0.1",
  "info": {
    "title": "Building & Housing Violations Scraper: Code Enforcement Alerts",
    "description": "New building, housing and code enforcement violations from 13 US cities: NYC (HPD, DOB, ECB, NYCHA, LL97, elevators), LA, Chicago, Philadelphia, SF, Seattle, Austin, New Orleans, Orlando, Norfolk, Cincinnati, Montgomery MD, Reading PA. Owner names, fines, ZIP filter. Distressed-property leads.",
    "version": "0.1",
    "x-build-id": "1GdY4aYgOUByddIa0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/radiant_opuntia~code-violations-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-radiant_opuntia-code-violations-alerts",
        "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/radiant_opuntia~code-violations-alerts/runs": {
      "post": {
        "operationId": "runs-sync-radiant_opuntia-code-violations-alerts",
        "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/radiant_opuntia~code-violations-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-radiant_opuntia-code-violations-alerts",
        "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": {
          "jurisdictions": {
            "title": "Cities",
            "type": "array",
            "description": "Which city feeds to search. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "nyc_dob",
                "nyc_dob_safety",
                "nyc_nycha",
                "nyc_oath_dob",
                "chicago",
                "chicago_hearings",
                "sf",
                "seattle",
                "austin",
                "cincinnati",
                "montgomery_md",
                "reading_pa",
                "philadelphia",
                "los_angeles",
                "new_orleans",
                "orlando",
                "norfolk_va"
              ],
              "enumTitles": [
                "New York City (HPD housing violations)",
                "New York City (DOB building violations)",
                "New York City (DOB safety violations: elevators, LL97 emissions, facades)",
                "New York City (NYCHA public housing violations)",
                "New York City (DOB/ECB penalty tickets at OATH: owner, penalty, balance due, hearing date)",
                "Chicago (building violations)",
                "Chicago (building code hearings: respondents, fines, upcoming hearing dates)",
                "San Francisco (DBI notices of violation)",
                "Seattle (code compliance complaints and violations)",
                "Austin (code compliance cases)",
                "Cincinnati (property enforcement complaints)",
                "Montgomery County, MD (housing code violations)",
                "Reading, PA (code violations)",
                "Philadelphia (L&I violations, with owner of record)",
                "Los Angeles (LADBS open code enforcement cases)",
                "New Orleans (code enforcement violations)",
                "Orlando, FL (code enforcement cases)",
                "Norfolk, VA (code violations)"
              ]
            },
            "default": []
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Words in the violation text, e.g. \"mold\", \"rodent\", \"elevator\", \"fire\", \"unsafe\". Leave empty for all."
          },
          "address": {
            "title": "Street / address contains",
            "type": "string",
            "description": "Part of the street or address, e.g. \"broadway\", \"123 main\". Leave empty for all."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only these 5-digit ZIP codes. Chicago (both feeds), Cincinnati, Reading PA, New Orleans, Orlando and Norfolk publish no ZIP in their data and are skipped when this is set (use the address filter for them).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "recordTypes": {
            "title": "Record types",
            "type": "array",
            "description": "violation = a cited violation / notice of violation. complaint = a complaint or service request that may lead to one. Leave empty for both.",
            "items": {
              "type": "string",
              "enum": [
                "violation",
                "complaint"
              ],
              "enumTitles": [
                "Violations / notices of violation",
                "Complaints / service requests"
              ]
            },
            "default": []
          },
          "openOnly": {
            "title": "Open only",
            "type": "boolean",
            "description": "Only violations that are still open (not complied, closed or resolved). New Orleans publishes no status, so its records are left out when this is on.",
            "default": false
          },
          "openedWithinDays": {
            "title": "Opened within last (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Look back window by violation / complaint date. Ignored if a start date is set. NYC alone has thousands of new violations per day, so combine with a ZIP, address or keyword filter.",
            "default": 7
          },
          "startDate": {
            "title": "Start date (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Overrides the look back."
          },
          "endDate": {
            "title": "End date (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Defaults to today."
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip records already returned by an earlier run with the same alert name. Use with a schedule for alerts.",
            "default": false
          },
          "stateKey": {
            "title": "Alert name",
            "type": "string",
            "description": "Name for this alert so several schedules do not share memory, e.g. \"bronx-mold\". Leave empty to derive it from the filters."
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free token from the city data portal for higher rate limits. Not needed for normal use."
          },
          "maxResultsPerJurisdiction": {
            "title": "Max records per city",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Cap per city. With only new on, the next run returns the next batch.",
            "default": 500
          },
          "maxResults": {
            "title": "Max records in total",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Overall cap across cities.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}