{
 "openapi": "3.1.0",
 "info": {
  "title": "Kolaboro registry API",
  "version": "1.0",
  "license": {
   "name": "CC BY 4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "description": "Housing projects read from official registers: promised possession date vs completion certificate, developer track records, district base rates and a delivery-delay risk estimate. Free, no key, CORS open."
 },
 "servers": [
  {
   "url": "https://kolaboro.com"
  }
 ],
 "paths": {
  "/api/v1/registry/{slug}": {
   "get": {
    "summary": "One registry project",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,90}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Project record",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/api/v1/registry/search": {
   "get": {
    "summary": "Search projects by name, developer or district",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 80
      }
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "completed",
        "abandoned"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 50
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matches",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/api/v1/registry/developer/{slug}": {
   "get": {
    "summary": "Developer delivery track record",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,90}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Track record",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/api/v1/registry/area/{slug}": {
   "get": {
    "summary": "District base rates",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,90}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "District stats",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/api/v1/registry/risk": {
   "get": {
    "summary": "Delivery-delay risk estimate from the register (developer and district shrunk toward the national rate)",
    "parameters": [
     {
      "name": "developer",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "area",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Estimate with the counts behind it",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     }
    }
   }
  },
  "/api/v1/registry/badge/{slug}.svg": {
   "get": {
    "summary": "Embeddable SVG badge for a project or developer (dev-<slug>)",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,90}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SVG",
      "content": {
       "image/svg+xml": {}
      }
     }
    }
   }
  },
  "/api/v1/registry/feed.xml": {
   "get": {
    "summary": "Atom feed: newest completion certificates and abandoned projects",
    "responses": {
     "200": {
      "description": "Atom",
      "content": {
       "application/atom+xml": {}
      }
     }
    }
   }
  }
 }
}