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

ActiveLibrary[API Development](/categories/api)

palmabit/google-directions
==========================

PHP Wrapper for Google directions API.

0.0.4(10y ago)31212MITHTMLPHP &gt;=5.5.0

Since Nov 15Pushed 10y ago6 watchersCompare

[ Source](https://github.com/Palmabit-IT/google-directions)[ Packagist](https://packagist.org/packages/palmabit/google-directions)[ Docs](https://github.com/Palmabit-IT/google-directions)[ RSS](/packages/palmabit-google-directions/feed)WikiDiscussions master Synced 6d ago

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

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

[](#google-directions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cbbcdef628f5a88a6a9a6a27f6ab5ece922a13ccc6a0bbe9a8809155aee88bf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70616c6d616269742f676f6f676c652d646972656374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palmabit/google-directions)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/babaeb74b7a0cc556b995f6b4d6e5fffc0ae4d719c17a19f4c25ef072eb412c7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f50616c6d616269742d49542f676f6f676c652d646972656374696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Palmabit-IT/google-directions)[![Coverage Status](https://camo.githubusercontent.com/932202e63f813edb7473c0a21fced9ecde8602a9ddeebb7e5fa2e81f7893727a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f50616c6d616269742d49542f676f6f676c652d646972656374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Palmabit-IT/google-directions/code-structure)[![Quality Score](https://camo.githubusercontent.com/1f0e1ba6cfa2e116603986ce542e12a4a1d4b17fa1bc360be09475edc35ea47b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f50616c6d616269742d49542f676f6f676c652d646972656374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Palmabit-IT/google-directions)

PHP Wrapper for Google directions API. For further information see

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 palmabit/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.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Palmabit Srl](https://github.com/Palmabit-IT)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

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 ~0 days

Total

4

Last Release

3925d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f0f7d5e84f32a9208f1c2ccd68555592e276d1fffb73ecfe76451c04786b4e1?d=identicon)[palmabit](/maintainers/palmabit)

---

Top Contributors

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

---

Tags

distancegoogle-directions

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k52](/packages/neuron-core-neuron-ai)[files.com/files-php-sdk

Files.com PHP SDK

2482.9k](/packages/filescom-files-php-sdk)[volcengine/volcengine-php-sdk

119.5k](/packages/volcengine-volcengine-php-sdk)

PHPackages © 2026

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