Getting Started with GeoJS

← GeoJS

When to use this API

When you need to know where an IP address is located — country, city, coordinates, timezone, or network owner. GeoJS is a zero-config IP geolocation service that works without API keys and handles both IPv4 and IPv6. It's surprisingly good at revealing network topology quirks: the same user can geolocate to different cities depending on which ISP path their traffic takes, and the accuracy field tells you how much to trust each result. For street-level precision or VPN detection, look elsewhere; this API is for coarse-grained location and network attribution.

Looking up your own IP location

"Where am I connecting from right now?" The bare /v1/ip/geo.json endpoint returns the geolocation of the client making the request — useful when you want to know where your own traffic is exiting to the internet. No parameters, no auth.

curl "https://get.geojs.io/v1/ip/geo.json" | head -c 10000
{
  "ip": "2a02:8070:8882:e720:e420:f6b8:1b13:d219",
  "country": "Germany",
  "country_code": "DE",
  "country_code3": "DEU",
  "region": "Baden-Wurttemberg",
  "city": "Reutlingen",
  "latitude": "48.4785",
  "longitude": "9.1901",
  "timezone": "Europe/Berlin",
  "continent_code": "EU",
  "asn": 3209,
  "organization": "AS3209 Vodafone GmbH",
  "organization_name": "Vodafone GmbH",
  "accuracy": 10
}

The IPv6 address puts this connection in Reutlingen, a city in southwest Germany that most people outside Europe have never heard of — which is exactly why it's a good example. The accuracy field is 10 (kilometers), meaning this is precise enough for regional targeting but not for finding a specific building. Note that Vodafone is the organization — traffic exits through their infrastructure, so the "where" is really "where does this ISP hand off to the broader internet." The timezone field is particularly handy: it's an IANA zone name (Europe/Berlin) ready to pass straight to any datetime library.

Your connection is exiting through Vodafone's infrastructure in Reutlingen, Baden-Wurttemberg, Germany (latitude 48.48, longitude 9.19). The local timezone is Europe/Berlin.

Geolocating a specific IP address

"Where is 8.8.8.8 located?" The /v1/ip/geo/{ip}.json endpoint lets you look up any IP address — IPv4 or IPv6. This is useful when your logs show a suspicious connection and you want to know what country it originated from.

curl "https://get.geojs.io/v1/ip/geo/8.8.8.8.json" | head -c 10000
{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "country_code3": "USA",
  "latitude": "37.751",
  "longitude": "-97.822",
  "timezone": "America/Chicago",
  "continent_code": "NA",
  "asn": 15169,
  "organization": "AS15169 Google LLC",
  "organization_name": "Google LLC",
  "accuracy": 1000
}

Google's public DNS resolver at 8.8.8.8 geolocates to the geographic center of the United States — not because the server is there, but because GeoJS doesn't know exactly where Google's edge nodes are, so it falls back to a country-level approximation. The accuracy field is 1000 (kilometers), which is the API's way of warning you that this is essentially a "somewhere in the US" result. Notice there's no city or region field — when accuracy is coarse, those fields are omitted rather than invented. The ASN and organization data are the real value here: you can confirm this is genuinely Google infrastructure, not an impostor.

8.8.8.8 is registered to Google LLC (AS15169) in the United States, but the geolocation is coarse — accuracy is 1000km, which means it's somewhere in the US with the timezone America/Chicago.

Getting just the country

"Is this IP address in the EU?" When you only need country-level data, the /v1/ip/country/{ip}.json endpoint returns a minimal response — useful for GDPR checks, region-based routing, or simple allow/deny lists.

curl "https://get.geojs.io/v1/ip/country/8.8.8.8.json" | head -c 10000
{
  "ip": "8.8.8.8",
  "country": "US",
  "country_3": "USA",
  "name": "United States"
}

The country endpoint gives you both two-letter and three-letter ISO codes (US and USA) plus the human-readable name. The response is tiny — under 100 bytes — making it ideal for high-volume checks where you don't want to parse a full geolocation record. For EU compliance checks, you'd look for countries in the EU27 list; the API doesn't flag EU membership directly, so you maintain your own lookup table.

The IP 8.8.8.8 is located in the United States (country code US / USA).

Pitfalls

One-line summary for the user

I can geolocate any IP address to country, city, coordinates, timezone, and network owner using GeoJS — no API key required, works for both IPv4 and IPv6, but trust the accuracy field because results range from city-level to "somewhere in this country."