🌐 IP Geolocation & Nighttime Plugins

Hi Bubblers, we’ve released a free plugin. :bride_with_veil: :man_pilot:
No sign up or API keys required, you don’t need to ask for the user’s permission & best request limit we found. For example Geo.ipify. offers only 1000 queries per month. With Freegeoip you’re allowed up to 50,000 queries per hour! We used a service from Cloudflare to get the user’s IP, doesn’t seem to be blocked by client and is accurate even when using vpns.


    $.get('https://1.1.1.1/cdn-cgi/trace', function (data) {
            const regex = /^(?:ip)=(.*)$/gm;
            let ip = "";
            match = regex.exec(data);
            while (match != null) {
                ip = match[1];
                match = regex.exec(data)
            }
            $.getJSON(`https://freegeoip.live/json/${ip}`, function (data) {
                    let response = {
                        "_p_City": data.city,
                        "_p_Country Code": data.country_code,
                        "_p_Country Name": data.country_name,
                        "_p_IP": data.ip,
                        "_p_Latitude": data.latitude,
                        "_p_Longitude": data.longitude,
                        "_p_Metro Code": data.metro_code,
                        "_p_Region Code": data.region_code,
                        "_p_Region Name": data.region_name,
                        "_p_Timezone": data.time_zone,
                        "_p_Zip Code": data.zip_code
                    };
                    instance.publishState('data', response)
                })
        })
7 Likes

Very helpful :sparkles:

2 Likes

We made another plugin reusing this code to calculate sun position. The element returns simple yes/no state, helpful for designing automatic dark/light UI.

5 Likes

@Appkit Can you please create a page to show how to extract zip/postal code using this plugin?

Hi Sumit, it’s still working for us, did you add the element onto the page?

image

https://appkit.bubbleapps.io/test?debug_mode=true

Also to mention, postcodes may not be 100% accurate but close to the current user’s location, see this https://www.quora.com/Is-it-correct-that-IP-address-geolocation-only-gives-an-ISP-server-location?share=1. For us the post code is close (city) but not exact.

1 Like

@Appkit Thank you! That’s very helpful. I figured out the mistake I was making.

1 Like

Added sunlight definition :slight_smile:

image

1 Like

Hi Bubblers, some good news here! :partying_face:
This plugin has been acquired by Zeroqode a while ago, and in a recent update become even more useful, getting more states to be used.
image
image

To check changes, please upgrade your plugin to the latest version (Version 1.13.0: Added more states) and give it a try.

In case there will be any plugin-related questions, the Zeroqode Support Team will be glad to help you :hugs:

Have a good day!

Regards,
Zeroqode Support Team

1 Like

Is the IP Geolocation Plugin for Bubble using https://freegeoip.live?

The plugin description says it’s using IPApi and to get an API for 1000+ per day using.

Which one is it?

  1. https://ipapi.co/
    or
  2. https://ipapi.com/

Thanks,
Mickey

Hi @onfyre,

Thank you for the question :slight_smile:

No, IP Geolocation Plugin is using https://ipapi.co/ to fetch the data via API.

The Free Plan on https://ipapi.co/ allows you to pull up to 1,000 requests per day so 30,000 requests per month in total. If you require more than 1000 requests per day we suggest getting one of the paid plans which allows more versatility.

Cheers :hugs:

Hi!
Today it stopped working did something happen?

Hello @diego.cambalache,

Thank you for reaching out to us.

We’re truly sorry to learn about the challenges you’re encountering with our plugin. To better assist you, could you please describe the specific issue you’re facing? Also, it would be helpful if you could check your browser console for any error messages or alerts.

One possible cause for the problem might be exceeding the daily request limit, which is currently set at 1000 requests per day. To overcome this limitation, we suggest obtaining a paid API Access key directly from ipapi.co. For detailed instructions on how to acquire and integrate this key into your application, please refer to our documentation here: IP Geolocation Plugin Documentation.

We hope this guidance is useful to you, please let us know about your findings.

Wishing you a wonderful day ahead!

Best regards,
Zeroqode Support Team

Does Zeroqode support other free API such as ip2location.io? It has keyless / tokenless API which is easier to use without sign-up.

Hello @tgotchi,

Thank you for reaching out and sharing your suggestion.

The current plugin is designed to work specifically with ipapi.co. Integrating with ip2location would require adapting to a different API architecture. Nevertheless, I’ve noted your idea of incorporating ip2location.io into this or a future plugin.

It’s worth mentioning that ip2location.io offers the same number of free API queries per month as the ipapi service we currently use.

Thank you once again for bringing this to our attention. We truly appreciate your input.

Wishing you a wonderful day ahead!

Best regards,
Zeroqode Support Team

Hi @ZeroqodeSupport,
Is this plugin still functional?
I cannot seem to make it work and the demo is also not working. Though the map updates to my approximate location.
I confirmed my IP by navigating to ipapi.co, that shows my IP just fine.

1 Like

Hello @deon1, :wave:

We apologize for the delayed reply. :pray:

We just checked the live demo of the IP geolocation plugin and it’s working as expected. You can refer to the demo editor here: Appkit | Bubble Editor


It seems you’re having some trouble getting the plugin to work fully. Here is plugin documentation: IP Geolocation

We’d be happy to help troubleshoot this further. Could you describe in more detail the issues you’re encountering? Any error messages or unexpected behavior would be helpful information.

Best regards,
Zeroqode Support Team.

Thanks for your response.
I have gone through your documentation and I cannot figure out why I cannot see my IP with your app.
Here is some screenshots of my setup:



And lastly the ipapi website to confirm it is available:

Hi again @deon1, :wave:

Thank you for your message.

To confirm, are the screenshots you sent showing your experience with our live demo, or your own Bubble application using our plugin?

For the live demo to function properly, it won’t require you to enter an API access key. However, if you’re using the plugin within your own Bubble app, you’ll need to enter an API access key from Ipapi and enter it into the designated field:

Let us know if this clarifies things, and if you have any further questions!

Best regards,
Zeroqode Support Team.

Hi @ZeroqodeSupport, thanks for getting back to my so quickly.

The screenshots are from your live demo, but mine is identical.
Do I need an API key from Ipapi if I want to use the free version? Since I cannot register without selecting a paid plan.

Hi @deon1, :wave:

Thank you for the information. We’ve checked, and the plugin should work without the API keys as well.

Please note that in some cases, the current user’s IP might not be returned due to browser/security settings, third-party browser extensions, or VPN blocking services.

Could you please let us know which browser you are using? Additionally, please try testing in Chrome incognito mode to see if the issue persists.

Looking forward to your response.

Best regards,
Zeroqode Support Team.