{
 "openapi": "3.1.0",
 "info": {
  "title": "Nearby Permits API",
  "version": "0.1.0",
  "description": "Building permits by address from US city open data. Free, read-only, no key."
 },
 "servers": [
  {
   "url": "https://nearbypermits.com"
  }
 ],
 "paths": {
  "/v1/cities": {
   "get": {
    "operationId": "listCities",
    "summary": "Supported cities",
    "responses": {
     "200": {
      "description": "Cities"
     }
    }
   }
  },
  "/v1/address": {
   "get": {
    "operationId": "permitsAtAddress",
    "summary": "All permits at a street address",
    "parameters": [
     {
      "name": "city",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "los-angeles",
        "new-york",
        "chicago",
        "san-francisco",
        "seattle",
        "austin",
        "cincinnati",
        "mesa"
       ]
      }
     },
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 120
      },
      "example": "867 N Iliff St"
     }
    ],
    "responses": {
     "200": {
      "description": "Permits with a one-sentence answer and a page URL to cite"
     },
     "400": {
      "description": "Bad input"
     }
    }
   }
  },
  "/v1/permit": {
   "get": {
    "operationId": "getPermit",
    "summary": "One permit by number",
    "parameters": [
     {
      "name": "city",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "los-angeles",
        "new-york",
        "chicago",
        "san-francisco",
        "seattle",
        "austin",
        "cincinnati",
        "mesa"
       ]
      }
     },
     {
      "name": "id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 40
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Permit"
     }
    }
   }
  },
  "/v1/recent": {
   "get": {
    "operationId": "recentPermits",
    "summary": "Newest permits, optionally in one ZIP or district",
    "parameters": [
     {
      "name": "city",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "los-angeles",
        "new-york",
        "chicago",
        "san-francisco",
        "seattle",
        "austin",
        "cincinnati",
        "mesa"
       ]
      }
     },
     {
      "name": "area",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Permits"
     }
    }
   }
  }
 }
}