PHPackages                             tomoehlrich/taxifarefinder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tomoehlrich/taxifarefinder

ActiveLibrary[API Development](/categories/api)

tomoehlrich/taxifarefinder
==========================

A PHP/Laravel wrapper for the TaxiFareFinder API

1.0.1(6y ago)08MITPHPPHP ^7.2CI failing

Since Feb 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/tomoehlrich/taxifarefinder-php)[ Packagist](https://packagist.org/packages/tomoehlrich/taxifarefinder)[ Docs](https://github.com/tomoehlrich/taxifarefinder-php)[ RSS](/packages/tomoehlrich-taxifarefinder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

TaxiFareFinder
==============

[](#taxifarefinder)

This package can retrieve supported cities, taxi businesses and taxi fare information from the [TaxiFareFinder API](https://www.taxifarefinder.com/api.php).

The TaxiFareFinder API key can be requested under .

Installation
------------

[](#installation)

This package can be installed through composer.

```
composer require tomoehlrich/taxifarefinder
```

Laravel installation
--------------------

[](#laravel-installation)

This package can be used for Laravel and non-Laravel projects.

In Laravel 5.5+ the package will make use of the Laravel autoregister feature. In older versions of Laravel you have to manually install the package's service provider and facade.

```
// config/app.php
'providers' => [
    // ...
    TomOehlrich\TaxiFareFinder\TaxiFareFinderServiceProvider::class
];
```

```
// config/app.php
'aliases' => [
	// ...
	'TaxiFareFinder' => TomOehlrich\TaxiFareFinder\Facades\TaxiFareFinder::class,
]
```

Next, you have to publish the config file:

```
php artisan vendor:publish --provider="TomOehlrich\TaxiFareFinder\TaxiFareFinderServiceProvider"
```

The config file contains only one option. Please make sure that your API key is available here.

```
return [

    /*
    |--------------------------------------------------------------------------
    | TaxiFareFinder API Key
    |--------------------------------------------------------------------------
    |
    | The TaxiFareFinder API Key can be requested at
    | https://www.taxifarefinder.com/contactus.php
    |
    */

    'api_key' => env('TAXIFAREFINDER_API_KEY', ''),

];
```

Usage
-----

[](#usage)

First create a new instance of the TaxiFareFinder class.

```
$tff = new TaxiFareFinder('');
```

You can get the nearest city that is supported by the API:

```
return $tff->getNearestCity(1.290270, 103.851959);

/*
  This function returns the following array:

  Array
    (
        [name] => Singapore
        [full_name] => Singapore, Singapore
        [handle] => Singapore
        [locale] => zh_SG
        [distance] => 7747
    )
```

You can get details about a taxi fare.

```
return $tff->getTaxiFare(42.368025,-71.022155, 42.362571,-71.055543);

/*
  This function returns the following array:

  Array
    (
        [total_fare] => 20.61
        [initial_fare] => 2.6
        [metered_fare] => 10.42
        [tip_amount] => 2.69
        [tip_percentage] => 15
        [locale] => en_US
        [currency] => Array
            (
                [int_symbol] => USD
            )

        [rate_area] => Boston, MA
        [flat_rates] => Array
            (
            )

        [extra_charges] => Array
            (
                [0] => Array
                    (
                        [charge] => 2.25
                        [description] => Airport Fee
                    )

                [1] => Array
                    (
                        [charge] => 2.65
                        [description] => Harbor tunnel toll
                    )

            )

        [distance] => 4591.1
        [duration] => 544
    )
```

You can get a list of taxi companies in a city.

```
return $tff->getTaxiCompanies('Ho-Chi-Minh-Vietnam');

/*
  This function returns the following array:

  Array
    (
        [businesses] => Array
            (
                [0] => Array
                    (
                        [name] => DichungTaxi
                        [phone] => 093-607-0416
                        [type] => taxi
                    )

            )

    )
```

In Laravel you can just call

```
return TaxiFareFinder::getNearestCity(1.290270, 103.851959);
```

To catch exceptions you should wrap methods in a try .. catch block.

```
try {
    $fare = $tff->getTaxiFare(42.368025,-71.022155, 42.362571,-71.055543);
} catch(TomOehlrich\TaxiFareFinder\Exceptions\TffException $e) {
    return $e->getMessage();
} catch(\Exception $e) {
    return $e->getMessage();
}
```

This package comes with a couple of tests. Just enter your API key in tests/TestCase.php and run

```
composer test
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Total

2

Last Release

2258d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc741e6bed6e524b1ed96786beb683338f7f17f0e0d0bc706eaeebe265f87007?d=identicon)[tomoehlrich](/maintainers/tomoehlrich)

---

Top Contributors

[![tomoehlrich](https://avatars.githubusercontent.com/u/12120042?v=4)](https://github.com/tomoehlrich "tomoehlrich (2 commits)")

---

Tags

laravelphptaxifarefinderphplaraveltaxifarefindertaxi fare

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tomoehlrich-taxifarefinder/health.svg)

```
[![Health](https://phpackages.com/badges/tomoehlrich-taxifarefinder/health.svg)](https://phpackages.com/packages/tomoehlrich-taxifarefinder)
```

###  Alternatives

[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[madeitbelgium/wordpress-php-sdk

WordPress Laravel PHP SDK

4422.9k1](/packages/madeitbelgium-wordpress-php-sdk)[gufy/whmcs

WHMCS API for Laravel 5

201.7k](/packages/gufy-whmcs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
