PHPackages                             volk/php-google-matrix-distance-api-client - 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. volk/php-google-matrix-distance-api-client

ActiveLibrary[API Development](/categories/api)

volk/php-google-matrix-distance-api-client
==========================================

Google matrix api for php implementation

1252PHPCI failing

Since Jun 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/olucvolkan/maps-distance-api-php-client)[ Packagist](https://packagist.org/packages/volk/php-google-matrix-distance-api-client)[ RSS](/packages/volk-php-google-matrix-distance-api-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Client for Google Distance Matrix API
=========================================

[](#php-client-for-google-distance-matrix-api)

The Google Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations. The information returned is based on the recommended route between start and end points, as calculated by the Google Maps API, and consists of rows containing duration and distance values for each pair.

Please refer to Google Distance Matrix API documentation for further details on request parameters and response format.

###### Installation

[](#installation)

`composer require volk/php-google-matrix-distance-api-client `

###### Basic Usage

[](#basic-usage)

```
   $distanceMatrix = new DistanceMatrix();

    $distanceMatrix->setOrigins('Vancouver, BC, Canada | Seattle, État de Washington, États-Unis')
        ->setDestinations('San Francisco, Californie | États-Unis,Victoria, BC, Canada')
        ->setUnits(Unit::IMPERIAL);

    $matrixClient = new GoogleMapsMatrixApiClient(self::API_KEY);
    $result = $matrixClient->request($distanceMatrix)->getResults();

            $result->getStatus();
            $result->getDestinationAddresses();
            $result->getOriginAddresses();

            /** @var Item $item */
            foreach ($result->getItems() as $item){

                    $item->getStatus();
                    $item->getDestinationAddress();
                    $item->getOriginAddress();
                    $item->getDistance()->getValue();
                    $item->getDistance()->getUnitValue();
                    $item->getDuration()->getValue();
                    $item->getDuration()->getUnitValue();
            }

```

###### Request Parameters Options

[](#request-parameters-options)

FieldTypeDescriptionRequiredoriginsstringOrigin Point Coordinate or Place NameTruedestinationsstringDestinations Point Coordinate or Place NameTruemodestringTravel Mode (driving,walking etc.)FalselanguagestringResponse LanguageFalseunitstringDistance unitFalsetrafficModelstringTraffic Type (best\_guess,pessimistic)False###### Response Fields

[](#response-fields)

FieldTypeDescriptionstatusstringApi response status type OK , FAILED etc.originAddressesarrayOrigin Addresses listdestinationsAddressesarrayDestinations Addresses listitemsarrayResponse Items###### Response Item Fields

[](#response-item-fields)

FieldTypeDescriptiondistanceobjectDistance unformatted value and unit valuedurationobjectDurations unformatted value and unit valuestatusstringStatus OK , FAILEDoriginAddressstringSingle Origin AddressdestinationAddressstringSingle Destination Address###### Example Response

[](#example-response)

[![example response](https://camo.githubusercontent.com/6501b5688bfa899458eed9a0f62dfbbd5958ce7262b343b879d07e509b449859/68747470733a2f2f696d672e74656368706f77657275702e6f72672f3230303532392f73637265656e2d73686f742d323032302d30352d33302d61742d30302d32392d35392e706e67)](https://camo.githubusercontent.com/6501b5688bfa899458eed9a0f62dfbbd5958ce7262b343b879d07e509b449859/68747470733a2f2f696d672e74656368706f77657275702e6f72672f3230303532392f73637265656e2d73686f742d323032302d30352d33302d61742d30302d32392d35392e706e67)

###### TODO

[](#todo)

- Exception Response Structure must be created

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![olucvolkan](https://avatars.githubusercontent.com/u/13987389?v=4)](https://github.com/olucvolkan "olucvolkan (3 commits)")

---

Tags

google-maps-apimaps-matrix-apiphp-google-maps

### Embed Badge

![Health badge](/badges/volk-php-google-matrix-distance-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/volk-php-google-matrix-distance-api-client/health.svg)](https://phpackages.com/packages/volk-php-google-matrix-distance-api-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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