Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tarang19's avatar

How to get geolocation data in object

I wanted to get geolocation data in object format but don't want to use paid application any one know which one is better or if i enter city name then this object need o be generate

e.g.

city: "Pune"
country_code: "IN"
country_name: "India"
latitude: 18.5333
longitude: 73.8667
postal: "411001"
state: "Maharashtra"
0 likes
2 replies
tarang19's avatar

Thank you but its paid i required free api and its ip address base i wanted on typing of city name

Please or to participate in this conversation.