PHPackages                             adrianoalves/google-geolocation - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. adrianoalves/google-geolocation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

adrianoalves/google-geolocation
===============================

Simple, resource saver, framework-agnostic, lightweight and vanilla PHP geolocation service using Google Geo API

1.2(5y ago)111MITPHPPHP &gt;7.2

Since Nov 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/adrianoalves/google-geolocation)[ Packagist](https://packagist.org/packages/adrianoalves/google-geolocation)[ RSS](/packages/adrianoalves-google-geolocation/feed)WikiDiscussions main Synced today

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

google-geolocation
==================

[](#google-geolocation)

##### Resource saving, lightweight, framework-agnostic google geo location services in vanilla PHP

[](#resource-saving-lightweight-framework-agnostic-google-geo-location-services-in-vanilla-php)

### What we can do

[](#what-we-can-do)

1. **Get Latitude and Longitude Coordinates of a Human readable Address with GeoCoder;**
2. **Calculates the distance and time between 2 physical points from its Human readable addresses considering the way and riding mode.**

### Get it started

[](#get-it-started)

#### How to install

[](#how-to-install)

You can clone this repository or use composer to install this package:

```
composer require adrianoalves/google-geolocation
```

Prior to use this package, you need an api key, register as a google developer, create a project with a billing account and generate your api key. To learn more [visit the official google documentation.](https://developers.google.com/maps/documentation/javascript/get-api-key)

- Using the Geocoder

```
// a simplest example
$geoCoder = new \Geolocation\GeoCoder\GeoCoder( 'yoUr-aPiKey-hEre' );
// getting the latitude and longitude of an address
$result = $geoCoder->request( 'Praça da Sé, São Paulo, SP' );
var_dump( $result );
```

- Using the Distance Matrix

```
// same simplest example here
$distanceMatrix = new \Geolocation\DistanceMatrix\DistanceMatrix( 'yoUr-aPiKey-hEre' );
// getting the distance in metrics and the time in seconds from an address to another
$result = $distanceMatrix->request( ['Praça da Sé, São Paulo, SP'], ['Avenida Paulista, 1, São Paulo, SP'] );
var_dump( $result );
```

There is a examples directory where you can learn more about how to use it easily.

*I appreciate any suggestions, critics, comments and bug report, so please let me know.*

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

2

Last Release

2007d ago

### Community

Maintainers

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

---

Top Contributors

[![adrianoalves](https://avatars.githubusercontent.com/u/350381?v=4)](https://github.com/adrianoalves "adrianoalves (5 commits)")

---

Tags

phpgooglegeolocationphp 7PHP7distance matrixgoogle geolocation api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adrianoalves-google-geolocation/health.svg)

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

PHPackages © 2026

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