PHPackages                             survos/geoapify-bundle - 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. survos/geoapify-bundle

ActiveSymfony-bundle[API Development](/categories/api)

survos/geoapify-bundle
======================

Symfony bundle to interact with https://www.geoapify.com/

2.18.18(1w ago)01.3kMITPHPPHP ^8.5

Since Jul 12Pushed 1w ago2 watchersCompare

[ Source](https://github.com/survos/geoapify-bundle)[ Packagist](https://packagist.org/packages/survos/geoapify-bundle)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-geoapify-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (130)Versions (565)Used By (0)

Geoapify Bundle
===============

[](#geoapify-bundle)

Symfony Bundle to access the API at

The geoapify website offers 3000 free lookups per day, and it's very fast and easy to register for an API key. The main purpose of this bundle is to simplify storing the API key in an environment variable and to cache the responses.

First, get an API key at  and add it to .env.local

```
echo "GEOAPIFY_API_KEY=my-api-key" >> .env.local
composer req survos/geoapify-bundle
bin/console debug:config survos_geoapify --format=yaml > config/packages/survos_geoapify.yaml
```

```
# config/packages/survos_geoapify.yaml
survos_geoapify:
  api_key: '%env(GEOAPIFY_API_KEY)%'
```

Fetch strategy (cache/retry)
----------------------------

[](#fetch-strategy-cacheretry)

`GeoapifyService` fetches through `survos/fetch-bundle`'s `PersistentFetcherInterface`, not a raw `HttpClientInterface`. If a lookup looks stale or stuck, this is where to look:

- **Cache:** keyed by the full request URL (including `apiKey`), cached **forever** — until the app calls `forget($url)` or passes `force_fetch: true` — in a SQLite pool at `var/data/fetch_cache.db` (survives `cache:clear` and process restarts). There is no TTL by default, so a bad/empty response for a given lat/lng or query string will keep being served until explicitly forgotten.
- **Retry:** up to 5 attempts, full-jitter exponential backoff (200ms base, 10s cap), on transport errors, HTTP 429, and 5xx — see `ExponentialBackoffRetry` in fetch-bundle.
- **Local `.wip` hosts:** routed through the Symfony CLI local proxy automatically (not applicable to Geoapify's real endpoint, but shared by every fetch-bundle consumer).

Before 2026-08-08 this bundle had its own `CacheInterface`/scoped-HTTP-client wiring, but the cache reference was never actually connected — every lookup was silently uncached. See [survos/mono@ec4f9a06](https://github.com/survos/mono/commit/ec4f9a06).

Trivial but functional application
----------------------------------

[](#trivial-but-functional-application)

Requirements:

- Locally installed PHP 8
- Symfony CLI
- sed (to change /app to / without opening an editor)
- API Key

```
symfony new GeoapifyDemo --webapp && cd GeoapifyDemo
echo "GEOAPIFY_API_KEY=my-api-key" >> .env.local
symfony composer req survos/geoapify-bundle
symfony console make:controller AppController
sed -i "s|/app|/|" src/Controller/AppController.php

cat  templates/app/index.html.twig
{% extends 'base.html.twig' %}
{% block body %}
{% set ip = app.request.clientIp %}
{{ isLocalhost(ip) ? "Localhost has no geolocation, using value from config" }}
Hello, visitor from {{ ipGeolocation(ip).country_name}} )
{{ ipGeolocation(ip)|json_encode(constant('JSON_PRETTY_PRINT')) }}

Powered by Geoapify.com IP geolocation web service.

{% endblock %}
EOF

symfony server:start -d
symfony open:local
```

Notes
-----

[](#notes)

 is a free service that can be used without an API key (up to 60 requests per minute).

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance98

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity78

Established project with proven stability

 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

Recently: every ~14 days

Total

564

Last Release

11d ago

Major Versions

1.6.9 → 2.0.222025-09-28

PHP version history (4 changes)1.5.252PHP ^8.1

1.5.394PHP ^8.3

2.0.22PHP ^8.4

2.10.4PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/21b39551f92ed4143772c622f9e571589c5a72c96ab3c53fe67489ce0d83e806?d=identicon)[tacman1123](/maintainers/tacman1123)

---

Top Contributors

[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (7 commits)")

---

Tags

geolocationIPsymfony6

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/survos-geoapify-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/survos-geoapify-bundle/health.svg)](https://phpackages.com/packages/survos-geoapify-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M430](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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