Skip to content

freegeoip.net service discontinued #7

@marcus-at-localhost

Description

@marcus-at-localhost

You now need a free API key (limited to 10000 queries/month)

http://api.ipstack.com/186.116.207.169?access_key=YOUR_ACCESS_KEY&output=json&legacy=1

🔗 https://github.com/apilayer/freegeoip/

EDIT: this is not an easy replacement for freegeoip.com since there free plan requires to add the ip manually and doesn't offer https.

A possible solution could be: http://geoip.nekudo.com/ (with some minor changes).

 L.GeoIP = L.extend({
	getPosition: function (ip, callback) {
		//var url = "https://freegeoip.net/json/";
		var url = "https://geoip.nekudo.com/apis/";
//...
			if (status == 200) {
				var geoip_response = JSON.parse(xhr.responseText);
                                // change these two lines
				result.lat = geoip_response.location.latitude;
				result.lng = geoip_response.location.longitude;

				if (callback) {
					callback(result);
				}
			} 
//...
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions