{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC Building Permits API (DOB NOW) – Contractor Leads",
    "description": "NYC DOB NOW building permits API: construction leads with permittee business, license, estimated cost, coordinates and trade tags (plumbing, HVAC, GC). Permit data CSV/JSON. Renewals excluded.",
    "version": "0.4",
    "x-build-id": "RGqyCeeg25aCLQWXr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/implementable_antler~nyc-dob-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-implementable_antler-nyc-dob-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/implementable_antler~nyc-dob-permits/runs": {
      "post": {
        "operationId": "runs-sync-implementable_antler-nyc-dob-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/implementable_antler~nyc-dob-permits/run-sync": {
      "post": {
        "operationId": "run-sync-implementable_antler-nyc-dob-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": {
          "days": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 366,
            "type": "integer",
            "description": "How many days back from today to include, by permit issue date (1-366).",
            "default": 7
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Only return permits tagged with at least one of these trades. Leave empty for all trades. Electrical, solar and elevator are not offered: this DOB NOW dataset excludes Electrical, Elevator and LAA permits (DOB publishes those separately).",
            "items": {
              "type": "string",
              "enum": [
                "demolition",
                "excavation/sitework",
                "concrete",
                "framing",
                "roofing",
                "siding/exterior",
                "windows/doors",
                "plumbing",
                "HVAC",
                "fire/life-safety",
                "fencing",
                "signage",
                "drywall/interior",
                "utilities",
                "general contracting",
                "masonry/facade",
                "landscaping",
                "decks/porches",
                "scaffolding/sidewalk shed",
                "hoisting/protection",
                "structural/steel",
                "telecom",
                "administrative/no work"
              ]
            },
            "default": []
          },
          "explicitTradesOnly": {
            "title": "Explicit trades only",
            "type": "boolean",
            "description": "When filtering by trade, match only trades stated by the permit type, a listed contractor role or the description, and ignore 'implied' tags (e.g. roofing implied by a new house). On by default for lead generation; turn off to include implied new-build trades.",
            "default": true
          },
          "boroughs": {
            "title": "Boroughs",
            "type": "array",
            "description": "Limit to these boroughs (filtered at the source). Empty = all five.",
            "items": {
              "type": "string",
              "enum": [
                "Manhattan",
                "Brooklyn",
                "Queens",
                "Bronx",
                "Staten Island"
              ]
            },
            "default": []
          },
          "excludeRenewals": {
            "title": "Exclude renewals",
            "type": "boolean",
            "description": "Skip permit renewals/reinstatements (often old jobs re-issued). Recommended for lead generation.",
            "default": true
          },
          "excludeStaleApprovals": {
            "title": "Exclude stale approvals",
            "type": "boolean",
            "description": "Skip permits whose approvedDate is before 2025-01-01 (old jobs only now being issued). Default on.",
            "default": true
          },
          "dateFrom": {
            "title": "Issued from (optional)",
            "type": "string",
            "description": "Earliest issue date, YYYY-MM-DD. When set, overrides 'Days back'."
          },
          "dateTo": {
            "title": "Issued to (optional)",
            "type": "string",
            "description": "Latest issue date, YYYY-MM-DD. Defaults to today."
          },
          "minValuation": {
            "title": "Minimum valuation (USD, optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with a declared valuation at or above this amount. Rows with no or zero valuation are dropped when this is set (note: many NYC sub-permits such as Foundation, Structural, Standpipe and Scaffold carry $0 because the cost sits on the parent GC permit)."
          },
          "excludeNonBuilding": {
            "title": "Exclude non-building records",
            "type": "boolean",
            "description": "Skip administrative and non-building records (administrative changes, reinstatement-only and similar no-work records).",
            "default": true
          },
          "dedupePermits": {
            "title": "One row per permit",
            "type": "boolean",
            "description": "DOB lists one line per work type on the same permit. On (default): one row per permit ID, with all work types in workTypes and merged trades. Off: one row per permit line.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum number of records to return (1-50,000).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}