Bike Index API V3

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

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/v3/search. While this works, it’s unnecessary. You can remove the :443 - e.g. bikeindex.org/api/v3/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 (or vehicles) 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 V3 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 to use.

There is increased rate limiting for unauthenticated requests - including an access token in all requests (even when not required) is a good idea.

Bike Index API V3 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.