Best fares, easy and straightforward integration

Designed with for developers

Authentication

Introduction

In the following pages you will learn how to authenticate with our API.

There are two ways of authenticating: with a GET query parameter or with a header. Both behave exactly the same way, so it's up to you to decide which way suits you best. You will be sending a token that will be provided to you.

If Authentication failed, you'll get a 401 Unauthorized Error Response.

Query Parameter

All you need to do is append the accessToken query parameter to the URL. For example:

$url = 'https://faresapi.com/api/v1/data/routes?accessToken=YourAccessToken';
$json = file_get_contents($url);
$data = json_decode($json, true);
var_dump($data);

// $data will now contain an associative array

In case other query parameters need to be submitted, accessToken goes together with them. Search is an example of that.

Your token is secure because we will never host the API unencrypted.

Please bear in mind though that Google may be collecting your browsing history and accessing the API via the browser for convenience may compromise your API Token with Google and possibly browser plugins that have access to history.