{
  "openapi": "3.0.1",
  "info": {
    "title": "Minneapolis Building Permits Scraper — Contractor Leads",
    "description": "Find contractor and construction leads from Minneapolis building permits: ~409k permits since 2016 from official city open data, refreshed daily, with contractor, valuation, address, ward and lat/long. Filter by contractor, ward or neighborhood; onlyNew skips repeats. $0.004/permit, no start fee.",
    "version": "0.1",
    "x-build-id": "Ti3tDM576gtlX6IME"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parallelstudio~twin-cities-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parallelstudio-twin-cities-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/parallelstudio~twin-cities-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-parallelstudio-twin-cities-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/parallelstudio~twin-cities-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-parallelstudio-twin-cities-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": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Which city feeds to query. Minneapolis is live and updated daily. St. Paul's official open-data feed ends June 30, 2025, so it's for history only: pair it with a large daysBack (e.g. 3650).",
            "items": {
              "type": "string",
              "enum": [
                "Minneapolis",
                "St. Paul"
              ],
              "enumTitles": [
                "Minneapolis (live, refreshed daily)",
                "St. Paul (history Jul 2015 to Jun 2025)"
              ]
            },
            "default": [
              "Minneapolis"
            ]
          },
          "daysBack": {
            "title": "Issued in last N days",
            "type": "integer",
            "description": "Issued in last N days. Use 3650 for full history back to Dec 2016.",
            "default": 14
          },
          "minValue": {
            "title": "Minimum permit value ($)",
            "type": "integer",
            "description": "Minimum permit value ($)",
            "default": 0
          },
          "permitTypes": {
            "title": "Permit types (Res, Comm...) empty = all",
            "type": "array",
            "description": "Minneapolis codes such as Res, Commercial, Plumbing, Mechanical (empty = all). For St. Paul each term matches permit category or work type text, so Res matches Residential and Plumbing matches Plumbing permits.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "workTypes": {
            "title": "Work types (New, Addition, Remodel, Misc...)",
            "type": "array",
            "description": "Minneapolis codes such as New, Addition, Remodel, Misc, RoofWind (empty = all). For St. Paul each term matches work type text, e.g. New or Remodel.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword in description",
            "type": "string",
            "description": "Keyword in description"
          },
          "contractorSearch": {
            "title": "Contractor name contains",
            "type": "string",
            "description": "Case-insensitive 'contains' match on the contractor/applicant name, e.g. Roofing or a company name. Leave empty for all contractors."
          },
          "wards": {
            "title": "Wards",
            "type": "array",
            "description": "Only permits in these city wards, e.g. 13 or 7 (empty = all). Works for Minneapolis and St. Paul.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "neighborhoods": {
            "title": "Neighborhoods (Minneapolis)",
            "type": "array",
            "description": "Minneapolis only: case-insensitive 'contains' match on neighborhood name, e.g. Linden Hills (empty = all). Ignored for St. Paul.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxItems": {
            "title": "Max results (per city)",
            "type": "integer",
            "description": "Cap on results, applied separately to each city.",
            "default": 500
          },
          "onlyNew": {
            "title": "Only new permits since last run",
            "type": "boolean",
            "description": "Incremental mode for scheduled runs: permits already returned by an earlier run with the same filters are skipped before they are output, so you are not charged for repeats. State is kept in the named key-value store 'twin-cities-permits-state' (last 50,000 permits per filter set; daysBack and maxItems don't affect it).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}