{
  "openapi": "3.0.1",
  "info": {
    "title": "New Certificates of Occupancy (Newly Completed Buildings)",
    "description": "Newly completed buildings from official certificate of occupancy records in New York City, Los Angeles, Seattle and Cambridge MA. New homes, apartments, ADUs, additions and commercial spaces with address, units, value and builder. Leads for movers, ISPs, insurers and home services.",
    "version": "0.0",
    "x-build-id": "fUSAieRunUlQ9Ga36"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/benenjoyscoding~new-certificates-of-occupancy/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-benenjoyscoding-new-certificates-of-occupancy",
        "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/benenjoyscoding~new-certificates-of-occupancy/runs": {
      "post": {
        "operationId": "runs-sync-benenjoyscoding-new-certificates-of-occupancy",
        "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/benenjoyscoding~new-certificates-of-occupancy/run-sync": {
      "post": {
        "operationId": "run-sync-benenjoyscoding-new-certificates-of-occupancy",
        "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": {
          "sources": {
            "title": "Cities",
            "type": "array",
            "description": "Which building departments to read. Leave empty for all of them.",
            "items": {
              "type": "string",
              "enum": [
                "new-york-city",
                "los-angeles",
                "seattle",
                "cambridge-ma"
              ],
              "enumTitles": [
                "New York City, NY",
                "Los Angeles, CA",
                "Seattle, WA",
                "Cambridge, MA"
              ]
            }
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Certificates issued in the last this many days, counting today. Ignored when you set a from date.",
            "default": 30
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Optional start date (YYYY-MM-DD). Overrides Days back."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Optional end date (YYYY-MM-DD). Defaults to today."
          },
          "workTypes": {
            "title": "Kind of work",
            "type": "array",
            "description": "Leave empty for all. Seattle and Cambridge don't say, so their records count as Other.",
            "items": {
              "type": "string",
              "enum": [
                "new-building",
                "addition",
                "alteration",
                "other"
              ],
              "enumTitles": [
                "New building",
                "Addition",
                "Alteration",
                "Other or not stated"
              ]
            }
          },
          "minDwellingUnits": {
            "title": "Minimum homes or apartments",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only buildings with at least this many dwelling units, for example 10 for apartment buildings. 0 keeps everything.",
            "default": 0
          },
          "minValuation": {
            "title": "Minimum construction value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only projects valued at least this much. Published by Los Angeles only, so other cities drop out when this is above 0.",
            "default": 0
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only certificates whose building use, work type, description or builder contains one of these words, for example apartment, commercial, ADU or retail.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep only these 5-digit ZIP codes.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "City, borough or neighborhood",
            "type": "array",
            "description": "Keep only these names (exact, any case). NYC uses the borough (Manhattan is New York) or the neighborhood, such as Elmhurst.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new certificates (for scheduled runs)",
            "type": "boolean",
            "description": "Remember which certificates earlier runs delivered and skip them. Turn this on for a daily or weekly schedule so you only pay for fresh leads.",
            "default": false
          },
          "stateStoreName": {
            "title": "Memory store name",
            "type": "string",
            "description": "Named key-value store that holds the list of certificates already delivered. Use a different name for each schedule that should keep its own memory.",
            "default": "new-certificates-of-occupancy-state"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many certificates in total.",
            "default": 5000
          },
          "maxResultsPerSource": {
            "title": "Max results per city",
            "minimum": 1,
            "type": "integer",
            "description": "Stop reading a city after this many certificates from it.",
            "default": 2000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "A free app token from any Socrata open data portal raises the request rate. Not needed for normal runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}