API browser call data not saved, instead bubble's server location

I am trying to use https://ipinfo.io/ 's api to get a user’s ip address without the rate limits that all the plugins seem to have.

Here are my steps:

  1. My api setup is a data call to IPInfo’s endpoint. The api call is triggered on the browser side so that i get the user’s IP address and not Bubble’s server’s own IP address.
  2. I save the IP address’s response to the page’s custom state as text to ensure that the correct text is saved to the user’s profile and not Bubble’s own server IP address and location.
  3. I then create a new location entry for the user using the custom states text for the data fields.

Now here’s the weirdest thing that happens:
In the debugger mode this flow looks perfect; the correct IP address & location of the user is pulled and the correct data added to the custom state and the correct data from the custom state saved to the new location entry.

BUUTT when i look at the database, Bubble’s own server IP address & location data is stored instead of the data i just saw in the debugger mode. :exploding_head:

Does anyone have an idea what is going wrong?
I have been trying to debug this for days but can’t seem to figure it out :sob:

Can you share screenshot or screencast? If the state look good, I guess the issue is more when you save data to DB…
Did you create a plugin?
Actually, using this on client side will expose your API key…
ipify? free, no limit…

I’ve observed this as well. The problem occurs when populating a database value or even an element’s custom state then referenced to populate a database value; the IP address initially populates accurately, but then confusingly changes a moment later. In contrast, the problem does not occur when populating an on-screen element. Try saving the IP address to the db from an input instead of from a custom state.
image

BTW, Firefox does not reliably call the API even from the input. See another forum post.

Are you sure there is no rate limit in the ipinfo.io API? I noticed that many IP geolocation APIs, such as ip2location.io and ipinfo.io, have implemented rate limits based on the source IP address.

Thanks everyone!
Ended up just using the IP plugin from Zeroqode as I got too fedup with the api call’s ip stored in the custom state not saving to the database. Zeroqode’s can handle 50k queries per hr: IP Geolocation Plugin for Bubble | Zeroqode
Works great so far!

This topic was automatically closed after 70 days. New replies are no longer allowed.