datawookie / medusa-proxy

13 stars 2 forks source link

Integrating IPinfo for IP metadata #8

Open abdullahdevrel opened 3 months ago

abdullahdevrel commented 3 months ago

Description

As discussed in: https://github.com/datawookie/medusa-proxy/issues/7

✅ Checks


Difference in location payload response:

Existing response:

| Japan           | Osaka              | +34.69 / +135.49

IPinfo modified response:

 | Osaka, JP | 34.6938,135.5011

I have included some untested code, if you can verify it that will be great.

You are making a call to get the IP address from https://api.ipify.org?format=json and then passing the IP address to http://ip-api.com/json/{ip}. This is not necessary. If you call ipinfo without passing an IP address, the information returned will be about the IP address.