Get your public IP address
Using the Ipify API or a custom Ipify instance.
import ipify from 'ipify'; console.log(await ipify()); //=> '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
Returns a Promise<string>
with an IP address.
Type: object
Type: boolean
Default: true
Use the IPv6 API endpoint. The IPv6 endpoint will return an IPv6 address if available, IPv4 address otherwise.
Setting the endpoint
option will override this.
import ipify from 'ipify'; console.log(await ipify({useIPv6: false})); //=> '82.142.31.236'
Type: string
Default: 'https://api6.ipify.org'
Custom API endpoint.
This package only targets the Ipify service, while public-ip
targets multiple services, is faster, and more resilient. Unless you run your own Ipify instance, you probably want public-ip
instead.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4