Skip to main content

Fetch your public IP address from external sources with Python.

Project description

whatismyip

Fetch your public IP address from external sources with Python.

Install with pip install whatismyip

Example:

>>> import whatismyip
>>> whatismyip.amionline()
True
>>> whatismyip.whatismyip()
'69.89.31.226'
>>> whatismyip.whatismyipv4()
'69.89.31.226'
>>> whatismyip.whatismyipv6()
'2345:0425:2CA1:0000:0000:0567:5673:23b5'

On average these ip-finding functions take about half a second to run. Your results may vary.

Because whatismyip relies on online services, you always want to update to the latest version. This module uses calendar versioning, such as version 2021.8.5 for the version released on August 5, 2021.

How Does whatismyip Work?

There are several public STUN (Session Traversal Utilities for NAT) servers that return your IP address (as it appears to them). There are also several public websites that you can view in your browser:

The whatismyip module does not have any dependencies outside the Python standard library. It does not require Requests to be installed.

Support

If you find this project helpful and would like to support its development, consider donating to its creator on Patreon.

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

WhatIsMyIP-2022.2.20.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file WhatIsMyIP-2022.2.20.tar.gz.

File metadata

  • Download URL: WhatIsMyIP-2022.2.20.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for WhatIsMyIP-2022.2.20.tar.gz
Algorithm Hash digest
SHA256 d8e1251f7f9feff2c20039292ba0c59386564ab408336c7836e59d827cd8bd62
MD5 9fd9a02fa276fd79e41dc60b6870b447
BLAKE2b-256 de528aff25cf87e46b3cf59c2eed58a67e0dd441cc6664559e08ea56b6d4a330

See more details on using hashes here.

Provenance

Supported by

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