Bike Index API V2

Bike Index API V2 is deprecated

Please use the current version of the API instead.

The Bike Index is open source. You can view the source code on GitHub—the API is in app/controllers/api/v2 and the tests for it are in spec/api/v2.

If you encounter any errors here (or anywhere on Bike Index), please submit an issue on GitHub.

If you have questions contact admin@bikeindex.org.

This documentation displays the port number in the demo requests - e.g. bikeindex.org:443/api/v2/bikes_search. While this works, it’s unnecessary. You can remove the :443 - e.g. bikeindex.org/api/v2/bikes_search.

This documentation isn’t tested or supported in IE, we recommend you use a different browser

Introduction

The Bike Index API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. JSON will be returned in all responses from the API, including errors.

CORS

Every endpoint on the Bike Index API supports Cross-Origin Resource Sharing (CORS).

The CORS spec allows web applications to make cross domain AJAX calls without using workarounds such as JSONP. For more information about CORS, read this article, or the spec.

Errors

The Bike Index uses HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an error with our servers.

Errors respond with a JSON object with a description of the error under the key error e.g. {"error":"Couldn't find Bike with id=XXXXXX"}.

The word “bike”

We use the work “bike” throughout this documentation to mean anything that is registered (be it a tandem, ice-cream cart or standard bicycle). If we are referring specifically to standard bicycles, we make note of that.

You can view all the types of cycles we accept.

Bike URLs

The HTML pages of Bike Index follow the same pattern as the API - the url for a bike is https://bikeindex.org/bikes/{bike_id}.

Time

Bike Index API V2 displays everything in UTC unix timestamps (integers). All time parameters you send need to use timestamps as well.

Authentication

The Bike Index uses OAuth2. Create an application and use an access token for any requests that need authorization.

Endpoints with Red Stars (*) require an access token with a user to use.

Bike Index API V2 endpoints

 

Your applications: Add an application

You don't have any applications set up! To be able to use the API you will need to create an application and generate an access token.

Add an application here.

This documentation is generated by Swagger.io. To learn more about Swagger and why it's awesome check out Swagger.io.