# sindresorhus/public-ip

Get your public IP address - very fast!

Repository: https://github.com/sindresorhus/public-ip
Canonical: https://ross.abutalabs.com/products/public-ip
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2025-09-21T13:22:20+00:00

## Health v2 (maintenance only)
Score: 45/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 43, release rhythm 16, longevity 100
- inputs: {"age_days": 4371, "days_push": 346, "days_rel": 346, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1061, forks 69 (observed 2026-08-28T04:03:25.892865+00:00)

## What it is
A JavaScript library for Node.js and browsers that quickly retrieves the machine's public IP address (IPv4 or IPv6) via DNS queries to OpenDNS/Google DNS with HTTPS service fallbacks. It offers a promise-based API with timeout, abort signal, and custom fallback endpoint support.

## Use cases
- get my public ip address in nodejs
- detect external ipv4 address of a machine
- check public ipv6 address from the browser
- find out a server's outbound ip programmatically
- fast public ip lookup via dns

## When to choose
- you need a fast public IP lookup in Node.js or the browser
- you want DNS-based detection with HTTPS fallback for reliability
- you need IPv4 and IPv6 support with timeout and cancellation

## When to avoid
- you need to know a local/private IP address
- you need geolocation or ISP details about the IP
- you require a strictly tamper-proof HTTPS-only lookup and can't tolerate slower responses

## Facets
- artifact type: library
- maturity: active
- function: http-client, networking
- domain: networking, developer-tools, web-development
- platform: browser
- tags: public-ip, ipv4, ipv6, dns-lookup, ipify, opendns, nodejs, javascript

## Member repositories
- sindresorhus/public-ip (main) score 45

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:25.892865+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:56:52.350791+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/public-ip (fetched 2026-08-28T04:03:25.892865+00:00, sha e2511fdf35a8)
  - registry_npm: https://registry.npmjs.org/public-ip (fetched 2026-08-29T12:58:36.184308+00:00, sha 770e61843e02)
- Data as of 2026-08-30T08:39:29.467469+00:00.
