{
  "openapi": "3.0.1",
  "info": {
    "title": "Code Violation Property Leads: Distressed Houses & Owners",
    "description": "Properties just cited for code violations in NYC, LA, Chicago, SF, Austin, Seattle and Cincinnati, one row per property, scored 0 to 100 as distressed leads with open, hazardous and repeat violations, NYC owner. $0.01 each.",
    "version": "0.1",
    "x-build-id": "PRPvjsgRu6i1PUhPQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~code-violation-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-code-violation-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/nerolabs~code-violation-leads/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-code-violation-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/nerolabs~code-violation-leads/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-code-violation-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": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Which city code violation feeds to read: chicago, nyc, los_angeles, san_francisco, austin, seattle, cincinnati. Empty means all 7. Each comes from that city's official open data portal and is updated daily. NYC reads two feeds (HPD housing violations and DOB/ECB building violations) and adds the owner from the city tax lot file.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "nyc",
                "los_angeles",
                "san_francisco",
                "austin",
                "seattle",
                "cincinnati"
              ],
              "enumTitles": [
                "Chicago, IL",
                "New York City, NY (HPD housing + DOB building)",
                "Los Angeles, CA (open cases)",
                "San Francisco, CA",
                "Austin, TX",
                "Seattle, WA",
                "Cincinnati and Hamilton County, OH"
              ]
            }
          },
          "withinDays": {
            "title": "Days to look back",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Violations issued in the last N days (1 to 90). 7 for a weekly alert, 30 for a first list.",
            "default": 30
          },
          "minViolations": {
            "title": "Minimum violations per property",
            "minimum": 1,
            "type": "integer",
            "description": "Only properties cited this many times in the window. 3 or more finds the worst-kept buildings.",
            "default": 1
          },
          "openOnly": {
            "title": "Only properties with open violations",
            "type": "boolean",
            "description": "Skip properties whose violations in the window are all closed or complied.",
            "default": false
          },
          "hazardousOnly": {
            "title": "Only properties with a hazardous violation",
            "type": "boolean",
            "description": "Keep only properties with a top-class violation (NYC HPD class C, NYC DOB class 1, unsafe building flags, emergency or vacate orders, LA vacant or nuisance cases, Cincinnati barricade or demolition).",
            "default": false
          },
          "distressSignals": {
            "title": "Distress signs (any of)",
            "type": "array",
            "description": "Keep only properties showing at least one of these signs, read from the violation text and city flags: vacant, unsafe, fire_damage, foreclosure, demolition, vacate_order, overgrown, trash_debris, no_heat_water, pests, mold_leaks, roof, windows_doors, work_without_permit, lead_paint, rent_impairing, repeat_offender, short_term_rental. Empty keeps all.",
            "items": {
              "type": "string",
              "enum": [
                "vacant",
                "unsafe",
                "fire_damage",
                "foreclosure",
                "demolition",
                "vacate_order",
                "overgrown",
                "trash_debris",
                "no_heat_water",
                "pests",
                "mold_leaks",
                "roof",
                "windows_doors",
                "work_without_permit",
                "lead_paint",
                "rent_impairing",
                "repeat_offender",
                "short_term_rental"
              ]
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only properties in these 5 digit ZIP codes. Empty means the whole city.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (any of)",
            "type": "array",
            "description": "Keep properties whose violation text contains any of these words, for example 'roof', 'boiler', 'vacant'.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop properties whose violation text contains any of these words, for example 'elevator', 'sign'.",
            "items": {
              "type": "string"
            }
          },
          "maxResidentialUnits": {
            "title": "Maximum residential units (NYC)",
            "minimum": 0,
            "type": "integer",
            "description": "NYC only: skip buildings with more homes than this, from the city tax lot file. 4 keeps 1 to 4 family houses for investors. Other cities do not publish units."
          },
          "includeHistory": {
            "title": "Count repeat violations in the last 12 months",
            "type": "boolean",
            "description": "For each property returned, ask the city how many violations it had in the last 365 days. Repeat problems raise the lead score. No extra charge.",
            "default": true
          },
          "includeNycOwner": {
            "title": "Add NYC owner name",
            "type": "boolean",
            "description": "NYC only: owner name, units, year built, building class and assessed value from the city tax lot file (PLUTO). No extra charge.",
            "default": true
          },
          "excludeAddresses": {
            "title": "Skip these properties",
            "type": "array",
            "description": "Addresses or parcel numbers (NYC BBL, Austin parcel ID, LA parcel, SF block/lot) already in your CRM. They are never returned or charged.",
            "items": {
              "type": "string"
            }
          },
          "excludeListUrl": {
            "title": "Skip list URL (CSV or Google Sheet)",
            "type": "string",
            "description": "A CSV or Google Sheet link whose first column holds addresses or parcel numbers to skip. Sheets must be shared as 'Anyone with the link can view'."
          },
          "minLeadScore": {
            "title": "Minimum lead score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only properties scoring at least this (0 to 100). 50 or more is a strong distressed lead.",
            "default": 0
          },
          "maxLeads": {
            "title": "Maximum properties",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Most properties to return, best scored first. You pay only for properties returned.",
            "default": 100
          },
          "monitorMode": {
            "title": "Monitor mode (only new properties)",
            "type": "boolean",
            "description": "Remember properties already returned for this watch name and return only new ones. Schedule it daily or weekly for a fresh lead feed.",
            "default": false
          },
          "watchName": {
            "title": "Watch name",
            "type": "string",
            "description": "Name for this monitor's memory, so different searches do not share one list.",
            "default": "default"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. POSTs the run summary as JSON when the run finishes (in monitor mode only when there are new properties)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}