
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
Get your public IP address
Using the Ipify API or a custom Ipify instance.
npm install ipify
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 | string[]
Default: 'https://api6.ipify.org'
Custom API endpoint.
Can be a single endpoint or an array of endpoints. When multiple endpoints are provided, they will be tried concurrently and the first successful response will be returned.
import ipify from 'ipify';
// Single endpoint
console.log(await ipify({endpoint: 'https://api.ipify.org'}));
//=> '82.142.31.236'
// Multiple endpoints for resilience
console.log(await ipify({
endpoint: [
'https://api.ipify.org',
'https://ipify.example.org'
]
}));
//=> '82.142.31.236'
public-ip?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.
FAQs
Get your public IP address
The npm package ipify receives a total of 841 weekly downloads. As such, ipify popularity was classified as not popular.
We found that ipify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.