Geolocation API
ELI5 — The Vibe Check
The Geolocation API tells your website where the user is in the real world — latitude, longitude, the works. It's how 'find restaurants near me' works on the web. Users have to give permission though, because randomly knowing everyone's location would be, you know, terrifying.
Real Talk
The Geolocation API provides the device's geographic position via GPS, Wi-Fi, or IP-based location. It requires user permission and a secure context (HTTPS). Supports one-time position requests and continuous tracking via watchPosition(). Accuracy varies by device and location method.
Show Me The Code
navigator.geolocation.getCurrentPosition(
pos => console.log(pos.coords.latitude, pos.coords.longitude),
err => console.error(err.message),
{ enableHighAccuracy: true }
);
When You'll Hear This
"Use the Geolocation API to auto-fill the user's city on the signup form" / "Always provide a manual location fallback in case geolocation permission is denied"
Related Terms
Notification API
The Notification API lets websites show native system notifications — those little pop-ups in the corner of your screen.
Progressive Web App
A PWA is a website that put on a trench coat and convinced your phone it's a real app.
Web Share API
The Web Share API triggers the native share sheet from a website — the same one native apps use.