{
  "openapi": "3.0.1",
  "info": {
    "title": "Code Violation Leads: Property Owners, Fines & Violation Types",
    "description": "Code violations from city open data, filtered by violation type, date range, ZIP and status, with the property owner's name and mailing address. Philadelphia, Detroit, Chicago, Mesa and New York City.",
    "version": "0.0",
    "x-build-id": "33G0OUngy3dEO8ZPh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~code-violation-property-owner-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-code-violation-property-owner-leads",
        "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/scrapebench~code-violation-property-owner-leads/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-code-violation-property-owner-leads",
        "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/scrapebench~code-violation-property-owner-leads/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-code-violation-property-owner-leads",
        "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": [
              "export",
              "lookup"
            ],
            "type": "string",
            "description": "Export: every violation in the cities you pick that matches your filters (dates, violation type, ZIP, owner). Lookup: the violation history of the addresses, parcel numbers or owner names you list.",
            "default": "export"
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Which cities to search. Each city is its own open-data feed. One per line: philadelphia (Philadelphia, PA); detroit (Detroit, MI); chicago (Chicago, IL); mesa (Mesa, AZ); new_york (New York City, NY).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City (single)",
            "type": "string",
            "description": "One city, for saved tasks and API calls that send a single value. Use Cities above for several."
          },
          "lookups": {
            "title": "Lookups (lookup mode)",
            "type": "array",
            "description": "One per line: a street address (1251 N 17th St), a parcel number (Philadelphia OPA account, Detroit parcel ID, Mesa APN, NYC BBL) or an owner's name (Philadelphia and Detroit publish the owner on each violation).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lookup": {
            "title": "Lookup (single)",
            "type": "string",
            "description": "One address, parcel number or owner name, for saved tasks and API calls that send a single value."
          },
          "lastDays": {
            "title": "Last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Violations from the last N days. Empty: the last 30 days in export mode, all time in lookup mode. 0 means all time (large cities hold millions of rows: New York City added about 15,000 in one week). Ignored when a 'From' date is set."
          },
          "dateFrom": {
            "title": "From date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive. Overrides 'Last N days'."
          },
          "dateTo": {
            "title": "To date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive. Empty means up to today."
          },
          "categories": {
            "title": "Violation types",
            "type": "array",
            "description": "Keep only violations of these types (matched on the violation's own wording). Empty means every type. One per line: lawn_weeds (Weeds, grass & overgrowth); trash_junk (Trash, junk & debris); vacant_unsafe (Vacant or unsafe buildings); rental_registration (Rental registration & certificates); elevator (Elevators); fire_safety (Fire safety (sprinklers, alarms, extinguishers)); roof_exterior (Roof & exterior walls); windows_doors (Windows & doors); porch_stairs (Porches, stairs & railings); plumbing (Plumbing & leaks); electrical (Electrical); heating_boiler (Heating, boilers & ventilation); pests (Pests & rodents); lead_mold (Lead paint, mold & asbestos); permits_construction (Permits & construction); vehicles (Vehicles & parking); interior (Interior repairs & paint).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only violations whose description contains any of these words (e.g. sprinkler, demolition). Combined with Violation types: both must match.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zips": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep only these 5-digit ZIP codes. Chicago's feed has no ZIP, so there it comes from the matched property record and rows without an owner match are left out.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "enum": [
              "open",
              "closed",
              "any"
            ],
            "type": "string",
            "description": "Open (still unresolved), closed (complied or dismissed) or any. Empty: open in export mode, any in lookup mode."
          },
          "includeUnfounded": {
            "title": "Include complaints found to be no violation",
            "type": "boolean",
            "description": "Mesa records complaints an inspector found to be no violation, and duplicates; they are left out unless this is on.",
            "default": false
          },
          "unpaidOnly": {
            "title": "Unpaid fines only (Detroit)",
            "type": "boolean",
            "description": "Only tickets with a balance due. Detroit is the city that publishes balances; other cities are skipped with a note when this is on.",
            "default": false
          },
          "propertyTypes": {
            "title": "Property types",
            "type": "array",
            "description": "Keep only these property types, from the property record (Philadelphia and New York City publish it). Rows with no type known are left out when this is set. One per line: residential (Residential); mixed_use (Mixed use); commercial (Commercial); industrial (Industrial); vacant_land (Vacant land); other (Other).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ownerTypes": {
            "title": "Owner types",
            "type": "array",
            "description": "Keep only owners of these kinds, read from the owner's name. One per line: individual (Individual); company (Company (LLC, Inc...)); trust (Trust or estate); government (Government).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "absenteeOnly": {
            "title": "Absentee owners only",
            "type": "boolean",
            "description": "Only owners whose mailing address is somewhere other than the property (another state, another city, or another address in the same city).",
            "default": false
          },
          "withOwnerOnly": {
            "title": "Only rows with an owner",
            "type": "boolean",
            "description": "Leave out violations the actor could not match to an owner.",
            "default": false
          },
          "groupBy": {
            "title": "One row per",
            "enum": [
              "violation",
              "property",
              "owner"
            ],
            "type": "string",
            "description": "Violation: one row per violation. Property: one row per address, with its violation count, types and the list of violations. Owner: one row per owner, with how many properties and violations they have.",
            "default": "violation"
          },
          "minViolations": {
            "title": "Minimum violations (property / owner rows)",
            "minimum": 1,
            "type": "integer",
            "description": "With one row per property or owner: keep only those with at least this many violations in the date range.",
            "default": 1
          },
          "maxResults": {
            "title": "Maximum rows per city",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap for EACH city (and each lookup). Rows are newest first; with one row per property or owner, the most-cited come first.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}