Get internet address (public IP/address)

dsnz

Active member
hi all
I searched the forums and didn't find any information on how to get the internet IP which I need for some project
(the title of the thread mentions address/internet/public specifically so that future searches can return results since IP/WAN/ISP etc return nothing)

before embarking on a custom solution I wonder to know if other forum members have solved this before and how, so please post your experience
(even if the most obvious solution is a get from a web site that returns IP info, some sites are more reliable, or faster or with output that is easier to parse, so telling the site experience is useful too)
 
Last edited:

dsnz

Active member
update:

I forgot to mention that it should be possible to get public address even on VPN, and I mean the real WAN/ISP one and not the VPN one
(perhaps by a different method than when not on VPN)
 

Abalsam

Active member
update:

I forgot to mention that it should be possible to get public address even on VPN, and I mean the real WAN/ISP one and not the VPN one
(perhaps by a different method than when not on VPN)
You want to send an http request to icanhazip.com and save the response to a variable. That will give you the ip address (v4 or v6) it sees your request came from.
 

dsnz

Active member
how was this thread moved from General discussion to Feature Request ? 🤔

I don't even think it's a feature request, this needs external communication (websites that provide public IP or communication with internet modem or even mobile connection parameters/information) that I am not sure it should be part of Macrodroid
 
Top