{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC Building Permits Scraper: DOB NOW Approved Permits",
    "description": "Get NYC DOB NOW approved building permits from NYC Open Data as clean records, one per permit: dates, borough, address, BIN/BBL, work types, job description, estimated cost, contractor and owner business. Filter by date, borough, work type, ZIP. Only-new-or-changed mode for daily feeds.",
    "version": "0.1",
    "x-build-id": "SLVfSrJt1KKVKOD6H"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/humble-echidna~nyc-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-humble-echidna-nyc-building-permits",
        "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/humble-echidna~nyc-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-humble-echidna-nyc-building-permits",
        "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/humble-echidna~nyc-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-humble-echidna-nyc-building-permits",
        "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": {
          "lookbackDays": {
            "title": "Last N days",
            "minimum": 1,
            "maximum": 3660,
            "type": "integer",
            "description": "Search permits issued (or approved, see dateField) in the last N days, counted back from today in UTC. Default 7, minimum 1, maximum 3,660. Ignored when dateFrom is set. DOB publishes once a day, about a day behind, so a short window may be empty on a Monday morning.",
            "default": 7
          },
          "dateFrom": {
            "title": "From date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional start date, YYYY-MM-DD (e.g. 2026-09-01), inclusive. When set, it replaces lookbackDays. The dataset starts in June 2016. Leave empty to use lookbackDays."
          },
          "dateTo": {
            "title": "To date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional end date, YYYY-MM-DD (e.g. 2026-09-30), inclusive. Leave empty for no end (up to the newest permit)."
          },
          "dateField": {
            "title": "Date to filter on",
            "enum": [
              "issued",
              "approved"
            ],
            "type": "string",
            "description": "Which date the date range applies to: `issued` (default, when DOB issued the permit) or `approved` (when the job filing was approved; also covers approved permits not yet issued).",
            "default": "issued"
          },
          "boroughs": {
            "title": "Boroughs",
            "type": "array",
            "description": "Only these boroughs: Manhattan, Bronx, Brooklyn, Queens, Staten Island. Empty (the default) = all five; the form starts with Brooklyn as an example. The source spells boroughs in two cases; both are matched.",
            "items": {
              "type": "string",
              "enum": [
                "Manhattan",
                "Bronx",
                "Brooklyn",
                "Queens",
                "Staten Island"
              ]
            }
          },
          "workTypes": {
            "title": "Work types",
            "type": "array",
            "description": "Only permits whose job includes one of these work types, e.g. General Construction, Plumbing, Full Demolition, Sidewalk Shed, Solar, Structural, Foundation, Mechanical Systems, Sprinklers, Sign, Curb Cut (21 in all; see the list). Empty (the default) = all; the form starts with General Construction as an example. Each permit still lists every work type of its job in workTypes.",
            "items": {
              "type": "string",
              "enum": [
                "Antenna",
                "Boiler Equipment",
                "Construction Fence",
                "Curb Cut",
                "Earth Work",
                "Foundation",
                "Full Demolition",
                "General Construction",
                "Green Roof",
                "Mechanical Systems",
                "Plumbing",
                "Protection and Mechanical Methods",
                "Sidewalk Shed",
                "Sign",
                "Solar",
                "Sprinklers",
                "Standpipe",
                "Structural",
                "Support of Excavation",
                "Supported Scaffold",
                "Suspended Scaffold"
              ]
            }
          },
          "filingReasons": {
            "title": "Filing reasons",
            "type": "array",
            "description": "Only these filing reasons: Initial Permit (a new permit), Renewal Permit Without Changes, Renewal Permit with Changes, No Work Permit. Empty (the default) = all. Use [\"Initial Permit\"] to skip renewals.",
            "items": {
              "type": "string",
              "enum": [
                "Initial Permit",
                "Renewal Permit Without Changes",
                "Renewal Permit with Changes",
                "No Work Permit"
              ]
            }
          },
          "permitStatuses": {
            "title": "Permit statuses",
            "type": "array",
            "description": "Only these statuses: Permit Issued (work may be under way) or Signed-off (work completed and signed off). Empty (the default) = both.",
            "items": {
              "type": "string",
              "enum": [
                "Permit Issued",
                "Signed-off"
              ]
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only permits at these 5-digit ZIP codes, e.g. 11211. Empty (the default) = any. At most 200.",
            "items": {
              "type": "string"
            }
          },
          "bins": {
            "title": "Buildings (BIN)",
            "type": "array",
            "description": "Only permits for these buildings, by DOB's 7-digit Building Identification Number (BIN), e.g. 3429263. Empty (the default) = any. At most 200. Find a BIN on DOB's Building Information Search or NYC's Property Information Portal.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Job description contains",
            "type": "array",
            "description": "Only permits whose job description contains any of these words or phrases, not case sensitive, e.g. \"new building\", \"hotel\", \"solar\". Empty (the default) = any. At most 200.",
            "items": {
              "type": "string"
            }
          },
          "minEstimatedCost": {
            "title": "Minimum estimated job cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits whose job's estimated cost, as filed with DOB, is at least this many US dollars, e.g. 1000000. Empty (the default) = any. Filers' estimates, not verified by DOB."
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed permits since the last run",
            "type": "boolean",
            "description": "Default false. When true, return only permits DOB added or changed since this search's last successful run, each marked changeType new or changed; a re-published permit with no change is skipped and not charged. Remembered in your Apify account per filter set (and monitorName). The first run returns everything in the date range. Schedule it daily.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Optional label that gives this search its own memory for onlyNewOrChanged, e.g. \"brooklyn-gc-daily\". Without it, runs with the same filters share one memory. Use a new name to start a monitor afresh."
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Your own free Socrata app token (sign up at data.cityofnewyork.us, then Developer Settings). Without one, NYC Open Data throttles by IP address from a shared pool, which can slow very large runs; with one, requests are counted against your token. Only ever sent to NYC Open Data, in the X-App-Token request header."
          },
          "maxResults": {
            "title": "Max results per run",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many permits in total. Default 1,000 (about $3), so a run started with no input stays small; raise it for bigger runs, e.g. 5,000 for a week of every permit in NYC or 200,000 for a year. Minimum 1. The run also stops cleanly at the maximum cost per run you set in the run options, whichever comes first. A capped only-new run never loses permits: the next run continues where it stopped.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}