{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "bikewise.org",
  "basePath": "/api",
  "info": {
    "contact": {
      "email": "support@bikeindex.org"
    },
    "description": "<p>This is an API for accessing information about bicycling related incidents. You can find the source code on <a href=\"https://github.com/bikeindex/bikewise\">GitHub</a>.</p>\n",
    "title": "BikeWise API v2",
    "version": "v2",
    "x-origin": {
      "format": "swagger",
      "url": "https://bikewise.org/api/v2/swagger_doc",
      "version": "1.2"
    },
    "x-providerName": "bikewise.org"
  },
  "tags": [
    {
      "description": "Incidents matching parameters",
      "name": "incidents"
    },
    {
      "description": "GeoJSON response for matching incidents",
      "name": "locations"
    }
  ],
  "paths": {
    "/v2/incidents": {
      "get": {
        "description": "\n<p>If you’d like more detailed information about bike incidents, use this endpoint. For mapping, <code>locations</code> is probably a better bet.</p>\n\n<p><strong>Notes on location searching</strong>: <br />\n- <code>proximity</code> accepts an ip address, an address, zipcode, city, or latitude,longitude - i.e. <code>70.210.133.87</code>, <code>210 NW 11th Ave, Portland, OR</code>, <code>60647</code>, <code>Chicago, IL</code>, and <code>45.521728,-122.67326</code> are all acceptable<br />\n- <code>proximity_square</code> sets the length of the sides of the square to find matches inside of. The square is centered on the location specified by <code>proximity</code>. It defaults to 100.</p>\n",
        "operationId": "GET--version-incidents---format-",
        "parameters": [
          {
            "default": 1,
            "description": "<p>Page of results to fetch.</p>\n",
            "format": "int32",
            "in": "query",
            "name": "page",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Number of results to return per page.</p>\n",
            "format": "int32",
            "in": "query",
            "name": "per_page",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>End of period</p>\n",
            "format": "int32",
            "in": "query",
            "name": "occurred_before",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Start of period</p>\n",
            "format": "int32",
            "in": "query",
            "name": "occurred_after",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Only incidents of specific type</p>\n",
            "enum": [
              "crash",
              "hazard",
              "theft",
              "unconfirmed",
              "infrastructure_issue",
              "chop_shop"
            ],
            "in": "query",
            "name": "incident_type",
            "required": false,
            "type": "string"
          },
          {
            "description": "<p>Center of location for proximity search</p>\n",
            "in": "query",
            "name": "proximity",
            "required": false,
            "type": "string"
          },
          {
            "default": 100,
            "description": "<p>Size of the proximity search</p>\n",
            "format": "int32",
            "in": "query",
            "name": "proximity_square",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Full text search of incidents</p>\n",
            "in": "query",
            "name": "query",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "No response was specified"
          }
        },
        "summary": "Paginated incidents matching parameters",
        "tags": [
          "incidents"
        ]
      }
    },
    "/v2/incidents/{id}": {
      "get": {
        "operationId": "GET--version-incidents--id---format-",
        "parameters": [
          {
            "description": "<p>Incident ID</p>\n",
            "format": "int32",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "No response was specified"
          }
        },
        "tags": [
          "incidents"
        ]
      }
    },
    "/v2/locations": {
      "get": {
        "description": "<p><strong>This endpoint behaves exactly like</strong> <code>incidents</code>, but returns a valid geojson <code>FeatureCollection</code> that looks like this:</p>\n\n<pre><code>{\n  type: \"FeatureCollection\",\n  features: [\n    {\n      type: \"Feature\",\n      properties: {\n      id: 4474199,\n      type: \"Theft\",\n      occurred_at: 1428536937\n    },\n      geometry: {\n      type: \"Point\",\n      coordinates: [ -122.6244177, 45.5164386 ]\n    }\n  }\n}\n</code></pre>\n\n<p>It doesn’t paginate. If you pass the <code>all</code> parameter it returns all matches (which can be big, &gt; 4mb), otherwise it returns the 100 most recent.</p>\n\n<p><strong>Go forth and make maps!</strong></p>\n",
        "operationId": "GET--version-locations---format-",
        "parameters": [
          {
            "description": "<p>End of period</p>\n",
            "format": "int32",
            "in": "query",
            "name": "occurred_before",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Start of period</p>\n",
            "format": "int32",
            "in": "query",
            "name": "occurred_after",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Only incidents of specific type</p>\n",
            "enum": [
              "crash",
              "hazard",
              "theft",
              "unconfirmed",
              "infrastructure_issue",
              "chop_shop"
            ],
            "in": "query",
            "name": "incident_type",
            "required": false,
            "type": "string"
          },
          {
            "description": "<p>Center of location for proximity search</p>\n",
            "in": "query",
            "name": "proximity",
            "required": false,
            "type": "string"
          },
          {
            "default": 100,
            "description": "<p>Size of the proximity search</p>\n",
            "format": "int32",
            "in": "query",
            "name": "proximity_square",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Full text search of incidents</p>\n",
            "in": "query",
            "name": "query",
            "required": false,
            "type": "string"
          },
          {
            "description": "<p>Max number of results to return. Defaults to 100</p>\n",
            "format": "int32",
            "in": "query",
            "name": "limit",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Give ‘em all to me. Will ignore limit</p>\n",
            "in": "query",
            "name": "all",
            "required": false,
            "type": "boolean"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "No response was specified"
          }
        },
        "summary": "Unpaginated geojson response",
        "tags": [
          "locations"
        ]
      }
    },
    "/v2/locations/markers": {
      "get": {
        "description": "<p>This behaves exactly like the root <code>locations</code> endpoint, but returns <a href=\"https://github.com/mapbox/simplestyle-spec\">simplestyled markers</a> (<a href=\"https://www.mapbox.com/guides/markers/#simple-style\">mapbox styled markers</a>)</p>\n\n<p><strong>Go forth and make maps!</strong></p>\n",
        "operationId": "GET--version-locations-markers---format-",
        "parameters": [
          {
            "description": "<p>End of period</p>\n",
            "format": "int32",
            "in": "query",
            "name": "occurred_before",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Start of period</p>\n",
            "format": "int32",
            "in": "query",
            "name": "occurred_after",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Only incidents of specific type</p>\n",
            "enum": [
              "crash",
              "hazard",
              "theft",
              "unconfirmed",
              "infrastructure_issue",
              "chop_shop"
            ],
            "in": "query",
            "name": "incident_type",
            "required": false,
            "type": "string"
          },
          {
            "description": "<p>Center of location for proximity search</p>\n",
            "in": "query",
            "name": "proximity",
            "required": false,
            "type": "string"
          },
          {
            "default": 100,
            "description": "<p>Size of the proximity search</p>\n",
            "format": "int32",
            "in": "query",
            "name": "proximity_square",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Full text search of incidents</p>\n",
            "in": "query",
            "name": "query",
            "required": false,
            "type": "string"
          },
          {
            "description": "<p>Max number of results to return. Defaults to 100</p>\n",
            "format": "int32",
            "in": "query",
            "name": "limit",
            "required": false,
            "type": "integer"
          },
          {
            "description": "<p>Give ‘em all to me. Will ignore limit</p>\n",
            "in": "query",
            "name": "all",
            "required": false,
            "type": "boolean"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "No response was specified"
          }
        },
        "summary": "Unpaginated geojson response with simplestyled markers",
        "tags": [
          "locations"
        ]
      }
    }
  }
}
