Next.js Discord

Discord Forum

easiest way to get user location from ip in nextjs?

Answered
Havana posted this in #help-forum
Open in Discord
HavanaOP
without using the browser native api, what do you think the best solution would be? Is it possible to get the ip easily from nextjs and query some third party api to get the approximate location? If yes, which one do you suggest?
Answered by gin
u can also read the raw ip from the headers and use apis like https://ip-api.com/
to get the geolcation
View full answer

9 Replies

u can also read the raw ip from the headers and use apis like https://ip-api.com/
to get the geolcation
Answer
be aware of ratelimits tho
HavanaOP
mm gotcha, thank you very much
u can mark my answer as solution
ty