Current version: 0.1.6
A stateless geospatial API for consuming applications. The service currently provides application credential management, a read-only administrative address catalog, and provider-backed geocoding. Consumer apps can call the Geo Engine through their backend-for-frontend (BFF), keeping service and provider credentials on the server.
Protected API routes require the consuming application's slug in x-app-id and its credential in x-api-key. Credentials are stored as hashes and can be created, reissued, revoked, or expired using the application command-line entry point. Newly issued secrets are printed once.
The Address API provides read-only access to seeded countries and administrative areas. It supports listing countries and area types, browsing hierarchy, looking up an area with its ancestors, and prefix autocomplete. This catalog is intended for country/region/city and similar dropdowns. It does not provide street or building addresses.
The Geocoding API provides forward geocoding, reverse geocoding, full-address autocomplete, IP geolocation, and timezone lookup. Provider responses are normalized into a shared structure, with source data also available in raw_response_provider for transparency.
Forward, reverse, and full-address autocomplete use the self-hosted OSM dataset by default and call Photon if the local dataset is not configured or temporarily unavailable. A successful local search with no matches returns an empty result and does not call Photon. Use x-provider-key: self-hosted to force local-only lookups, photon-komoot or maplibre to select Photon, or geoapify for Geoapify. IP and timezone continue to use Geoapify and require the existing server-side GEOAPIFY_API_KEY value.
The optional OSM dataset is stored in the existing PostgreSQL database in its own geo_osm schema with PostGIS. Operators can add country, continent, or planet PBF extracts through the seed command. Imports are additive: existing (osm_type, osm_id) records keep their original values and only unseen IDs are inserted.
Google Maps and Mapbox are listed as deferred providers. There is no persistence or cache for geocoding requests.
The Maps API lists provider styles and proxies authenticated Geoapify raster tiles using the existing server-side GEOAPIFY_API_KEY. The keyless OpenFreeMap styles remain the web viewer defaults. The web app's interactive map does not request paid tiles. Private consuming apps can load the catalog and proxy paid tiles through their own BFF. Self-hosted map tiles are deferred.
The web-app/ Next.js project is a documentation site and contains optional copyable React examples. It is not required to consume the API. The Address API and Geocoding API are headless services: client applications can call them through a trusted server/BFF without a map client. A map client such as MapLibre is only needed to render a map, tiles, or pins.
The address picker example handles administrative areas such as regions, cities, and barangays. The map viewer example renders a map and uses the Geocoding API for search and reverse lookup. Clone this repository and copy either folder into a React/Next.js app; both are starting points that can be customized for the consuming app. If a copied component needs adaptation, the service APIs remain independently usable by other clients.
The public documentation site's live examples use the Geo Engine's server-side proxy and only expose allowlisted Address and open-provider Geocoding reads. Health checks, BYOK operations, and paid map tiles are not exposed through the public web app. The browser does not receive the configured Geo Engine origin or server credentials. The web app must keep GEO_ENGINE_BASE_URL, GEO_ENGINE_APP_ID, and GEO_ENGINE_API_KEY in server-only environment variables. A proxy alone does not make a publicly reachable backend private; restrict backend ingress at the hosting network or gateway to trusted services.
The web app's map demo uses keyless open-source map styles. To use Geoapify tiles in a private consuming app, create a provider key through Geoapify MyProjects and keep it server-side. The public interactive demo does not load paid styles.
- Node.js compatible with the repository's TypeScript target
- pnpm, as used by the Makefile
- PostgreSQL configured for the address catalog and application credentials
- PostgreSQL with the
postgisandpg_trgmextensions enabled for self-hosted OSM geocoding - osm2pgsql 2.x on
PATHwhen importing a PBF - Optional Geoapify account API key for Geoapify-backed operations
Copy .env.example to .env and configure the PostgreSQL connection values. The example already includes the provider key settings. Geoapify-backed requests need a real GEOAPIFY_API_KEY. The example placeholder is treated as missing. PHOTON_BASE_URL is an optional endpoint override and defaults to https://photon.komoot.io.
Apply the database migrations:
make run_migrationStart the service:
pnpm start:devThe default local API URL is http://localhost:8000. When SWAGGER_ENABLED=true, interactive API docs are available at http://localhost:8000/docs.
The OSM schema uses the existing DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASS, and DB_SSL settings. It does not need a second database or extra OSM credential variables. The configured database user must be able to create the geo_osm and temporary geo_osm_stage schemas and their tables and indexes during seeding. Enable the postgis and pg_trgm extensions in the existing database before importing. Install osm2pgsql 2.x and add it to PATH so the seed command can run it.
Place an extract such as philippines-latest.osm.pbf in the ignored repository imports/ folder and seed it:
make geocoding_seed file=philippines-latest.osm.pbfPowerShell users without Make can run:
npm run geocoding:seed -- --file philippines-latest.osm.pbfThe same command accepts country, continent, or planet .pbf extracts. The import logs the file checksum, accepted features, inserted rows, existing IDs skipped, and rejected features. An exact checksum is skipped on repeat. A newer file adds new OSM IDs but does not refresh or delete existing rows. See the self-hosted geocoding guide for Windows PostgreSQL/PostGIS/osm2pgsql setup and database extension instructions.
For local development, create the development applications and credentials:
pnpm app -- seed-devThe command prints each new credential once. Use that value as x-api-key with its application slug as x-app-id. Keep these credentials and the Geoapify key in the BFF or other server environment. Do not put them in browser code.
Other application credential commands:
pnpm app -- create <slug> "<name>" <client-type>
pnpm app -- issue <slug>
pnpm app -- revoke <credential-id>
pnpm app -- expire <credential-id>- Address API includes administrative catalog endpoints and Postman/cURL examples.
- Geocoding API includes provider selection, normalized and raw provider response examples, errors, and Postman/cURL requests.
- Maps API covers style catalog and tile endpoints, keyless styles, Geoapify setup, and Postman/cURL requests.
- Web app guide explains local setup, the public examples, and copying the address picker and map viewer into consuming applications.
- Self-hosted Geocoding guide explains the PostGIS dataset and PBF import workflow.
web or mobile client → application BFF → Geo Engine API
The client can render maps with a mapping library such as MapLibre and use the Geo Engine for address search, reverse lookup, IP estimates, and timezone data. Map rendering and basemap tile hosting are separate from this service's geocoding providers. Map tiles have their own provider terms and attribution requirements.