I'm doing restaurant search engine for my project and I'm stucked with current location.. I can get my lat and lng from navigator (geolocation HTML5). The point is, that I need postal code, not lat and lng. The only idea I had was to get that lat and lng and connect with postal code using some API.

I've found something like this: http://api.geonames.org/findNearbyPostalCodes?lat=52.198500&lng=-2.219200&maxRows=1&username=demo

How can I refer to the post code from that API? The best with javascript?

Have you got maybe other ideas? I've got one button and after clicking on that button, I want postcode from my location in text input.

1 Answers

0
Felipe Dutra Ferreira On

Would you be able to make an API to the following Service and convert the data? Please look at the following and let me know if you need help Consuming the API..

https://docs.mapbox.com/api/search/#geocoding