{
  "openapi": "3.0.1",
  "info": {
    "title": "US Distressed Property Scraper - Violations & Foreclosures",
    "description": "Scrape US distressed property leads from Socrata open data across Chicago, New York, Seattle and New Orleans. Extract building violations, vacant properties, tax sales and foreclosure records. Supports resume and incremental change tracking for ongoing property monitoring.",
    "version": "1.0",
    "x-build-id": "mj79No19JYOPZNpme"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/abotapi~distressed-us-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-abotapi-distressed-us-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/abotapi~distressed-us-scraper/runs": {
      "post": {
        "operationId": "runs-sync-abotapi-distressed-us-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/abotapi~distressed-us-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-abotapi-distressed-us-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "url"
            ],
            "type": "string",
            "description": "How to discover records. 'search' walks the selected metros (or the dataset override) with your filters. 'url' reads only the links you paste into urls. Pasted links are ignored in search mode; the run log tells you when that happens.",
            "default": "search"
          },
          "metros": {
            "title": "Metro areas",
            "type": "array",
            "description": "Which metro registers to walk, in order. Chicago = building violations, vacant buildings and Cook County tax sales. NYC = building, housing and ECB violations plus tax-lien sales. Seattle = King County foreclosure parcels. New Orleans = sheriff lien-foreclosure sales. Empty = all four metros.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "nyc",
                "seattle",
                "new-orleans"
              ],
              "enumTitles": [
                "Chicago",
                "New York City",
                "Seattle / King County",
                "New Orleans"
              ]
            }
          },
          "datasetId": {
            "title": "Dataset override (optional)",
            "type": "string",
            "description": "Walk exactly one Socrata dataset id (e.g. 22u3-xenr) instead of the metro lists. Pair with Dataset domain when it lives outside New York."
          },
          "datasetDomain": {
            "title": "Dataset domain (optional)",
            "type": "string",
            "description": "Socrata domain for the dataset override, e.g. data.cityofchicago.org."
          },
          "sinceDays": {
            "title": "Only rows newer than N days",
            "minimum": 0,
            "type": "integer",
            "description": "Date-filtered datasets return only rows newer than this many days ago. 0 = no cutoff (walk from the newest row). Small sets (foreclosures, tax sales) ignore fine cutoffs and walk whole."
          },
          "soqlWhere": {
            "title": "Raw SoQL filter ($where)",
            "type": "string",
            "description": "Optional raw SoQL $where clause, ANDed with every walked dataset's own filter, e.g. violation_status = 'OPEN'. Column names are dataset-specific, so with several metros pick a dataset override or a single metro."
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Absolute start of the date window on each dataset's date column. Replaces 'newer than N days' when set. Undated datasets (King County foreclosures) ignore it."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Absolute end of the date window (inclusive). Undated datasets ignore it."
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Which end of each dataset to walk first: newest rows first (default) or oldest rows first.",
            "default": "newest"
          },
          "maxItemsPerDataset": {
            "title": "Max items per dataset (0 = no cap)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each dataset after this many rows, so one big register cannot use up Max items. 0 = no per-dataset cap.",
            "default": 0
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Pasted Socrata links: the API resource (https://<domain>/resource/<id>.json or .csv), the dataset page (/d/<id>, /dataset/<name>/<id>) or the legacy /api/views/<id>/rows.json. Pasted $order, $where, $offset and $limit are honoured. Each link is walked as its own scope. Read in url mode only. The field is pre-filled with one example of every supported shape, so URL mode with the field untouched scrapes those examples.",
            "default": [
              "https://data.cityofnewyork.us/resource/9rz4-mjek.json?$limit=2",
              "https://data.cityofchicago.org/resource/22u3-xenr.json?$limit=2&$offset=2&$order=:id",
              "https://data.cityofchicago.org/resource/22u3-xenr.json?$where=violation_date>'2026-01-01'&$limit=1",
              "https://datacatalog.cookcountyil.gov/resource/55ju-2fs9.json?$limit=1",
              "https://data.kingcounty.gov/resource/nx4x-daw6.json?$limit=1",
              "https://data.nola.gov/resource/d52w-8nva.json?$limit=1",
              "https://data.cityofchicago.org/resource/22u3-xenr.csv?$limit=2",
              "https://data.cityofchicago.org/d/22u3-xenr",
              "https://data.cityofchicago.org/api/views/22u3-xenr/rows.json?$limit=1"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many results total across all metros. Default 50; 0 = no limit (a wide metro can hold hundreds of thousands of rows, so set a number you are happy to pay for).",
            "default": 50
          },
          "maxPages": {
            "title": "Max pages per dataset (0 = unlimited)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each dataset walk after this many API pages. 0 = walk until the natural end. Max items always applies too."
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Connection used for requests. The open data API serves the standard pool; residential exits are used automatically when selected."
          },
          "resumeFromRunId": {
            "title": "Resume from run ID",
            "type": "string",
            "description": "Continue a previous run: only records not already in that run’s dataset are pushed. Leave empty for a fresh run."
          },
          "incrementalMode": {
            "title": "Incremental mode",
            "type": "boolean",
            "description": "Track records across scheduled runs with the same scope: only NEW or UPDATED records are returned (UNCHANGED suppressed), and records that disappear are marked EXPIRED. Mutually exclusive with Resume."
          },
          "emitUnchanged": {
            "title": "Emit unchanged records",
            "type": "boolean",
            "description": "In incremental mode, also return records that did not change (marked UNCHANGED)."
          },
          "emitExpired": {
            "title": "Emit expired records",
            "type": "boolean",
            "description": "In incremental mode, also return records seen previously that no longer appear (marked EXPIRED)."
          },
          "stateKey": {
            "title": "State key (optional)",
            "type": "string",
            "description": "Name for the incremental baseline when you want to share one baseline across different filter variants. Leave empty to derive it from the scope automatically."
          },
          "ignoreFieldsForChanges": {
            "title": "Ignore fields when detecting changes (incremental mode only)",
            "type": "array",
            "description": "Advanced: record fields that should never count as a change (in addition to the built-in ignore list). Example: [\"status\"].",
            "items": {
              "type": "string"
            }
          },
          "mcpConnectors": {
            "title": "Pipe results into your apps (optional)",
            "type": "array",
            "description": "Optionally send a summary of each returned property to connected apps. Authorize a connector under Apify > Settings > Integrations, then select it here. Notion creates a page per record; other connectors receive a best-effort write or digest. Leave empty to skip. Dataset results are unaffected."
          },
          "notionParentPageUrl": {
            "title": "Notion parent page (Notion connector only)",
            "type": "string",
            "description": "URL or ID of the Notion page where record pages should be created. Required for Notion; ignored by other connectors."
          },
          "maxNotifyListings": {
            "title": "Max items to export per connector",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of records written to each connector. Does not affect dataset output.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}