PHPackages                             plutuss/laravel-geonames-api - 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. plutuss/laravel-geonames-api

ActiveLibrary[API Development](/categories/api)

plutuss/laravel-geonames-api
============================

The Laravel Geonames API package provides an easy way to integrate the Geonames API into your Laravel application. This package enables developers to effortlessly interact with the Geonames API to retrieve geographic data such as cities, countries, coordinates, time zones, and other location-based information

0.1.3(1y ago)186MITPHPPHP ^8.0|^8.1|^8.2

Since Jul 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/plutuss/geo-laravel)[ Packagist](https://packagist.org/packages/plutuss/laravel-geonames-api)[ RSS](/packages/plutuss-laravel-geonames-api/feed)WikiDiscussions master Synced 1mo ago

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

Installed packages
------------------

[](#installed-packages)

Laravel:
--------

[](#laravel)

- [GitHub](https://github.com/plutuss/geo-laravel).

Note

The Laravel Geonames API package provides an easy way to integrate the Geonames API into your Laravel application. This package enables developers to effortlessly interact with the Geonames API to retrieve geographic data such as cities, countries, coordinates, time zones, and other location-based information.

- Key Features

1. **Geonames API Requests**: Simple method to send requests and handle responses from the Geonames API.
2. **Support for Various Query Types**: Supports all major query types including name searches, reverse geocoding, and more.
3. **Configuration**: Easy setup of API credentials and other parameters through a configuration file.
4. **Laravel Compatibility**: Full integration with the Laravel ecosystem, including support for Service Providers and Facades.

```
 composer require plutuss/geo-names-laravel
```

```
php artisan vendor:publish --provider="Plutuss\GeoNames\Providers\GeoNamesServiceProvider"
```

```
#  .env
GEO_NAMES_USERNAME=user_name
```

Use Facade GeoName
------------------

[](#use-facade-geoname)

```
        $response = GeoName::postalCodeSearchJSONFromName('city_name');

        $response = GeoName::setPostalCode(6600)
            ->setCountryCode('CH')
            ->postalCodeSearchJSONFromName('city_name');

          // OR

        $response = GeoName::setOption([
            'country' => 'CH',
        ])->postalCodeSearchJSONFromName('city_name');
```

```
        $response = GeoName::postalCodeSearchJSONFromPostCode(6600);

        $response = GeoName::setCountryCode('CH')
            ->postalCodeSearchJSONFromPostCode(6600);

          // OR

        $response = GeoName::setOption([
            'country' => 'CH',
        ])->postalCodeSearchJSONFromPostCode('6600');
```

```
     setCountryCode(string $countryCode): static;

     setPostalCode(int $value): static;

     setPostalCodeStartsWith(string $value): static;

     setPlaceName(string $value): static;

     setPlaceNameStartsWith(string $value): static;

     setCountry(string $value): static;

     setCountryBias(string $value): static;

     setMaxRows(int $value): static;

     setStyle(string $value): static;

     setOperator(string $value): static;

     setCharset(string $value): static;

     setIsReduced(bool $value): static;

     setEast(float $value): static;

     setWest(float $value): static;

     setNorth(float $value): static;

     setSouth(float $value): static;

     setLatitude(string $value): static;

     setLongitude(string $value): static;

     setRadius(int $value): static;
```

```
     setOption(array $params): static;
```

```
     searchJSON(string $country): JsonResponse|array|Collection;

     postalCodeSearchJSONFromPostCode(int $postalCode, int $radius = 5, int $maxRows = 10): JsonResponse|array|Collection;

     postalCodeSearchJSONFromName(string $name, int $radius = 5, int $maxRows = 10): JsonResponse|array|Collection;

     findNearbyPostalCodes(int $lat, int $lng): JsonResponse|array|Collection;

     postalCodeCountryInfo(): JsonResponse|array|Collection;

     findNearbyJSON(int $lat, int $lng): JsonResponse|array|Collection;
```

Response
--------

[](#response)

```
     latitude(): mixed;

     getCollectionData(): Collection;

     getArrayData(): array;

     longitude(): mixed;

     placeName(): mixed;

     postalCode(): mixed;

     countryCode(): mixed;

     region(): mixed;

     land(): mixed;

    // The getNestedValue() method retrieves a value
    // from a deeply nested array using "dot" notation
    // $response->getNestedValue('key.array')
     getNestedValue($path, $default = null): mixed;
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

4

Last Release

666d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f212e916c2a0da9c20395e7a542f52f4101ac522f8b2a3a7921769d5936b343?d=identicon)[plutuss](/maintainers/plutuss)

---

Top Contributors

[![plutuss](https://avatars.githubusercontent.com/u/68703752?v=4)](https://github.com/plutuss "plutuss (26 commits)")

---

Tags

apilaravelgeocodinggeolocationcountrieslocationgeographycoordinatesplacescitiesgeonamesgeo-names

### Embed Badge

![Health badge](/badges/plutuss-laravel-geonames-api/health.svg)

```
[![Health](https://phpackages.com/badges/plutuss-laravel-geonames-api/health.svg)](https://phpackages.com/packages/plutuss-laravel-geonames-api)
```

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[igaster/laravel_cities

Seed all countries/cities from geonames.org database. Searchable DB tree, ready to use API &amp; a bonus vue.js component!

17988.7k1](/packages/igaster-laravel-cities)[lwwcas/laravel-countries

A comprehensive package for managing country data in Laravel applications, including multilingual support, geographic coordinates, and detailed metadata for seamless integration with Laravel.

12464.0k](/packages/lwwcas-laravel-countries)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)[jackmartin/laravel-yandex-geocode

Simply service laravel Yandex Geocoding

1016.6k](/packages/jackmartin-laravel-yandex-geocode)

PHPackages © 2026

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