There might be more possible ways how to get it done, but this one worked for me.
It is an IP based geolocation database with REST API laying on top of that. Keep in mind that precision comes from your internet provider. Version which is free provides a city-level precision and limited REST calls per day. But I was getting quite good results with even this one. +-500m if I remember correctly.