{
  "openapi": "3.0.1",
  "info": {
    "title": "US Code Violations - 15 City Enforcement Systems",
    "description": "Property code violations API: records from 15 US cities in one schema - NYC (HPD, DOB), Chicago, Philadelphia, New Orleans, San Francisco, Baltimore, Cincinnati, Boston, Detroit, Mesa, Norfolk, Austin, Seattle, Columbus, Cleveland. 28 registers; filter by address, ZIP, case, parcel or date.",
    "version": "0.0",
    "x-build-id": "Nh5vGtNEAVki9glwK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~us-code-violations/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-us-code-violations",
        "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~us-code-violations/runs": {
      "post": {
        "operationId": "runs-sync-j0401-us-code-violations",
        "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~us-code-violations/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-us-code-violations",
        "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": {
          "jurisdiction": {
            "title": "Jurisdiction",
            "enum": [
              "nyc",
              "chicago",
              "philly",
              "nola",
              "sf",
              "baltimore",
              "cincinnati",
              "boston",
              "detroit",
              "mesa",
              "norfolk",
              "austin",
              "seattle",
              "columbus",
              "cleveland",
              "all"
            ],
            "type": "string",
            "description": "nyc (default) = NYC HPD housing violations, or DOB building violations (corpus). chicago = building violations or ordinance citations (corpus). philly = L&I violations / investigations / complaints. nola = six code-enforcement corpora. sf = building notices of violation. baltimore = ECB citations. cincinnati = code cases. boston = Public Works or Building violations. detroit = blight tickets / rental / compliance / demolition. mesa = code cases. norfolk = complaint / inspection events. austin = code complaint cases. seattle = code complaints and violations. columbus = code enforcement cases. cleveland = issued building violations. all = every city's default register in one aggregate (mode=aggregate only).",
            "default": "nyc"
          },
          "corpus": {
            "title": "Corpus",
            "enum": [
              "",
              "violations",
              "building",
              "ordinance",
              "investigations",
              "complaints",
              "cases",
              "inspections",
              "hearings",
              "abatements",
              "pipeline",
              "pw",
              "blight",
              "rental",
              "compliance",
              "demolition",
              "dob",
              "citations"
            ],
            "type": "string",
            "description": "Which register inside the jurisdiction. Blank uses that jurisdiction's default. nyc: violations (HPD, default) / dob (DOB building violations). chicago: building (default) / ordinance. philly: violations (default) / investigations / complaints. nola: cases (default) / violations / inspections / hearings / abatements / pipeline. boston: pw (default) / building. detroit: blight (default) / rental / compliance / demolition. Every other jurisdiction has exactly one corpus; naming it is accepted, any other name is rejected.",
            "default": ""
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = matching records, newest source event first (exception: Detroit blight filtered by address or ZIP comes back in source order, because that layer rejects a date sort on a filtered set). aggregate = one count row per group.",
            "default": "rows"
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "status",
              "category",
              "city",
              "zip"
            ],
            "type": "string",
            "description": "Dimension for mode=aggregate. status folds each source's own vocabulary into open / closed / unknown. Not every corpus publishes every dimension; an unavailable one is rejected with the list of available dimensions. With jurisdiction=all, a city that does not publish the dimension - or whose source cannot answer in time - is left out of that run and named in the log, while the rest of the comparison still returns; a filter that a city cannot apply still fails the run.",
            "default": "status"
          },
          "status": {
            "title": "Status",
            "enum": [
              "",
              "open",
              "closed"
            ],
            "type": "string",
            "description": "Normalized case status. Blank returns every status. Corpora that publish no case status (several New Orleans registers, Detroit rental registrations) reject this filter rather than guess.",
            "default": ""
          },
          "address": {
            "title": "Address text",
            "type": "string",
            "description": "Substring match on the street address. Registers that store the address in parts (NYC, San Francisco, Boston) match a house number, a street name or a full address in any order, e.g. '243 EAST 51 STREET' (NYC) or '238 MARKET ST' (Boston). Wildcards are rejected."
          },
          "zip": {
            "title": "ZIP code",
            "type": "string",
            "description": "Exact postal code, on registers that publish one (NYC, Philadelphia, San Francisco, New Orleans cases / hearings / pipeline, Boston, Detroit, Mesa, Austin, Seattle). Accepts ZIP+4 (\"12345-6789\"); matched on the 5-digit core. Chicago, Baltimore, Cincinnati, Norfolk, Columbus, Cleveland and NYC DOB violations have no ZIP field and the filter is rejected for them."
          },
          "caseId": {
            "title": "Case id",
            "type": "string",
            "description": "Exact case number as returned in the `caseId` field (case, docket, citation or complaint number depending on the register)."
          },
          "recordId": {
            "title": "Record id",
            "type": "string",
            "description": "Exact record identifier as returned in the `recordId` field (violation number, ticket number, primary key) - use it to fetch one known row."
          },
          "parcelId": {
            "title": "Parcel / block-lot id",
            "type": "string",
            "description": "Exact parcel key: BBL (NYC HPD), BIN (NYC DOB), OPA parcel (Philadelphia), block/lot written 0293/038 (San Francisco, Baltimore), parcel id (Detroit), parcel number (Mesa, Austin, Columbus, Cleveland), GPIN (Norfolk), GEO_PIN (New Orleans cases / hearings / pipeline)."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) on the jurisdiction's primary date column (opened / filed / inspection date). Inclusive."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) on the same column. Inclusive."
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Records to return in rows mode (default 50). In aggregate mode every group is returned; a dimension with an extreme number of groups fails the run instead of being truncated.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}