Google Maps cannot determine a person’s exact position from an IP address. The practical pattern is to obtain an approximate coordinate from Google’s Geolocation API with considerIp enabled, then center a Maps JavaScript API map on that coordinate. For a precise, current device position, ask the visitor for permission with the browser’s navigator.geolocation API instead.
IP results are suitable for country, region, language, fraud checks, and routing defaults. They are not suitable for turn-by-turn navigation or any decision that depends on a device’s exact position.
Choose the location method before writing code
Your choice determines accuracy, consent requirements, and what happens when the user is behind a VPN or mobile carrier NAT.
| Method | Typical precision | User permission | Works when permission is denied? | Good uses |
|---|---|---|---|---|
| IP fallback through Google Geolocation API | Often city or region level; uncertainty can be thousands of meters | No browser prompt | Yes, if the server can see a public IP | Language, country defaults, coarse routing, fraud signals |
Browser navigator.geolocation |
Can be much more precise when Wi-Fi, GPS, or cell data are available | Yes, explicit browser permission | No | Nearby places, delivery, navigation, device-aware features |
Google describes IP geolocation as its least accurate fallback. Its Geolocation API response includes location.lat, location.lng, and an accuracy value in meters. Treat that value as an uncertainty radius, not as a confidence score or a boundary around the user.
#1 Best Overall
- Bright, high-resolution 5” glass capacitive touchscreen display lets you easily view your route
- Get more situational awareness with alerts for school zones, speed changes, sharp curves and more
- View food, fuel and rest areas along your active route, and see upcoming cities and milestones
- View Tripadvisor traveler ratings for top-rated restaurants, hotels and attractions to help you make the most of road trips
- Directory of U.S. national parks simplifies navigation to entrances, visitor centers and landmarks within the parks
How Google’s IP fallback works
The Geolocation API first tries supplied Wi-Fi access-point and cell-tower evidence. If those signals cannot be resolved and considerIp is true, Google estimates the location from the request IP. The official documentation states: “IP Geolocation: If considerIp is true and no WiFi or cell tower signals can be geolocated, the API estimates location based on the request’s IP address.”
For an IP-only request, send an empty signal set and enable the fallback:
POST https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_SERVER_API_KEY
Content-Type: application/json
{
"considerIp": true
}
A successful response has this shape:
{
"location": {
"lat": 40.7128,
"lng": -74.0060
},
"accuracy": 12000
}
In this example, the coordinate represents an area with a documented uncertainty radius of about 12 kilometers. Do not place a pin that implies street-level precision; display the radius or label the result as approximate.
Rank #2
- 6” high-resolution navigator includes map updates of North America
- Hands-free calling when paired with your compatible smartphone with BLUETOOTH technology and convenient Garmin voice assist lets you ask for directions to places you want to go
- Road trip–ready features include the HISTORY database of notable sites, a U.S. national parks directory, Tripadvisor traveler ratings and millions of Foursquare POIs
- Driver alerts for things such as school zones, sharp curves and speed changes help encourage safer driving and increase situational awareness
- Access live traffic, fuel prices, parking, weather and smart notifications when you pair this navigator with your compatible smartphone running the Garmin Drive app
Server-side Python example
Keep the API key on your server. This example returns a coordinate only when Google supplies one and rejects an implausibly coarse result for a feature that needs a useful map center.
import os
import requests
API_KEY = os.environ["GOOGLE_GEOLOCATION_KEY"]
endpoint = "https://www.googleapis.com/geolocation/v1/geolocate"
response = requests.post(
endpoint,
params={"key": API_KEY},
json={"considerIp": True},
timeout=10,
)
response.raise_for_status()
data = response.json()
location = data["location"]
accuracy_m = data.get("accuracy")
print({
"lat": location["lat"],
"lng": location["lng"],
"accuracy_m": accuracy_m,
"approximate": True,
})
Equivalent cURL request
curl -X POST "https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_SERVER_API_KEY"
-H "Content-Type: application/json"
-d '{"considerIp":true}'
Equivalent Node.js request
const key = process.env.GOOGLE_GEOLOCATION_KEY;
const endpoint = new URL('https://www.googleapis.com/geolocation/v1/geolocate');
endpoint.searchParams.set('key', key);
const res = await fetch(endpoint, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ considerIp: true })
});
if (!res.ok) throw new Error(`Geolocation failed: ${res.status}`);
const data = await res.json();
console.log({
lat: data.location.lat,
lng: data.location.lng,
accuracy_m: data.accuracy,
approximate: true
});
Put the result on a Google map
The Maps JavaScript API accepts the latitude and longitude returned by either API. This complete browser example starts with an IP-derived coordinate supplied by your server, draws an uncertainty circle, and lets the visitor request a more precise browser location.
<button id="use-device" type="button">Use my device location</button>
<p id="status">Approximate location from your network.</p>
<div id="map" style="height:420px"></div>
<script>
// Inject these values from your server-rendered page.
const ipResult = {
lat: 40.7128,
lng: -74.0060,
accuracy: 12000
};
let map;
let marker;
let circle;
function initMap() {
const center = { lat: ipResult.lat, lng: ipResult.lng };
map = new google.maps.Map(document.getElementById('map'), {
center,
zoom: 9,
mapTypeControl: false
});
marker = new google.maps.Marker({ map, position: center, title: 'Approximate network location' });
circle = new google.maps.Circle({
map,
center,
radius: ipResult.accuracy || 0,
fillColor: '#4285f4',
fillOpacity: 0.15,
strokeColor: '#4285f4',
strokeOpacity: 0.7
});
}
document.getElementById('use-device').addEventListener('click', () => {
const status = document.getElementById('status');
if (!('geolocation' in navigator)) {
status.textContent = 'This browser does not provide device geolocation.';
return;
}
status.textContent = 'Requesting permission…';
navigator.geolocation.getCurrentPosition(
(position) => {
const precise = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
const accuracy = position.coords.accuracy;
map.setCenter(precise);
map.setZoom(15);
marker.setPosition(precise);
marker.setTitle('Device location');
circle.setCenter(precise);
circle.setRadius(accuracy);
status.textContent = `Device location; accuracy radius about ${Math.round(accuracy)} m.`;
},
(error) => {
const messages = {
1: 'Permission was denied. Continuing with the approximate network location.',
2: 'Location is unavailable. Check device location services or network access.',
3: 'The location request timed out. Try again.'
};
status.textContent = messages[error.code] || 'Unable to obtain device location.';
},
{ enableHighAccuracy: true, timeout: 10000, maximumAge: 60000 }
);
});
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_BROWSER_KEY&callback=initMap&v=weekly"></script>
Serve this page over HTTPS (localhost is generally treated as a secure development origin). Ask for location after a user action that explains the purpose, rather than prompting immediately on page load. Keep Google Maps attribution visible and display the result on a Google map when using Maps content.
Rank #3
- Explore confidently with the reliable handheld GPS
- 2.2” sunlight-readable color display with 240 x 320 display pixels for improved readability
- Preloaded with Topo Active maps with routable roads and trails for cycling and hiking
- Support for GPS and GLONASS satellite systems allows for tracking in more challenging environments than GPS alone
- 8 GB of internal memory for map downloads plus a micro SD card slot
Accuracy: what the radius really means
IP-based estimates
IP databases usually identify an ISP gateway, corporate egress point, or mobile carrier—not the handset. VPNs, proxies, privacy relays, satellite links, and carrier-grade NAT can place the apparent IP far from the user. Google documents IP-fallback radii that can reach thousands of meters.
Wi-Fi and cell evidence
With two or more Wi-Fi access points, Google documents a typical radius of about 20 meters. Macro-cell results commonly have radii of hundreds of meters and can reach several thousand meters in sparse coverage. These are typical documented ranges, not guarantees; show the returned radius when it affects the decision.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsHow to present uncertainty
- Use wording such as “estimated near this area,” not “you are here.”
- Draw a circle using the API’s
accuracyvalue. - Require a browser-approved position for delivery addresses, emergency response, or navigation.
- Offer a manual address or place search when the radius is too large.
Privacy, consent, and API-key security
Explain both data paths
Tell users when your server processes an IP address and whether you retain the resulting coordinate. For browser positioning, explain why the permission is needed, what you store, and how long it is kept. Publish accessible Terms of Use and a Privacy Policy for applications using the Maps JavaScript and Geolocation APIs.
Rank #4
- 8” navigator with high-resolution, dual-orientation display and map updates of North America .Special Feature:Large Display; Voice Assist; Hands-Free Calling; Live Traffic and Weather; Traffic Cams and Parking; Smart Notifications,Driver Alerts; Tripadvisor; National Parks Directory; Find Places by Name; Garmin Real Directions Feature.
- Hands-free calling when paired with your compatible smartphone with BLUETOOTH technology and convenient Garmin voice assist lets you ask for directions to places you want to go
- Road trip–ready features include the HISTORY database of notable sites, a U.S. national parks directory, Tripadvisor traveler ratings and millions of Foursquare POIs
- Driver alerts for things such as school zones, sharp curves and speed changes help encourage safer driving and increase situational awareness
- Access live traffic, fuel prices, weather, parking and smart notifications when you pair this navigator with your compatible smartphone running the Garmin Drive app
Protect keys
Google’s security guidance says web-service API keys are not expected to be publicly exposed to unauthorized users or untrusted applications or devices. Keep the Geolocation API key in a server environment, restrict it by API and application, rotate it if exposed, and proxy web-service calls through your backend. A browser key used by Maps JavaScript should have HTTP-referrer restrictions and only the APIs it needs enabled.
Respect Maps rules
Retain required Google Maps attribution. Do not pre-fetch, cache, or store Maps content outside Google’s documented exceptions. Terms and availability can vary by geography, including the European Economic Area, so review the current Maps Platform policy pages for your deployment region.
Handling failures and edge cases
| Symptom | Likely cause | Fix |
|---|---|---|
| Geolocation API returns an error for an empty request | considerIp is missing or false |
Send JSON containing {"considerIp":true} and verify the request reaches Google from a server with a public IP. |
| Map loads but shows a developer error | Invalid key, disabled Maps JavaScript API, billing setup, or referrer restriction mismatch | Check the Google Cloud project, enabled APIs, billing status, and the exact page origin. |
| Browser prompt never appears | Non-secure context, prior denial, iframe policy, or no user gesture | Use HTTPS, inspect site permissions, configure the iframe’s allow="geolocation" if applicable, and request after a click. |
| Position is in another city | VPN, proxy, carrier NAT, corporate gateway, or stale IP data | Label IP results approximate and offer browser geolocation or manual entry. |
| Circle covers an entire metro area | Large returned accuracy radius |
Do not zoom to street level; ask for permission or request an address instead. |
| Repeated requests are slow or expensive | Calling on every page view or bypassing your own short-lived cache | Resolve IP once per session where lawful, set timeouts, and avoid polling. Follow Google’s caching and storage rules. |
Performance and operational guidance
- Call IP geolocation on the server while rendering or fetching the page, then pass only the coordinate and radius to the browser.
- Set a finite HTTP timeout and handle non-2xx responses; a map should still render with a neutral center if geolocation fails.
- Do not treat a cached coordinate as a live device position. Network locations can change between sessions.
- Log status and latency without retaining raw IP addresses longer than your privacy policy permits.
- Enable only the APIs you use and monitor quota and billing in Google Cloud. Pricing and limits depend on your account, region, and current Maps Platform terms.
Or skip the browser setup
If your goal is to capture the rendered map page for documentation, QA, or an automated report, ScreenshotNeo can return a screenshot or PDF from one request. It is separate from geolocation: your page still needs to obtain coordinates and obey Google Maps attribution rules.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- Bright, high-resolution 5” glass capacitive touchscreen display lets you easily view your route
- Get more situational awareness with alerts for school zones, speed changes, sharp curves and more
- View food, fuel and rest areas along your active route, and see upcoming cities and milestones
- View Tripadvisor traveler ratings for top-rated restaurants, hotels and attractions to help you make the most of road trips
- Directory of U.S. national parks simplifies navigation to entrances, visitor centers and landmarks within the parks
After publishing a page such as https://example.com/map-result, call the API as shown in the ScreenshotNeo documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/map-result -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/map-result"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/map-result' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
FAQ
Frequently Asked Questions
Can an IP address reveal a person’s street address?
No. An IP generally identifies a network exit point or provider infrastructure. Use an address form or a permission-based device position when an address is required.
Does Google Geolocation API replace geocoding?
No. Geolocation estimates coordinates from network signals; geocoding converts an address or place description to coordinates, or coordinates to an address.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWill IPv6 improve IP-location precision?
Not necessarily. Precision depends on how the ISP assigns and registers the address block, not simply on whether it is IPv4 or IPv6.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

