Skip to main content

A command-line utility to determine your internet-facing public IP address

Project description

publicip

CI PyPI version Python versions License: MIT

A command-line utility that reports your internet-facing public IP address. Queries multiple well-known free services with automatic fallback so you always get an answer even if a provider is down.

Installation

pip install publicip

Or with uv:

uv tool install publicip

Usage

publicip                        # print your public IP
publicip --verbose              # include which provider responded
publicip --format json          # JSON output
publicip --format json --verbose  # JSON with provider field
publicip --provider ipify       # force a specific provider
publicip --all                  # query all providers

Providers

Name Service
ipify api.ipify.org
icanhazip icanhazip.com
identme 4.ident.me
seeip ipv4.seeip.org

The default order is ipify → icanhazip → identme → seeip. The first successful response wins.

Examples

$ publicip
203.0.113.42

$ publicip --verbose
203.0.113.42    (via ipify)

$ publicip --format json --verbose
{"ip": "203.0.113.42", "provider": "ipify"}

$ publicip --all
203.0.113.42    (via ipify)
203.0.113.42    (via icanhazip)
203.0.113.42    (via ident.me)
203.0.113.42    (via seeip)

Limitations

Currently, publicip only returns your public IPv4 address. IPv6 is not supported. All configured providers are queried via their IPv4 endpoints.

IPv6 support is a planned future enhancement.

Contributing

See CONTRIBUTING.md.

Security

To report a vulnerability privately, see SECURITY.md.

License

MIT © Andre Van Klaveren

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

publicip_cli-0.1.1.tar.gz (61.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

publicip_cli-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file publicip_cli-0.1.1.tar.gz.

File metadata

  • Download URL: publicip_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 61.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for publicip_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2afede440d7816accf6264350d1f9a943ff9e2cdc6e4bfaefccf6934d5b8c963
MD5 30998529a1d29a753b7569d5ed21f6a3
BLAKE2b-256 9ef66baac766b2e1bfbc2f295060007c98922d72501123e4bf8e1869481ec372

See more details on using hashes here.

Provenance

The following attestation bundles were made for publicip_cli-0.1.1.tar.gz:

Publisher: publish.yml on opratr/publicip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file publicip_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: publicip_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for publicip_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d5de71250b3800c1bba72842de351ae11bd48c01732dddfcd02cd58ac79c66c
MD5 381515abdd317790a5a9763744449b45
BLAKE2b-256 9fac932e1b5ad1e210bf8a06a8d6cdf4af9b9998e3cc5db74973de27f574637e

See more details on using hashes here.

Provenance

The following attestation bundles were made for publicip_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on opratr/publicip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page