Skip to main content

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

Metadata

Release files for publicip-cli 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for publicip-cli 0.1.2
File Size Uploaded Provenance Actions
publicip_cli-0.1.2.tar.gz 61.4 kB With provenance Details for publicip_cli-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for publicip-cli 0.1.2
File Interpreter ABI Platform Actions
publicip_cli-0.1.2-py3-none-any.whl Python 3 none any Details for publicip_cli-0.1.2-py3-none-any.whl

Total release size: 70.2 kB

Release files / publicip_cli-0.1.2.tar.gz

Download URL publicip_cli-0.1.2.tar.gz
Size 61.4 kB
Tags Source
SHA-256 checksum
How to use checksums
12b342e27bee381ba11f6ab00c49f8c0b2f24952e976910440dfb11ebc721029
BLAKE2b-256 checksum
How to use checksums
4c3b2cd689cc413fced0e8227deb4027178656016664cfb37ff98de3bcd03aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

Release files / publicip_cli-0.1.2-py3-none-any.whl

Download URL publicip_cli-0.1.2-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc9aa27d7ed21d14e56195c972f2a9c8689f9616931662525712e0ab8f15ce9e
BLAKE2b-256 checksum
How to use checksums
fcfc5fba2122e4d0b4db039d9acbc9f0de7520c0f57a70a0a0c9f3abc0cbf0de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

Security for publicip-cli 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for publicip_cli-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page