PHPackages                             preee/google-directions - 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. preee/google-directions

ActiveLibrary[API Development](/categories/api)

preee/google-directions
=======================

PHP Wrapper for Google directions API. Replaces and adds more features to the unmaintained package from Palmabit-IT

v0.0.5(8y ago)01.0kMITPHPPHP &gt;=5.5.0

Since Nov 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/preee/google-directions)[ Packagist](https://packagist.org/packages/preee/google-directions)[ Docs](https://github.com/preee/google-directions)[ RSS](/packages/preee-google-directions/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

Google Directions
=================

[](#google-directions)

[![Build Status](https://camo.githubusercontent.com/3962666101aa0f25ee170de5d14d249d9691d9c84e578565d029d4614399785d/68747470733a2f2f7472617669732d63692e6f72672f70726565652f676f6f676c652d646972656374696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/preee/google-directions)

PHP Wrapper for Google directions API.

NOTE: still considered under development, which means that things might change a lot. If you want to use it anyway, just remember that future releases might contain breaking changes.

Install
-------

[](#install)

Via Composer

```
$ composer require preee/google-directions
```

Usage
-----

[](#usage)

```
$apikey = 'my-google-apikey';
$gd = new Palmabit\GoogleDirections\GoogleDirections($apikey);
```

or

```
GoogleDirections::setApikey($apikey);
$gd = new GoogleDirections();
```

then

```
/*
 * Example of API call:
 * https://maps.googleapis.com/maps/api/directions/json?origin=Milano&destination=Venezia&key=my-google-apikey
 *
 * with a timeout of 40s, defaults to 30s if empty
 */

$direction = $gd
    ->createDirectionAPI()
    ->setTimeout(4000)
    ->setOrigin('Milano')
    ->setDestination('Verona')
    ->call();

/*
 * now you can use all $direction methods
 * see above for detailed lists
 */

//get the status
$status = $direction->getStatus();

//get the distance between Milan and Venice
$distance = $direction->getDistance();

//get summary
$summary = $direction->getSummary();

//get steps
$steps = $direction->getSteps();

//get duration
$duration = $direction->getDuration();
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.6% 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 ~203 days

Total

5

Last Release

3026d ago

### Community

Maintainers

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

---

Top Contributors

[![ceccode](https://avatars.githubusercontent.com/u/1024055?v=4)](https://github.com/ceccode "ceccode (16 commits)")[![preee](https://avatars.githubusercontent.com/u/2489682?v=4)](https://github.com/preee "preee (7 commits)")

---

Tags

distancegoogle-directions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/preee-google-directions/health.svg)

```
[![Health](https://phpackages.com/badges/preee-google-directions/health.svg)](https://phpackages.com/packages/preee-google-directions)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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