Visitors leave when your site opens in the wrong regional store or language
If you run regional storefronts or translated pages (such as /de/, /fr/ or /uk/), visitors clicking a shared link often land on the default page with the wrong shipping options, dates and support hours.
Hard, automatic redirects frustrate travelers, expats and search engine crawlers (which usually crawl from US IP addresses and need to reach every locale). Instead, check whether the visitor has already picked a region, and either show a polite "Switch to our German store?" banner or set an initial default cookie that the visitor can change at any time.
A single call to https://api.ipatlas.dev/v1/me in the browser (or /v1/{ip} in server middleware) returns country_code, country and timezone in milliseconds. Looked-up IP addresses are never logged, and you can start with 50,000 free lookups a month with no credit card.
Example: suggest a regional store in JavaScript
const STORES = { DE: "/de/", FR: "/fr/", GB: "/uk/" };
async function suggestRegionalStore() {
if (localStorage.getItem("preferred_store")) return null;
const res = await fetch("https://api.ipatlas.dev/v1/me");
if (!res.ok) return null;
const geo = await res.json();
const target = STORES[geo.country_code];
if (!target || location.pathname.startsWith(target)) return null;
return { country: geo.country, countryCode: geo.country_code, url: target };
}
Related resources
- Show prices in the visitor's local currency on your pricing page
- Adapt pages and notices for EU visitors with the
is_eufield - Spot suspicious logins and payments early with IP country and ASN checks
- Next.js middleware geo routing guide, all use cases, API documentation and pricing plans
Get your free API key
Start with 50,000 free lookups a month — no credit card required. Paid plans start at $9/month with hard caps and no surprise bills.