{
  "openapi": "3.0.1",
  "info": {
    "title": "Code Violations Scraper: Distressed Property & Owner Leads",
    "description": "US code violations and code-enforcement cases from city open-data portals: NYC (HPD, DOB, ECB), Chicago, Los Angeles, San Francisco, Austin, Seattle and 8 more. Address, violation, status, dates, parcel, NYC owner of record. Motivated-seller leads. Export to JSON, CSV or Excel, or via API.",
    "version": "1.0",
    "x-build-id": "eq77SOgtvpTctarTd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyscrape~code-violations-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyscrape-code-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/steadyscrape~code-violations-scraper/runs": {
      "post": {
        "operationId": "runs-sync-steadyscrape-code-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/steadyscrape~code-violations-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-steadyscrape-code-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",
        "properties": {
          "cities": {
            "title": "Cities",
            "minItems": 1,
            "type": "array",
            "description": "The code-enforcement datasets to read, each one newest first. Every row names its dataset, agency and licence. New York publishes three: HPD housing violations, DOB ECB violations (with the respondent and the penalty) and DOB violations; Chicago two: building violations and the hearings of building cases (with the respondent and the fine).",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "chicago-hearings",
                "nyc-hpd",
                "nyc-dob-ecb",
                "nyc-dob",
                "los-angeles",
                "san-francisco",
                "austin",
                "new-orleans",
                "orlando",
                "norfolk",
                "seattle",
                "mesa",
                "cincinnati",
                "montgomery-county-md",
                "cambridge-ma",
                "reading-pa"
              ],
              "enumTitles": [
                "Chicago, IL: Building Violations (Department of Buildings)",
                "Chicago, IL: building code hearings (Administrative Hearings, with respondents and fines)",
                "New York City, NY: HPD Housing Maintenance Code Violations",
                "New York City, NY: DOB ECB Violations (respondent, penalty, balance due)",
                "New York City, NY: DOB Violations (Department of Buildings)",
                "Los Angeles, CA: LADBS Code Enforcement Cases (open and closed)",
                "San Francisco, CA: DBI Notices of Violation",
                "Austin, TX: Code Complaint Cases (Code Department)",
                "New Orleans, LA: Code Enforcement violations (blight and property maintenance)",
                "Orlando, FL: Code Enforcement Cases (with assessed value and homestead)",
                "Norfolk, VA: Neighborhood Quality code enforcement violations",
                "Seattle, WA: Code Complaints and Violations (SDCI)",
                "Mesa, AZ: Code Compliance cases",
                "Cincinnati, OH: Code Enforcement (with Norwood and Blue Ash)",
                "Montgomery County, MD: Housing Code Violations",
                "Cambridge, MA: Housing Code Violations (Inspectional Services)",
                "Reading, PA: Code Violations (with owner-occupied flag)"
              ]
            },
            "default": [
              "chicago",
              "nyc-hpd",
              "los-angeles",
              "austin",
              "seattle"
            ]
          },
          "openedWithinDays": {
            "title": "Opened in the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Violations and cases the city dates in this many days back from today (the day it issued, filed or opened them). \"From\" and \"To\" below replace it.",
            "default": 30
          },
          "openedFrom": {
            "title": "Opened from (optional)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "The first day, YYYY-MM-DD, included. Leave empty to count back from the last day."
          },
          "openedTo": {
            "title": "Opened to (optional)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "The last day, YYYY-MM-DD, included. Empty means today."
          },
          "status": {
            "title": "Status",
            "enum": [
              "any",
              "open",
              "closed"
            ],
            "type": "string",
            "description": "Open cases only, closed ones only, or both. New Orleans publishes no status, so with \"Open\" or \"Closed\" it is not read and a free row says so.",
            "default": "any"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Only violations whose texts (title, description, code, ordinance) hold a word starting with any of these, case aside: \"vacant\", \"roof\", \"unsafe\", \"mold\", \"work without permit\". At most 20.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only violations in these five-digit ZIP codes. Datasets that publish no ZIP code (both Chicago datasets, NYC DOB and DOB ECB, New Orleans, Orlando, Norfolk, Cincinnati, Cambridge, Reading) are not read when this is set, and a free row says so. At most 100.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "addOwner": {
            "title": "Add the owner of record (New York City)",
            "type": "boolean",
            "description": "NYC rows get the lot's owner of record from NYC PLUTO, matched by BBL. A violation delivered with its owner is charged as a violation with owner. Year built, units and assessed value come from PLUTO either way.",
            "default": true
          },
          "maxResultsPerCity": {
            "title": "Max violations per city",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first in each dataset. 0 means no limit.",
            "default": 100
          },
          "maxResults": {
            "title": "Max violations in total",
            "minimum": 0,
            "type": "integer",
            "description": "0 means no limit.",
            "default": 1000
          },
          "maxScannedPerCity": {
            "title": "Max violations scanned per city",
            "minimum": 0,
            "type": "integer",
            "description": "Stops reading a city after this many records when your filters match few of them. 0 means no limit.",
            "default": 20000
          },
          "includeRawRecord": {
            "title": "Include the raw record",
            "type": "boolean",
            "description": "Adds each record as the portal published it (every column) in \"raw\". Off keeps CSV and Excel exports to the normalized columns.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}