7

I am using intlTelInput.min.js for geo IP lookup with this code

jQuery("#teephnumber").intlTelInput({
        allowExtensions: true,
        defaultCountry: "auto",
        setNumber: "Telephone number",
        geoIpLookup: function(callback) {
            $.get('http://ipinfo.io', function() {}, "jsonp").always(function(resp) {
              var countryCode = (resp && resp.country) ? resp.country : "";
              callback(countryCode);
            });
          },
        nationalMode: false,
        utilsScript: "/wp-content/themes/imc/js/utils.js"
    });

it was working fine, but now not in console I see this error:

The server responded with a status of 429 (Too Many Requests), GET http://ipinfo.io/?callback=jQuery1112025137682701461017_1438183879450&_=1438183879451

And no javascript code because of this works.What can be the reason for this?

Ana DEV
  • 1,018
  • 2
  • 17
  • 39

1 Answers1

4

See Rate limits here: https://ipinfo.io/developers

"You are limited to 1,000 API requests per day. If you need to make more requests, or need SSL support, see our paid plans."

I think you need to pay for more requests or find a way to reduce the requests you are making. You can probably cache the location so you only query once per user using localstorage.

DonutReply
  • 3,184
  • 6
  • 31
  • 34
  • 1000 per day from one country or generally? @DonutReply – Ana DEV Jul 29 '15 at 15:56
  • I'd imagine requests of any kind per day. I don't know anything about this service, why don't you read the docs? – DonutReply Jul 29 '15 at 16:02
  • You can use alternate service of ipinfo.io https://stackoverflow.com/questions/14177647/find-user-location-using-jquery-js-without-google-geolocation-api/32756532#32756532 – Durgesh Pandey Feb 11 '19 at 10:42