How to get free IP geolocation without an API key
In short: send a GET request to
/v1/geolocation/json?q=8.8.8.8 and you get country, region, city, timezone and
coordinates back as JSON. There is no signup step, no API key, and the limit is a generous
30 requests per minute per IP address.
Almost every "free tier" geolocation service has the same catch: you create an account, copy a key out of a dashboard, paste it into a query string, and then watch the quota burn down. For a weekend project or a small script, that friction is not worth it. There is a simpler way โ an endpoint that returns the data from the URL alone.
What you get back
The response is deliberately flat and predictable, which makes it easy to consume from any language. Every field is always present, so you never have to guard against missing keys.
| Field | Meaning |
|---|---|
ip | The address that was looked up, normalised |
country_code / country_name | ISO code and full name |
region_name | State or province |
city, zip_code | City and postal code |
time_zone | IANA zone, e.g. America/New_York |
latitude, longitude | Approximate coordinates |
Making the request
cURL
curl 'https://freetools.one/v1/geolocation/json?q=8.8.8.8'
JavaScript
const g = await (await fetch('https://freetools.one/v1/geolocation/json?q=8.8.8.8')).json();
console.log(g.city, g.country_name);
Python
import requests
g = requests.get('https://freetools.one/v1/geolocation/json',
params={'q': '8.8.8.8'}).json()
print(g['city'], g['country_name'])
Finding your own IP address
Leave the q parameter out entirely and the service locates the caller's public
IP instead. This is the quickest way to build a "where am I" banner:
curl 'https://freetools.one/v1/geolocation/json'
Because the lookup happens server-side, this works from a browser as well as from a terminal โ there is no CORS problem, unlike calling the upstream provider directly.
Looking up a hostname
You do not have to resolve the name yourself. Passing a hostname works:
curl 'https://freetools.one/v1/geolocation/json?q=example.com'
IPv6 works the same way as IPv4, with no separate endpoint.
XML when you need it
An XML variant is available for older stacks and CMS integrations:
curl 'https://freetools.one/v1/geolocation/xml?q=8.8.8.8'
Limits and caching
The limit is 30 requests per minute per IP address, which is far more than a typical page load needs. This endpoint performs a live upstream lookup, so if your application repeats the same address, cache the JSON response locally for a few hours.
Where to go next
If you are building a page that shows weather, the free weather API guide picks up from the same geocoding step and is the natural next piece.
Common use cases
Default currency and language
Pairing a geolocation lookup with a currency or language default is one of the most common
uses. Because the response includes country_code, you can pick a sensible default
and let the visitor override it:
const DEFAULTS = { US: 'USD', GB: 'GBP', DE: 'EUR', JP: 'JPY' };
const g = await (await fetch('https://freetools.one/v1/geolocation/json')).json();
const currency = DEFAULTS[g.country_code] || 'USD';
Analytics without a third-party script
Server-side logging of a country code per request gives you geographic distribution without embedding a tracking pixel. Because the lookup happens over plain HTTPS, it works from a worker, a function or a CLI.
Regional content routing
You can branch on country_code to pick a default currency, a legal notice or a
store. Keep the override in the URL so the choice is shareable and testable.
Edge cases worth knowing
| Situation | What happens |
|---|---|
| Private or reserved address | Rejected โ internal ranges are not geolocated |
| Hostname that does not resolve | HTTP 400 with an "unknown host" error |
| Anycast/CDN address | Reports the network owner, not the end user |
| Mobile carrier CGNAT | Often resolves to the carrier, not the user |
| VPN or proxy | Reports the exit node's location |
The last three are worth internalising: IP geolocation is approximate by nature, and infrastructure-level addresses (CDN, VPN, carrier NAT) deliberately obscure the end user. Use it for regional defaults, not for identity or access control.
Performance and caching
IP geolocation is a live lookup, so FreeTools does not promise a shared six-hour cache for
this endpoint. The response does include X-Elapsed-Ms for timing. If your app
performs repeated lookups, cache the result by IP and choose a TTL appropriate for your use
case; CDN and VPN addresses can change location over time.
Frequently asked questions
What is the best free IP geolocation API with no key?
FreeTools exposes /v1/geolocation/json with no signup: it returns country, region, city, timezone and coordinates for any IPv4, IPv6 address or hostname, limited to 30 requests per minute.
Is there really no rate limit for free?
There is a limit of 30 requests per minute per IP address, and 300 per minute for the random-data endpoints. Cache repeated addresses in your application when you need higher volume.
Can I geolocate an IPv6 address?
Yes. IPv4, IPv6 and hostnames are all accepted by the same endpoint, and hostnames are resolved before the lookup is performed.
How accurate is the location data?
It resolves to city level rather than to a street address, which is what free IP geolocation data is generally good for. Treat coordinates as an approximate city centroid.