Skip to content

sindresorhus/ipify-cli

ipify-cli

Get your public IP address

Using the ipify API or a custom ipify instance.

Install

npm install --global ipify-cli

Usage

$ ipify --help

  Usage
    $ ipify

  Options
    --endpoint  Custom API endpoint (can be used multiple times for redundancy)

  Examples
    $ ipify
    2001:0db8:85a3:0000:0000:8a2e:0370:7334
    $ ipify --endpoint=https://ipify.mycompany.com
    2001:0db8:85a3:0000:0000:8a2e:0370:7334
    $ ipify --endpoint=https://api.ipify.org --endpoint=https://ipify.example.org
    2001:0db8:85a3:0000:0000:8a2e:0370:7334

Multiple Endpoints

You can specify multiple endpoints for redundancy. The CLI will try all endpoints concurrently and return the first successful response:

$ ipify --endpoint=https://api.ipify.org --endpoint=https://api64.ipify.org --endpoint=https://backup.example.com

Related

  • ipify - API for this package

About

Get your public IP address

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published