{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC DOB Permits - Building Permits & Contractor Leads",
    "description": "NYC building work permits (public open data, 1M permits, daily): applicant contractor and licence number, type, estimated job cost, owner, work description, filing reason, plus BBL / BIN / block / lot / ZIP / community board and coordinates. Filter by borough, trade, status or date.",
    "version": "0.0",
    "x-build-id": "cVibgk9wcAVuJYXFB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~nyc-dob-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-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/j0401~nyc-dob-permits/runs": {
      "post": {
        "operationId": "runs-sync-j0401-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/j0401~nyc-dob-permits/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "permit",
              "aggregate"
            ],
            "type": "string",
            "description": "search = permits matching your filters (default). permit = one work permit number, or every row under one job filing (needs workPermit or jobFilingNumber). aggregate = one count row per group (see groupBy).",
            "default": "search"
          },
          "keyword": {
            "title": "Keyword in work description",
            "type": "string",
            "description": "Full-text match inside the work description, e.g. 'solar', 'boiler', 'sprinkler'. Blank = any.",
            "default": ""
          },
          "borough": {
            "title": "Borough",
            "enum": [
              "",
              "Manhattan",
              "Brooklyn",
              "Queens",
              "Bronx",
              "Staten Island"
            ],
            "type": "string",
            "description": "One of the five boroughs. Manhattan 389,755, Brooklyn 261,648, Queens 195,118, Bronx 96,800, Staten Island 57,804. Blank = all.",
            "default": ""
          },
          "workType": {
            "title": "Trade / work type",
            "enum": [
              "",
              "General Construction",
              "Plumbing",
              "Sidewalk Shed",
              "Mechanical Systems",
              "Construction Fence",
              "Structural",
              "Sprinklers",
              "Supported Scaffold",
              "Foundation",
              "Sign",
              "Solar",
              "Protection and Mechanical Methods",
              "Suspended Scaffold",
              "Earth Work",
              "Standpipe",
              "Boiler Equipment",
              "Curb Cut",
              "Antenna",
              "Support of Excavation",
              "Full Demolition",
              "Green Roof"
            ],
            "type": "string",
            "description": "Exact trade (21 values). General Construction 209,703, Plumbing 154,206, Sidewalk Shed 110,427, Solar 21,236. Blank = any.",
            "default": ""
          },
          "permitStatus": {
            "title": "Permit status",
            "enum": [
              "",
              "Permit Issued",
              "Signed-off"
            ],
            "type": "string",
            "description": "The feed carries exactly two statuses: Permit Issued 361,957 and Signed-off 639,168. Blank = any.",
            "default": ""
          },
          "filingReason": {
            "title": "Filing reason",
            "enum": [
              "",
              "Initial Permit",
              "Renewal Permit Without Changes",
              "Renewal Permit with Changes",
              "No Work Permit",
              "None"
            ],
            "type": "string",
            "description": "Initial Permit 679,994, Renewal Permit Without Changes 258,355, Renewal Permit with Changes 55,713. Use Initial Permit to isolate first-time work. Blank = any.",
            "default": ""
          },
          "licenseType": {
            "title": "Applicant licence type",
            "enum": [
              "",
              "GC",
              "P",
              "F",
              "S",
              "R",
              "PE",
              "O",
              "RA",
              "PR",
              "N",
              "M"
            ],
            "type": "string",
            "description": "Applicant's licence class. GC (general contractor) 717,284, P (plumbing) 163,355, F (fire suppression) 68,860, S (sign) 26,606, R (rigging) 14,195, PE 4,583. Blank = any.",
            "default": ""
          },
          "applicantBusiness": {
            "title": "Applicant contractor",
            "type": "string",
            "description": "Applicant business name substring, e.g. 'SOLAR', 'BUILDERS'. Names are passed through exactly as the source records them. Blank = any.",
            "default": ""
          },
          "ownerName": {
            "title": "Owner name",
            "type": "string",
            "description": "Property owner name substring. Populated on 98.8% of permits. Blank = any.",
            "default": ""
          },
          "zipCode": {
            "title": "ZIP code",
            "type": "string",
            "description": "Five-digit ZIP, e.g. '10022' (22,241 permits), '11201', '10011'. Blank = any.",
            "default": ""
          },
          "bbl": {
            "title": "BBL (borough-block-lot)",
            "type": "string",
            "description": "Exact 10-digit BBL, e.g. '1010930129'. Identifies one tax lot, so it pulls every permit ever filed against that property. Blank = any.",
            "default": ""
          },
          "issuedFrom": {
            "title": "Issued on or after",
            "type": "string",
            "description": "Permit issue date on or after this date (YYYY-MM-DD) - the daily stream of newly issued work. Blank = any.",
            "default": ""
          },
          "issuedTo": {
            "title": "Issued on or before",
            "type": "string",
            "description": "Permit issue date on or before this date (YYYY-MM-DD). Blank = any.",
            "default": ""
          },
          "recentDays": {
            "title": "Issued in the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Shortcut for fresh permits, e.g. 7 returns permits issued in the last week. Cannot be combined with issuedFrom / issuedTo. 0 = off.",
            "default": 0
          },
          "workPermit": {
            "title": "Work permit number",
            "type": "string",
            "description": "Exact work permit number for mode=permit, e.g. 'S00943521-S6-PL'.",
            "default": ""
          },
          "jobFilingNumber": {
            "title": "Job filing number",
            "type": "string",
            "description": "Exact job filing number for mode=permit, e.g. 'S00943521-S6'. Returns every row raised under that job.",
            "default": ""
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "workType",
              "borough",
              "permitStatus",
              "filingReason",
              "licenseType",
              "zipCode",
              "communityBoard",
              "councilDistrict",
              "issueYear"
            ],
            "type": "string",
            "description": "Which dimension to aggregate over (mode=aggregate). Blank = workType. Every group is returned - aggregate mode is not cut off by maxResults.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of records pushed in search mode (0 = default 50; up to 10,000 per run). Each record is metered individually, so there is no per-run charge cap. Aggregate mode returns every group.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}