Get Wan IP (api.ipify.org)

Share your advanced knowledge/code with the community.
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Get Wan IP (api.ipify.org)

Post by falsam »

To find the IP address of your visitors.

Code: Select all

Procedure HttpGetEvent(Success, Result$, UserData)
  Protected wanip.s
  
  If Success
    Debug Result$
    ParseJSON(0, Result$, #PB_UTF8)
    
    wanip = GetJSONString(GetJSONMember(JSONValue(0), "ip"))
    Debug "Your wan ip is : " + wanip 
    
  Else
    Debug "HTTPRequest(): Error"
  EndIf
EndProcedure

HTTPRequest(#PB_HTTP_Get, "https://api.ipify.org?format=json", "", @HttpGetEvent())

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english