{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC Solar Permits API - DOB NOW Solar Installations",
    "description": "NYC solar permits as a competitor pipeline: 264 solar permits in the 30 days to 2026-11-19, each one attributed to the firm that filed it, with job cost, address, ZIP and BIN. 24 firms in that window; SUNRUN INSTALLATION SVC busiest with 62. $0.004 per permit.",
    "version": "0.1",
    "x-build-id": "G5bpFafB5Mv8liP5C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themartygriffin~nyc-solar-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themartygriffin-nyc-solar-permits-feed",
        "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/themartygriffin~nyc-solar-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-themartygriffin-nyc-solar-permits-feed",
        "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/themartygriffin~nyc-solar-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-themartygriffin-nyc-solar-permits-feed",
        "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": [
              "backfill",
              "new"
            ],
            "type": "string",
            "description": "'backfill' returns permits approved in the last N days and saves the watermark; it is the default, so a first run returns real results. 'new' returns only permits not reported by an earlier run, re-scanning the previous month for late publishes, and needs saved state - it exits with an empty dataset if you have never run 'backfill'.",
            "default": "backfill"
          },
          "lookback_days": {
            "title": "Lookback days (backfill)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Backfill only. Return permits approved in the last this many days (1 to 365, the same span the Actor remembers reported permits for). The city approves permits on weekdays, so the newest 1-3 days can be missing on a Monday.",
            "default": 30
          },
          "include_already_reported": {
            "title": "Re-report permits already reported (backfill only)",
            "type": "boolean",
            "description": "Backfill only. Controls whether permit lines an earlier run already reported appear in your dataset again. Off (the default): they are left out. On: they are returned again. It never changes what you are charged: a permit is billed once, the first time it is reported, and re-reported permits are free. Permits are remembered for 365 days of approval dates, which covers the longest lookback.",
            "default": false
          },
          "work_types": {
            "title": "Work types (trades)",
            "type": "array",
            "description": "Pre-set to 'Solar'. Empty = every trade, like the full New York feed. Other values: 'General Construction', 'Plumbing', 'Sidewalk Shed', 'Supported Scaffold', 'Mechanical Systems', 'Sprinklers', 'Structural', 'Sign'.",
            "default": [
              "Solar"
            ],
            "items": {
              "type": "string"
            }
          },
          "boroughs": {
            "title": "Boroughs",
            "type": "array",
            "description": "Exact feed values: 'Manhattan', 'Brooklyn', 'Queens', 'Bronx', 'Staten Island'. Empty = all five.",
            "items": {
              "type": "string"
            }
          },
          "zip_codes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes, e.g. 11217. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "applicant_names": {
            "title": "Filing firms",
            "type": "array",
            "description": "Match the firm that filed the permit (applicant_business_name) on any of these text fragments, case-insensitive, e.g. 'SUNRUN', 'SCAFFOLD'. Empty = all firms.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Description keywords",
            "type": "array",
            "description": "Return a permit if its job description contains ANY of these text fragments (case-insensitive), e.g. solar, sidewalk shed, restaurant, boiler. This is a substring match, so 'solar' also matches longer words that contain it.",
            "items": {
              "type": "string"
            }
          },
          "min_job_cost": {
            "title": "Minimum estimated job cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits whose estimated job cost is below this. New York publishes a cost on every permit, so this filter rarely drops a row."
          },
          "max_job_cost": {
            "title": "Maximum estimated job cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits whose estimated job cost is above this."
          },
          "max_results": {
            "title": "Maximum permits per run",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Safety cap on charged (never reported before) permits per run. Default 500, about two months of solar volume. Permits returned again for free do not count.",
            "default": 500
          },
          "state_key": {
            "title": "State name",
            "type": "string",
            "description": "Name of the saved watermark. Use a different name for each filter set you schedule, because 'already reported' is tracked per name. Billing is not per name: a permit is charged once on your account however many state names return it.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}