Authentication

All LiveBy API endpoints require an API clientid and token, which are provided by your LiveBy account representative. When calling the LiveBy API, the following HTTP request headers are required:

HTTP Headers

API Requests

All LiveBy API endpoints support either GET or POST requests and return a JSON-formatted response of content-type application/json. Standard HTTP response codes are used to indicate success and error conditions.

When using GET requests, parameters should be sent as standard query parameters in the URL. When using POST requests, parameters should be sent as a JSON-formatted request body.

Example Requests

// Example GET Request
fetch(
  '<https://api.liveby.com/v3/walk-scores?lat=47.6085&lon=-122.3295>',
  {
    headers: {
      'X-API-CLIENTID': 'client-id',
      'X-API-KEY': '...'
    }
  })
  .then(res => res.json())
  .then(console.log)
// Example POST Request
fetch(
  '<https://api.liveby.com/v3/walk-scores>',
  {
    method: 'POST',
    headers: {
      'X-API-CLIENTID': 'client-id',
      'X-API-KEY': '...',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      lat: '47.6085',
      lon: '122.3295'
    })
  })
  .then(res => res.json())
  .then(console.log)

Responses

Success

A successful API response has an HTTP status code of 200 and a JSON-formatted response body. The response object will have the status "success" and a property containing the response objects, for example:

{
    "success": true,
    "message": "scores found for lat=47.6085 & lon=-122.3295",
    "data": {
        "walk": {
            "score": 99,
            "description": "Walker's Paradise"
        },
        "bike": {
            "score": 76,
            "description": "Very Bikeable"
        },
        "transit": {
            "score": 100,
            "description": "Rider's Paradise"
        }
    }
}

Error

An API error response will have an HTTP status code appropriate for the error type. The response object will have the status "error" and a message containing the relevant Error. For example,

{
    "success": false,
    "message": "lat and lon are required",
    "data": {
        "walk": {
            "score": "N/A",
            "description": ""
        },
        "bike": {
            "score": "N/A",
            "description": ""
        },
        "transit": {
            "score": "N/A",
            "description": ""
        }
    }
}

Endpoints

Walk Scores