DEV Community

Christian Apeku
Christian Apeku

Posted on

How to Get Routing, Geocoding and Real-Time Maps With Zero API Keys

TL;DR: Navigatr is a JavaScript SDK that gives you routing, geocoding, and interactive maps without API keys or billing. It works by making requests directly from users' browsers to public OpenStreetMap infrastructure.

It Started With a Tweet
Earlier this year, a Chowdeck customer complained on X, they couldn't track their delivery in real time. The replies filled up fast with developers explaining why: Google Maps API is simply too expensive for African startups to run at scale.
I replied with what I knew from having done it before:

tweet
The tweet got 5.9K views. People asked the same thing: is there a package for this?
There wasn't. So I built one.
navigatr home screen

The Problem
If you've ever built a location-based app, you know the drill:

  1. Sign up for Google Maps
  2. Add a credit card
  3. Watch your bill grow with every user

Google Maps charges $7 per 1,000 routes and $5 per 1,000 geocodes. For a delivery app doing 100K orders/month, that's $1,200/month minimum just for maps.
For a Lagos or Accra startup still finding product market fit, that's not a maps bill. That's a hiring decision. A runway decision.
And then there's the rate limiting, the ToS changes, and the vendor lock-in.

The Idea
What if we could use the same underlying data Google uses OpenStreetMap but skip the middleman entirely?
OSM has free, public APIs:

Valhalla for routing (turn-by-turn directions, ETAs)
Nominatim for geocoding (address → coordinates)
Photon for autocomplete
OpenFreeMap for map tiles

The catch? These are meant for distributed use. You can't hammer them from a single server IP.
But what if every request came from a different IP?

The Architecture
Navigatr is a client-side SDK. When your user needs a route, the request goes directly from their browser to the public infrastructure not through your backend.

Traditional (Google Maps):
User → Your Server → Google → $$$ Bill

Navigatr (Distributed):
User A → Public APIs
User B → Public APIs
User C → Public APIs

With 10,000 users, you have 10,000 different IPs making requests. Each user has their own rate limit quota. Your server never touches the maps API.
Zero infrastructure. Zero cost. Zero API keys.

The Code

shell
npm install @navigatr/web
Enter fullscreen mode Exit fullscreen mode
javascript
import { Navigatr } from '@navigatr/web'

const nav = new Navigatr()
const map = nav.map({ container: 'map', center: { lat: 5.6037, lng: -0.1870 } })

const origin = await nav.geocode({ address: 'Accra Mall, Ghana' })
const destination = await nav.geocode({ address: 'Kotoka Airport, Ghana' })

const route = await nav.route({ origin, destination })
map.drawRoute(route.polyline)

console.log(route.durationText) // "12 mins"
console.log(route.distanceText) // "8.2 km"
Enter fullscreen mode Exit fullscreen mode

No API key. No billing. Just maps.

Built for Delivery & Ride-Sharing
Navigatr includes first-class support for the workflows that sparked it:

const ride = nav.createRide({
  pickup: riderLocation,
  destination: airportCoords,
  map,
  onETAUpdate: (eta, phase) => {
    showETA(eta.durationText)
  }
})

await ride.startPickup(driverLocation)

websocket.on('driver-location', (pos) => {
  ride.updateDriverLocation(pos)
})

await ride.startTrip()
ride.complete()
Enter fullscreen mode Exit fullscreen mode

The SDK handles real-time ETA updates, route recalculation, driver marker animation, and camera-following navigation.

What About Scale?
For most apps, the public infrastructure works fine. When you outgrow it:

Self-host Docker Compose setup with all services bundled
Navigatr Cloud (coming soon) — Managed infrastructure, capacity based pricing

javascript
const nav = new Navigatr({
  serverUrl: 'https://maps.yourcompany.com'
})
Enter fullscreen mode Exit fullscreen mode

Same SDK, different backend. No code changes.

The Honest Limitations

  1. No live traffic data — ETAs are based on speed limits, not current conditions
  2. No Street View
  3. No rich POI data — limited business info vs Google Places
  4. For core use cases — routing, geocoding, real-time tracking

Navigatr works. And it costs nothing.

Why Open Source?
Because developers shouldn't have to choose between paying Google $10K/month or building maps infrastructure from scratch.
The SDK is MIT licensed. Fork it, self-host it, contribute to it.
npm · GitHub · Docs

Built on Valhalla, Nominatim, Photon, MapLibre GL JS, and OpenStreetMap.

Top comments (0)