Next.js

2 articles tagged “Next.js”.

9 min read

Get a visitor's IP address and country in Next.js (15 and 16)

Most answers for "Next.js get user IP" still use request.ip and request.geo, which Next.js 15 removed, and middleware.ts, which Next.js 16 renamed. Here is what works now on Vercel, on your own server and behind Cloudflare, and which headers you can actually trust.

  • Next.js
  • IP geolocation
  • Code

Try it

One GET request: location, network and bot signals

Free keys include 1.000 lookups a day. No card needed.