IPGeolocation.io CLI Tool


Overview

The official ipgeolocation Command Line Interface (CLI) provides a fast, lightweight, and script-friendly way to access IPGeolocation.io's set of APIs directly from your terminal. It lets developers, DevOps engineers, network operators, and security teams retrieve IP intelligence without writing code or handling raw HTTP requests.

Using a single executable, you can query IP location, security intelligence, ASN details, time zone, astronomy, abuse contact information, and user agent parsing for your own IP or for any IPv4, IPv6 address, or domain name. The CLI outputs structured, machine-readable data that integrates seamlessly into shell scripts, cron jobs, CI/CD pipelines, monitoring systems, and log-processing workflows.

  • IP Geolocation API: Get all-in-one unified solution for location (city, locality, state, country, accuracy-radius, confidence etc.), currency, ASN (AS number, ASN name, organization, ASN type, date of allocation, routes, upstreams, downstreams, peers), company (company/ISP name, company type, company domain), time zone, user agent string parsing, security (threat_score, is_tor, is_bot, proxy_provider_names, cloud_provider_name, relay_provider_name, vpn_provider_names, is_proxy, is_relay, is_vpn), and abuse contact (route/CIDR network, country, address, email, phone numbers) information.
  • IP Security API: Get security intelligence (threat score, VPN, proxy, Tor, relay, bot, and cloud-provider detection) for an IP address.
  • ASN API: Get ASN details along with peers, upstreams, downstreams, routes, and raw WHOIS.
  • Abuse Contact API: Get abuse emails, phone numbers, kind, organization, route/CIDR network and country.
  • Astronomy API: Get sunrise, sunset, moonrise, moonset, moon phases with precise twilight period times in combination with location information.
  • Time Zone API: Get time zone name, multiple time formats, daylight saving status and its details along with location information.
  • Timezone Convert API: Convert time between time zone names, geo coordinates, location addresses, IATA codes, ICAO codes, or UN/LOCODE.
  • User Agent API: Parse one or more user-agent strings to get browser, operating system, and device details.

The ipgeolocation CLI is built for speed and automation, making it easy to integrate IP intelligence into shell scripts, bash pipelines, cron jobs, and CI/CD workflows. It enriches server logs, firewall events, and SIEM data, supports on-the-fly lookups during incident response, and enables automated fraud detection, geo-based routing, and access control without language-specific dependencies. Designed for system administrators, DevOps engineers, and developers, the CLI delivers consistent, reliable insights directly in the terminal.

Based on:

  • API version: 3.0.0

Official Release:


Requirements

  • Go 1.26.11 or Go 1.27.4, or a newer patched stable version (only for building from source)
  • API Key from IPGeolocation.io

Installation


1. Go install

To install ipgeolocation using go install, run:

go install github.com/IPGeolocation/cli/v2/cmd/ipgeolocation@latest

Make sure $GOBIN or $GOPATH/bin is in your PATH, then run:

ipgeolocation --help

2. Download and build from source

git clone https://github.com/IPGeolocation/cli.git
cd cli
go build -o ipgeolocation ./cmd/ipgeolocation
./ipgeolocation --help

Here, you will need to add $GOBIN or $GOPATH/bin to your PATH as well.

To build release archives for all supported platforms, install govulncheck and run:

go install golang.org/x/vuln/cmd/govulncheck@v1.9.0
bash build-release.sh

The script runs tests, checks the source and each binary, and writes archives and SHA256SUMS to dist/. Tagged releases run the same checks before publishing.

For local HTTPS regression checks, install Node.js and Postman CLI 1.73.0, then run node scripts/test-http.cjs.


3. Download Prebuilt Binaries

I. Overview

These are prebuilt binaries for the IPGeolocation.io CLI tool, version 2.2.0. Users can download these files directly from GitHub Releases or from the table below without needing to build from source.

The CLI provides geolocation information, time zone, user-agent parsing, bulk IP lookups, and more.

II. Prebuilt Binaries

Archives include SHA256SUMS for download verification.

III. Installation Instructions

Linux:

1.
Download the .tar.gz file for your architecture.
2.
Extract it to a folder in your PATH, e.g., /usr/local/bin:
tar -xzf ipgeolocation-2.2.0-linux-amd64.tar.gz -C /usr/local/bin
3.
Rename the binary for simplicity:
mv /usr/local/bin/ipgeolocation-2.2.0-linux-amd64 /usr/local/bin/ipgeolocation
4.
Make the binary executable:
chmod +x /usr/local/bin/ipgeolocation
5.
Verify installation:
ipgeolocation --help

macOS:

1.
Download the .tar.gz file for your architecture (amd64 or arm64).
2.
Extract to a folder in your PATH, e.g., /usr/local/bin:
tar -xzf ipgeolocation-2.2.0-darwin-amd64.tar.gz -C /usr/local/bin
3.
Rename the binary:
mv /usr/local/bin/ipgeolocation-2.2.0-darwin-amd64 /usr/local/bin/ipgeolocation
4.
Make executable:
chmod +x /usr/local/bin/ipgeolocation
5.
Verify installation:
ipgeolocation --help

Windows:

1.
Download the .zip file.
2.
Extract the ipgeolocation-2.2.0-windows-amd64.exe to a folder included in your system PATH.
3.
Rename the binary to ipgeolocation.exe for convenience.
4.
Open Command Prompt and verify:
ipgeolocation --help

4. Troubleshooting

  • Command not found: Ensure the binary is in a folder included in your PATH.
  • Execution permission error: Run chmod +x <binary> on Linux/macOS.
  • Wrong architecture: Download the binary matching your OS and CPU architecture.
  • Go install issues: Use GOPROXY=direct if Go module proxy caching creates issues.

APIs Documentation

The documentation below corresponds to the available APIs:

For a detailed comparison of what each plan offers, visit the Pricing Page.


Fields and commands Availability

IPGeolocation.io offers a free Developer plan and paid plans. The availability of each command across plans is presented below.

Sub CommandDetailsFreePaid
configSet up and check API Key.TickTick
my-ipGet the public IP address of the machine running the command. Does not require an API key.TickTick
ipgeoGet geolocation data for a single IP address, along with network, currency, abuse, time zone, security, ASN, user-agent, etc.TickTick
bulk-ip-geoGet geolocation data for multiple IP addresses in a single API request, along with the same data as in ipgeo.CrossTick
ip-securityGet security intelligence (threat score, VPN, proxy, Tor, relay, bot, and cloud-provider detection) for an IP address.CrossTick
bulk-ip-securityGet security threat intelligence for multiple IP addresses, along with the same data as in ip-security.CrossTick
asnGet details of any AS number or IP address associated with an ASN.CrossTick
abuseGet abuse reporting contact information for a given IP address.CrossTick
astronomyGet sunrise, sunset, moonrise, moonset, and related data for a location.TickTick
astronomy-timeseriesGet astronomy information for a given date range at once.TickTick
timezoneGet time zone details using IP address, city, coordinates, IATA, ICAO, UN/LOCODE, or time zone ID.TickTick
time-conversionConvert time between two specified time zones using city, coordinates, IATA, ICAO, UN/LOCODE, or time zone ID.TickTick
parse-user-agentParse a single user-agent string.CrossTick
parse-bulk-user-agentsParse multiple user-agent strings at once.CrossTick

Authentication Setup

To authenticate API requests, you need to get an API key from IPGeolocation.io.


1. How to Get Your API Key

  1. Sign up here: https://app.ipgeolocation.io/signup
  2. (optional) Verify your email if you signed up using email.
  3. Log in to your account: https://app.ipgeolocation.io/login
  4. After logging in, navigate to your Dashboard to find your API key: https://app.ipgeolocation.io/dashboard

2. ApiKeyAuth

Once you've obtained the api key, configure your API client as follows:

The client must configure the authentication and authorization parameters in accordance with the API server security policy.

ipgeolocation config --apikey=<your-key>

Global Flags

These flags are available for all commands:

FlagDescription
-h, --helpShow help for the command.
--timeoutMaximum time for one API request. Default: 5m (5 minutes). For a longer request, use --timeout 10m.
--max-response-mbMaximum response size in MB. Default: 256. For larger bulk results, use --max-response-mb 512 or another positive whole number.
ipgeolocation --version

Commands


1. config Command

Configure your API key for IPGeolocation.io.

I. config Usage

ipgeolocation config --apikey=<your-key>

II. Flags for config

FlagTypeDescription
--apikeystringYour API key from IPGeolocation.io.

2. my-ip Command

Get the public IP address of the machine running the command, as seen by the ipgeolocation.io API.

I. my-ip Usage

ipgeolocation my-ip [flags]

II. Flags for my-ip

FlagTypeDefaultDescription
--outputstringprettyOutput format: pretty, raw, table, yaml, csv, text.

III. Get your public IP address

ipgeolocation my-ip

Sample output:

Response Preview
{
  "ip": "203.0.113.24"
}

Print only the IP address, which is useful in shell scripts:

MY_IP=$(ipgeolocation my-ip --output text)

echo "$MY_IP"

Sample output:

Response Preview
203.0.113.24

3. ipgeo Command

Look up geolocation information for a single IP address or domain from the ipgeolocation.io API.

I. ipgeo Usage

ipgeolocation ipgeo [flags]

II. Flags for ipgeo

FlagTypeDefaultDescription
--ipstring""IPv4, IPv6, or domain name (e.g. 8.8.8.8, google.com).
--includestring[][]Include extra fields (e.g. hostname,geo_accuracy,dma_code,security,abuse,user_agent).
--fieldsstring[][]Return only specific fields (e.g. location,asn.organization).
--excludestring[][]Exclude fields from output. --excludes is also accepted.
--langstring""Response language.
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Free Plan Examples

Get info about your current IP:

ipgeolocation ipgeo
i. Get Default Fields in Free Plan

Look up a specific IP:

ipgeolocation ipgeo --ip 8.8.8.8

Sample output:

Response Preview
{
  "ip": "8.8.8.8",
  "asn": {
    "as_number": "AS15169",
    "country": "US",
    "organization": "Google LLC"
  },
  "country_metadata": {
    "calling_code": "+1",
    "languages": [
      "en-US",
      "es-US",
      "haw",
      "fr"
    ],
    "tld": ".us"
  },
  "currency": {
    "code": "USD",
    "name": "US Dollar",
    "symbol": "$"
  },
  "location": {
    "city": "Mountain View",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_capital": "Washington, D.C.",
    "country_code2": "US",
    "country_code3": "USA",
    "country_emoji": "🇺🇸",
    "country_flag": "https://ipgeolocation.io/static/flags/us_64.png",
    "country_name": "United States",
    "country_name_official": "United States of America",
    "district": "Santa Clara",
    "geoname_id": "6301403",
    "is_eu": false,
    "latitude": "37.42240",
    "longitude": "-122.08421",
    "state_code": "US-CA",
    "state_prov": "California",
    "zipcode": "94043-1351"
  },
  "time_zone": {
    "current_time": "2026-03-03 03:01:15.329-0800",
    "current_time_unix": 1772535675.329,
    "current_tz_abbreviation": "PST",
    "current_tz_full_name": "Pacific Standard Time",
    "dst_end": {
      "date_time_after": "2026-11-01 TIME 01:00",
      "date_time_before": "2026-11-01 TIME 02:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-11-01 TIME 09:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-08 TIME 03:00",
      "date_time_before": "2026-03-08 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-08 TIME 10:00"
    },
    "dst_tz_abbreviation": "PDT",
    "dst_tz_full_name": "Pacific Daylight Time",
    "is_dst": false,
    "name": "America/Los_Angeles",
    "offset": -8,
    "offset_with_dst": -8,
    "standard_tz_abbreviation": "PST",
    "standard_tz_full_name": "Pacific Standard Time"
  }
}

Filtering response with the use of --fields and --exclude:

ipgeolocation ipgeo --ip 8.8.8.8 --fields=location --exclude location.continent_code,location.continent_name

Sample output:

Response Preview
{
  "ip": "8.8.8.8",
  "location": {
    "city": "Mountain View",
    "country_capital": "Washington, D.C.",
    "country_code2": "US",
    "country_code3": "USA",
    "country_emoji": "🇺🇸",
    "country_flag": "https://ipgeolocation.io/static/flags/us_64.png",
    "country_name": "United States",
    "country_name_official": "United States of America",
    "district": "Santa Clara",
    "geoname_id": "6301403",
    "is_eu": false,
    "latitude": "37.42240",
    "longitude": "-122.08421",
    "state_code": "US-CA",
    "state_prov": "California",
    "zipcode": "94043-1351"
  }
}

IV. Paid Plan Examples

i. Get Default Fields in Paid Plan

Look up a domain name with default fields

ipgeolocation ipgeo --ip google.com

Sample output:

Response Preview
{
  "asn": {
    "as_number": "AS15169",
    "country": "US",
    "date_allocated": "2000-03-30",
    "domain": "google.com",
    "organization": "Google LLC",
    "rir": "ARIN",
    "type": "BUSINESS"
  },
  "company": {
    "domain": "google.com",
    "name": "Google LLC",
    "type": "HOSTING"
  },
  "country_metadata": {
    "calling_code": "+65",
    "languages": [
      "cmn",
      "en-SG",
      "ms-SG",
      "ta-SG",
      "zh-SG"
    ],
    "tld": ".sg"
  },
  "currency": {
    "code": "SGD",
    "name": "Singapore Dollar",
    "symbol": "S$"
  },
  "domain": "google.com",
  "ip": "142.250.4.100",
  "location": {
    "city": "Singapore",
    "continent_code": "AS",
    "continent_name": "Asia",
    "country_capital": "Singapore",
    "country_code2": "SG",
    "country_code3": "SGP",
    "country_emoji": "🇸🇬",
    "country_flag": "https://ipgeolocation.io/static/flags/sg_64.png",
    "country_name": "Singapore",
    "country_name_official": "Republic of Singapore",
    "district": "Singapore",
    "geoname_id": "6951474",
    "is_eu": false,
    "latitude": "1.29041",
    "longitude": "103.85211",
    "state_code": "SG-01",
    "state_prov": "Central Singapore Community Development Council",
    "zipcode": "17"
  },
  "network": {
    "connection_type": "",
    "is_anycast": false,
    "route": "142.250.4.0/24"
  },
  "time_zone": {
    "current_time": "2026-03-03 19:03:29.994+0800",
    "current_time_unix": 1772535809.994,
    "current_tz_abbreviation": "SGT",
    "current_tz_full_name": "Singapore Standard Time",
    "dst_end": {},
    "dst_exists": false,
    "dst_savings": 0,
    "dst_start": {},
    "dst_tz_abbreviation": "",
    "dst_tz_full_name": "",
    "is_dst": false,
    "name": "Asia/Singapore",
    "offset": 8,
    "offset_with_dst": 8,
    "standard_tz_abbreviation": "SGT",
    "standard_tz_full_name": "Singapore Standard Time"
  }
}
ii. Retrieving Geolocation Data in Multiple Languages

Here is an example to get the geolocation data for IP address '2001:4230:4890::1' in French fr language:

ipgeolocation ipgeo --ip 2001:4230:4890::1 --lang fr

Sample output:

Response Preview
{
  "asn": {
    "as_number": "AS0",
    "country": "",
    "date_allocated": "",
    "domain": "",
    "organization": "",
    "rir": "",
    "type": ""
  },
  "company": {
    "domain": "afrinic.net",
    "name": "African Network Information Center AfriNIC Ltd",
    "type": "BUSINESS"
  },
  "country_metadata": {
    "calling_code": "+230",
    "languages": [
      "en-MU",
      "bho",
      "fr"
    ],
    "tld": ".mu"
  },
  "currency": {
    "code": "MUR",
    "name": "Mauritius Rupee",
    "symbol": "₨"
  },
  "ip": "2001:4230:4890:0:0:0:0:1",
  "location": {
    "city": "Quatre Bornes",
    "continent_code": "AF",
    "continent_name": "Afrique",
    "country_capital": "Port Louis",
    "country_code2": "MU",
    "country_code3": "MUS",
    "country_emoji": "🇲🇺",
    "country_flag": "https://ipgeolocation.io/static/flags/mu_64.png",
    "country_name": "Maurice",
    "country_name_official": "",
    "district": "Quatre Bornes",
    "geoname_id": "1106777",
    "is_eu": false,
    "latitude": "-20.24304",
    "longitude": "57.49631",
    "state_code": "MU-PW",
    "state_prov": "Wilhems des plaines",
    "zipcode": "72201"
  },
  "network": {
    "connection_type": "",
    "is_anycast": false,
    "route": ""
  },
  "time_zone": {
    "current_time": "2026-03-03 15:04:29.479+0400",
    "current_time_unix": 1772535869.479,
    "current_tz_abbreviation": "MUT",
    "current_tz_full_name": "Mauritius Standard Time",
    "dst_end": {},
    "dst_exists": false,
    "dst_savings": 0,
    "dst_start": {},
    "dst_tz_abbreviation": "",
    "dst_tz_full_name": "",
    "is_dst": false,
    "name": "Indian/Mauritius",
    "offset": 4,
    "offset_with_dst": 4,
    "standard_tz_abbreviation": "MUT",
    "standard_tz_full_name": "Mauritius Standard Time"
  }
}
iii. Include HostName and User-Agent
ipgeolocation ipgeo --ip 219.100.37.207 --include hostname,user_agent

Sample output:

Response Preview
{
  "asn": {
    "as_number": "AS36599",
    "country": "US",
    "date_allocated": "2017-01-25",
    "domain": "rt.open.ad.jp",
    "organization": "SoftEther Telecommunication Research Institute, LLC",
    "rir": "ARIN",
    "type": "ISP"
  },
  "company": {
    "domain": "softether.co.jp",
    "name": "SoftEther Corporation",
    "type": "BUSINESS"
  },
  "country_metadata": {
    "calling_code": "+81",
    "languages": [
      "ja"
    ],
    "tld": ".jp"
  },
  "currency": {
    "code": "JPY",
    "name": "Yen",
    "symbol": "¥"
  },
  "hostname": "public-vpn-13-15.vpngate.v4.open.ad.jp",
  "ip": "219.100.37.207",
  "location": {
    "city": "Tokyo",
    "continent_code": "AS",
    "continent_name": "Asia",
    "country_capital": "Tokyo",
    "country_code2": "JP",
    "country_code3": "JPN",
    "country_emoji": "🇯🇵",
    "country_flag": "https://ipgeolocation.io/static/flags/jp_64.png",
    "country_name": "Japan",
    "country_name_official": "Japan",
    "district": "Koto",
    "geoname_id": "12149683",
    "is_eu": false,
    "latitude": "35.68467",
    "longitude": "139.80881",
    "state_code": "JP-13",
    "state_prov": "Tokyo Metropolis",
    "zipcode": "135-0022"
  },
  "network": {
    "connection_type": "",
    "is_anycast": false,
    "route": "219.100.37.0/24"
  },
  "time_zone": {
    "current_time": "2026-03-03 20:05:37.058+0900",
    "current_time_unix": 1772535937.058,
    "current_tz_abbreviation": "JST",
    "current_tz_full_name": "Japan Standard Time",
    "dst_end": {},
    "dst_exists": false,
    "dst_savings": 0,
    "dst_start": {},
    "dst_tz_abbreviation": "",
    "dst_tz_full_name": "",
    "is_dst": false,
    "name": "Asia/Tokyo",
    "offset": 9,
    "offset_with_dst": 9,
    "standard_tz_abbreviation": "JST",
    "standard_tz_full_name": "Japan Standard Time"
  },
  "user_agent": {
    "device": {
      "brand": "GO",
      "cpu": "Unknown",
      "name": "GO Http Client",
      "type": "Robot"
    },
    "engine": {
      "name": "Go-http-client",
      "type": "Robot",
      "version": "2.0",
      "version_major": "2"
    },
    "name": "Go-http-client",
    "operating_system": {
      "build": "??",
      "name": "Cloud",
      "type": "Cloud",
      "version": "??",
      "version_major": "??"
    },
    "type": "Robot",
    "user_agent_string": "Go-http-client/2.0",
    "version": "2.0",
    "version_major": "2"
  }
}
iv. Include DMA, Abuse and Security
ipgeolocation ipgeo --ip 8.8.8.8 --include dma_code,abuse,security

Sample output:

Response Preview
{
  "abuse": {
    "address": "1600 Amphitheatre Parkway\nMountain View\nCA\n94043\nUnited States",
    "country": "",
    "emails": [
      "network-abuse@google.com"
    ],
    "kind": "group",
    "name": "Abuse",
    "organization": "Abuse",
    "phone_numbers": [
      "+1-650-253-0000"
    ],
    "route": "8.8.8.0/24"
  },
  "asn": {
    "as_number": "AS15169",
    "country": "US",
    "date_allocated": "2000-03-30",
    "domain": "google.com",
    "organization": "Google LLC",
    "rir": "ARIN",
    "type": "BUSINESS"
  },
  "company": {
    "domain": "google.com",
    "name": "Google LLC",
    "type": "HOSTING"
  },
  "country_metadata": {
    "calling_code": "+1",
    "languages": [
      "en-US",
      "es-US",
      "haw",
      "fr"
    ],
    "tld": ".us"
  },
  "currency": {
    "code": "USD",
    "name": "US Dollar",
    "symbol": "$"
  },
  "ip": "8.8.8.8",
  "location": {
    "city": "Mountain View",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_capital": "Washington, D.C.",
    "country_code2": "US",
    "country_code3": "USA",
    "country_emoji": "🇺🇸",
    "country_flag": "https://ipgeolocation.io/static/flags/us_64.png",
    "country_name": "United States",
    "country_name_official": "United States of America",
    "district": "Santa Clara",
    "dma_code": "807",
    "geoname_id": "6301403",
    "is_eu": false,
    "latitude": "37.42240",
    "longitude": "-122.08421",
    "state_code": "US-CA",
    "state_prov": "California",
    "zipcode": "94043-1351"
  },
  "network": {
    "connection_type": "",
    "is_anycast": true,
    "route": "8.8.8.0/24"
  },
  "security": {
    "cloud_provider_name": "",
    "is_anonymous": false,
    "is_bot": false,
    "is_cloud_provider": false,
    "is_known_attacker": false,
    "is_proxy": false,
    "is_relay": false,
    "is_residential_proxy": false,
    "is_spam": false,
    "is_tor": false,
    "is_vpn": false,
    "proxy_confidence_score": 0,
    "proxy_last_seen": "",
    "proxy_provider_names": [],
    "relay_provider_name": "",
    "threat_score": 0,
    "vpn_confidence_score": 0,
    "vpn_last_seen": "",
    "vpn_provider_names": []
  },
  "time_zone": {
    "current_time": "2026-03-03 03:06:38.417-0800",
    "current_time_unix": 1772535998.417,
    "current_tz_abbreviation": "PST",
    "current_tz_full_name": "Pacific Standard Time",
    "dst_end": {
      "date_time_after": "2026-11-01 TIME 01:00",
      "date_time_before": "2026-11-01 TIME 02:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-11-01 TIME 09:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-08 TIME 03:00",
      "date_time_before": "2026-03-08 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-08 TIME 10:00"
    },
    "dst_tz_abbreviation": "PDT",
    "dst_tz_full_name": "Pacific Daylight Time",
    "is_dst": false,
    "name": "America/Los_Angeles",
    "offset": -8,
    "offset_with_dst": -8,
    "standard_tz_abbreviation": "PST",
    "standard_tz_full_name": "Pacific Standard Time"
  }
}
v. Get only specific fields in YAML:
ipgeolocation ipgeo --ip 1.1.1.1 --fields location --include dma_code,geo_accuracy --output yaml

Sample response:

Response Preview
ip: 1.1.1.1
location:
    accuracy_radius: "27.276"
    city: South Brisbane
    confidence: low
    continent_code: OC
    continent_name: Oceania
    country_capital: Canberra
    country_code2: AU
    country_code3: AUS
    country_emoji: "\U0001F1E6\U0001F1FA"
    country_flag: https://ipgeolocation.io/static/flags/au_64.png
    country_name: Australia
    country_name_official: Commonwealth of Australia
    district: Brisbane
    dma_code: ""
    geoname_id: "10113228"
    is_eu: false
    latitude: "-27.47306"
    locality: South Brisbane
    longitude: "153.01421"
    state_code: AU-QLD
    state_prov: Queensland
    zipcode: "4101"

Similarly, raw, table and pretty formats are also available. Or one can parse the simple response with | jq.


4. bulk-ip-geo Command

Look up geolocation information for multiple IP addresses in one request.

I. bulk-ip-geo Usage

ipgeolocation bulk-ip-geo [flags]

II. Flags for bulk-ip-geo

FlagTypeDefaultDescription
--ipsstring[][]Comma-separated list of IPs. Example: --ips 8.8.8.8,1.1.1.1
--filestring""Path to a text file containing IPs (one per line).
--includestring[][]Include modules not returned by default (e.g. security,abuse).
--excludestring[][]Exclude fields (e.g. currency).
--fieldsstring[][]Return only specific fields (e.g. location,time_zone).
--langstring""Response language (if supported).
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.
--output-filestring""Save output to a file. Writes .csv with --output csv, otherwise .json; the extension is added only if the name lacks it. Example: --output-file results or --output-file results.csv

For further information, please visit IP Geolocation API Documentation.

Look up 3 IP addresses:

ipgeolocation bulk-ip-geo --ips 8.8.8.8,1.1.1.1,192.30.253.112

Look up from a file:

ipgeolocation bulk-ip-geo --file=ips.txt --output-file results

Results will be written to the results.json file.

Output as YAML:

ipgeolocation bulk-ip-geo --ips=8.8.8.8 --output=yaml

Save results to JSON file:

ipgeolocation bulk-ip-geo --ips=8.8.8.8,1.1.1.1 --output-file=output.json

Results will be written to the output.json file. The .json is not added twice, because the name already ends in it.

III. Output Formats

  • pretty (default): Human-readable formatted JSON.
  • raw: Raw API response.
  • table: Tabular display of common fields.
  • yaml: YAML-formatted output.
  • csv: Spreadsheet-friendly CSV. See CSV Output.
  • file: If --output-file is provided, results are saved to a file. With --output csv the file is .csv; otherwise it is .json. The extension is appended only when the name does not already end in it, so results and results.csv both save to results.csv.

5. CSV Output

Lookup and parsing commands accept --output csv, which renders the response as CSV for spreadsheets, awk, cut, or a database import. The config command manages your API key and prints a status message.

ipgeolocation ipgeo --ip 8.8.8.8 --output csv

Sample output:

asn.as_number,asn.country,asn.organization,country_metadata.calling_code,country_metadata.languages,currency.code,ip,location.city,location.is_eu,location.latitude,time_zone.name,time_zone.offset
AS15169,US,Google LLC,+1,en-US|es-US|haw|fr,USD,8.8.8.8,Mountain View,false,37.42240,America/Los_Angeles,-8

How a response becomes CSV:

Response ShapeCSV Result
A top-level array, as the bulk commands returnOne row per record
Anything elseA single row
A nested objectDotted column names, e.g. location.city
An array of scalarsJoined into one cell with |, e.g. en-US|es-US|haw
An array of objectsA column per element, e.g. routes.0.prefix
null, [] or {}An empty cell

Notes:

  • Columns are the union of the fields of every row, sorted by name, so the same response always produces the same file. Where one record lacks a field another has, its cell is empty.
  • Numbers are written exactly as the API returned them, so Unix timestamps and long identifiers keep every digit.
  • Values containing a comma, quote, or newline are quoted per RFC 4180. A value that itself contains | is indistinguishable from the array separator.
  • A value beginning with =, @, a tab, or a carriage return is prefixed with ' so a spreadsheet does not run it as a formula, as is a + or - followed by a non-digit, such as +SUM(A1). A sign followed by a digit, and a sign on its own, are data and are left alone, so a -122.08421 coordinate, a -8 offset, a +1 calling code, the +1.00H and -1.00H DST durations, and the lone - the astronomy endpoint reports for an absent sun_status or moon_status all stay exactly as the API sent them.

Save CSV straight to a file with --output-file on the bulk commands:

ipgeolocation bulk-ip-geo --file=ips.txt --output csv --output-file results

This writes results.csv. Passing --output-file results.csv writes the same file — the extension is added only when it is missing. Without --output csv the same flag writes results.json.

For the other commands, redirect the output:

ipgeolocation ipgeo --ip 8.8.8.8 --output csv > ipgeo.csv

6. ip-security Command

Look up IP security information using the ipgeolocation.io API.

I. ip-security Usage

ipgeolocation ip-security [flags]

II. Flags for ip-security

FlagTypeDefaultDescription
--ipstring""IPv4 or IPv6 address.
--excludestring[][]Exclude fields from output.
--fieldsstring[][]Return only specific fields (e.g. security.threat_score).
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Get Default Fields in ip-security

Get info about your current IP:

ipgeolocation ip-security

Look up a specific IP:

ipgeolocation ip-security --ip 2.56.188.34

Sample output:

Response Preview

{
  "ip": "2.56.188.34",
  "security": {
    "bot_confidence_score": 0,
    "bot_last_seen": "",
    "bot_operator_name": "",
    "bot_type": "",
    "cloud_provider_name": "Clouvider Limited",
    "corporate_gateway_provider_name": "",
    "corporate_gateway_type": "",
    "is_anonymous": true,
    "is_bot": false,
    "is_cloud_provider": true,
    "is_corporate_gateway": false,
    "is_known_attacker": true,
    "is_known_good_bot": false,
    "is_proxy": false,
    "is_relay": false,
    "is_residential_proxy": false,
    "is_spam": false,
    "is_tor": false,
    "is_vpn": true,
    "proxy_confidence_score": 0,
    "proxy_last_seen": "",
    "proxy_provider_names": [],
    "relay_provider_name": "",
    "threat_score": 80,
    "vpn_confidence_score": 70,
    "vpn_last_seen": "",
    "vpn_provider_names": []
  }
}

For full API specifications, refer to the official IP Security API documentation.

IV. Request with Field Filtering ip-security

ipgeolocation ip-security --ip 195.154.221.54 --fields security.is_tor,security.is_proxy,security.is_bot,security.is_spam

Sample output:

Response Preview
{
  "ip": "195.154.221.54",
  "security": {
    "is_bot": false,
    "is_proxy": false,
    "is_spam": false,
    "is_tor": false
  }
}

7. bulk-ip-security Command

Look up IP security information for multiple IP addresses in one request.

I. bulk-ip-security Usage

ipgeolocation bulk-ip-security [flags]

II. Flags for bulk-ip-security

FlagTypeDefaultDescription
--ipsstring[][]Comma-separated list of IPs. Example: --ips 8.8.8.8,1.1.1.1
--filestring""Path to a text file containing IPs (one per line).
--excludestring[][]Exclude fields (e.g. security.is_tor).
--fieldsstring[][]Return only specific fields (e.g. security.threat_score).
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.
--output-filestring""Save output to a file. Writes .csv with --output csv, otherwise .json; the extension is added only if the name lacks it. Example: --output-file results or --output-file results.csv

III. bulk-ip-security Examples

Look up 3 IP addresses:

ipgeolocation bulk-ip-security --ips 8.8.8.8,1.1.1.1,192.30.253.112

Look up from a file:

ipgeolocation bulk-ip-security --file=ips.txt --output-file=output

Results will be written to the output.json file.

Output as YAML:

ipgeolocation bulk-ip-security --ips=8.8.8.8 --output=yaml

Save results to a JSON file:

ipgeolocation bulk-ip-security --ips=8.8.8.8,1.1.1.1 --output-file=output

For further information, please visit Bulk IP Security API Documentation.


8. asn Command

Look up ASN (Autonomous System Number) information using the ipgeolocation.io API.

I. asn Usage

ipgeolocation asn [flags]

II. Flags for asn

FlagTypeDefaultDescription
--ipstring""IPv4 or IPv6 address.
--includestring[][]Include extra fields in output (e.g., peers,downstreams,upstreams,routes,whois_response).
--excludestring[][]Exclude fields from output.
--fieldsstring[][]Return only specific fields (e.g. ip,organization).
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Get ASN Information of your IP

Get ASN information about your current IP address:

ipgeolocation asn

IV. Get ASN Information by ASN Number

Look up a specific ASN. The AS number can be prefixed with 'AS' or 'as':

ipgeolocation asn --asn 15169

Sample output:

Response Preview
{
  "asn": {
    "as_number": "AS15169",
    "organization": "Google LLC",
    "country": "US",
    "asn_name": "GOOGLE",
    "type": "BUSINESS",
    "domain": "google.com",
    "date_allocated": "",
    "allocation_status": "",
    "num_of_ipv4_routes": "1026",
    "num_of_ipv6_routes": "106",
    "rir": "ARIN"
  }
}

V. Combine all objects using Include

Look up a specific IP, including additional fields:

ipgeolocation asn --asn 12 --include routes,peers,upstreams,downstreams,whois_response

Sample output:

Response Preview
{
  "asn": {
    "as_number": "AS12",
    "organization": "New York University",
    "country": "US",
    "asn_name": "NYU-DOMAIN",
    "type": "EDUCATION",
    "domain": "nyu.edu",
    "date_allocated": "",
    "allocation_status": "",
    "num_of_ipv4_routes": "11",
    "num_of_ipv6_routes": "1",
    "rir": "ARIN",
    "routes": [
      "192.76.177.0/24",
      "...",
      "216.165.103.0/24"
    ],
    "upstreams": [
      {
        "as_number": "AS3269",
        "description": "Telecom Italia S.p.A.",
        "country": "IT"
      },
      "...",
      {
        "as_number": "AS137",
        "description": "Consortium GARR",
        "country": "IT"
      }
    ],
    "downstreams": [
      {
        "as_number": "AS394666",
        "description": "NYU Langone Health",
        "country": "US"
      },
      {
        "as_number": "AS54965",
        "description": "Polytechnic Institute of NYU",
        "country": "US"
      }
    ],
    "peers": [
      {
        "as_number": "AS3269",
        "description": "Telecom Italia S.p.A.",
        "country": "IT"
      },
      "...",
      {
        "as_number": "AS54965",
        "description": "Polytechnic Institute of NYU",
        "country": "US"
      }
    ],
    "whois_response": "<raw-whois-response>"
  }
}

Exclude unnecessary fields:

ipgeolocation asn --ip 8.8.8.8 --exclude asn.date_allocated,asn.allocation_status

Sample output:

Response Preview
{
  "asn": {
    "as_number": "AS15169",
    "asn_name": "GOOGLE",
    "country": "US",
    "domain": "google.com",
    "num_of_ipv4_routes": "1024",
    "num_of_ipv6_routes": "135",
    "organization": "Google LLC",
    "rir": "ARIN",
    "type": "BUSINESS"
  },
  "ip": "8.8.8.8"
}

Get only specific fields in table format:

ipgeolocation asn --ip 8.8.8.8 --fields asn.organization,asn.country,asn.downstreams --output table

Output as YAML:

ipgeolocation asn --ip 8.8.8.8 --output=yaml

For further information, please visit ASN API Documentation.


9. abuse Command

Look up IP abuse contact information using the ipgeolocation.io API.

I. abuse Usage

ipgeolocation abuse [flags]

II. Flags for abuse

FlagTypeDefaultDescription
--ipstring""IPv4 or IPv6 address.
--excludestring[][]Exclude fields from output.
--fieldsstring[][]Return only specific fields (e.g. ip,organization).
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Get abuse info about your current IP

ipgeolocation abuse

IV. Look up a specific IP

ipgeolocation abuse --ip 8.8.8.8

V. Exclude unnecessary fields

ipgeolocation abuse --ip 8.8.8.8 --exclude abuse.emails

VI. Lookup Abuse Contact with Specific Fields

ipgeolocation abuse --ip 8.8.8.8 --fields abuse.emails --output table

Sample output:

Response Preview
Ip                  : 8.8.8.8
Abuse:
  Emails:
    [0]:
      network-abuse@google.com

Get output as YAML:

ipgeolocation abuse --ip 8.8.8.8 --output=yaml

Sample output:

Response Preview
abuse:
    address: |-
        1600 Amphitheatre Parkway
        Mountain View
        CA
        94043
        United States
    country: ""
    emails:
        - network-abuse@google.com
    kind: group
    name: Abuse
    organization: Abuse
    phone_numbers:
        - +1-650-253-0000
    route: 8.8.8.0/24
ip: 8.8.8.8

For further information, please visit Abuse API Documentation.


10. timezone Command

Look up time zone information using the ipgeolocation.io API with different query types like IP address, latitude/longitude, and time zone ID.

For full API specifications, refer to the Time Zone API documentation.

I. timezone Usage

ipgeolocation timezone [flags]

II. Flags for timezone

FlagTypeDefaultDescription
--ipstring""IPv4 or IPv6 address.
--tzstring""IANA time zone identifier.
--locationstring""Location name (e.g. New York)
--latitudefloat640Latitude (e.g. 37.7749).
--longitudefloat640Longitude (e.g., -122.4194).
--langstring""Response language (if supported).
--iatastring""IATA code (e.g. DXB).
--icaostring""ICAO code (e.g. KATL).
--lostring""LO code (e.g. DEBER).
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Get time zone info about your current IP

ipgeolocation timezone

IV. Get Timezone for a specific IP Address

ipgeolocation timezone --ip 8.8.8.8

Sample output:

Response Preview
{
  "ip": "8.8.8.8",
  "location": {
    "city": "Mountain View",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_code2": "US",
    "country_code3": "USA",
    "country_name": "United States",
    "country_name_official": "United States of America",
    "district": "Santa Clara",
    "is_eu": false,
    "latitude": "37.42240",
    "longitude": "-122.08421",
    "state_code": "US-CA",
    "state_prov": "California",
    "zipcode": "94043-1351"
  },
  "time_zone": {
    "current_time": "2026-03-03 03:22:55.618-0800",
    "current_time_unix": 1772536975.618,
    "current_tz_abbreviation": "PST",
    "current_tz_full_name": "Pacific Standard Time",
    "date": "2026-03-03",
    "date_time": "2026-03-03 03:22:55",
    "date_time_txt": "Tuesday, March 03, 2026 03:22:55",
    "date_time_wti": "Tue, 03 Mar 2026 03:22:55 -0800",
    "date_time_ymd": "2026-03-03T03:22:55-0800",
    "dst_end": {
      "date_time_after": "2026-11-01 TIME 01:00",
      "date_time_before": "2026-11-01 TIME 02:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-11-01 TIME 09:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-08 TIME 03:00",
      "date_time_before": "2026-03-08 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-08 TIME 10:00"
    },
    "dst_tz_abbreviation": "PDT",
    "dst_tz_full_name": "Pacific Daylight Time",
    "is_dst": false,
    "month": 3,
    "name": "America/Los_Angeles",
    "offset": -8,
    "offset_with_dst": -8,
    "standard_tz_abbreviation": "PST",
    "standard_tz_full_name": "Pacific Standard Time",
    "time_12": "03:22:55 AM",
    "time_24": "03:22:55",
    "week": 10,
    "year": 2026,
    "year_abbr": "26"
  }
}

V. Get Timezone by Timezone Name

ipgeolocation timezone --tz America/New_York

Sample output:

Response Preview
{
  "time_zone": {
    "current_time": "2026-03-03 06:23:30.451-0500",
    "current_time_unix": 1772537010.451,
    "current_tz_abbreviation": "EST",
    "current_tz_full_name": "Eastern Standard Time",
    "date": "2026-03-03",
    "date_time": "2026-03-03 06:23:30",
    "date_time_txt": "Tuesday, March 03, 2026 06:23:30",
    "date_time_wti": "Tue, 03 Mar 2026 06:23:30 -0500",
    "date_time_ymd": "2026-03-03T06:23:30-0500",
    "dst_end": {
      "date_time_after": "2026-11-01 TIME 01:00",
      "date_time_before": "2026-11-01 TIME 02:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-11-01 TIME 06:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-08 TIME 03:00",
      "date_time_before": "2026-03-08 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-08 TIME 07:00"
    },
    "dst_tz_abbreviation": "EDT",
    "dst_tz_full_name": "Eastern Daylight Time",
    "is_dst": false,
    "month": 3,
    "name": "America/New_York",
    "offset": -5,
    "offset_with_dst": -5,
    "standard_tz_abbreviation": "EST",
    "standard_tz_full_name": "Eastern Standard Time",
    "time_12": "06:23:30 AM",
    "time_24": "06:23:30",
    "week": 10,
    "year": 2026,
    "year_abbr": "26"
  }
}

VI. Get Timezone from Any Address

ipgeolocation timezone --location "New York, USA"

Sample output:

Response Preview
{
  "location": {
    "city": "Syracuse",
    "country_name": "United States",
    "latitude": "43.06923",
    "locality": "Destiny USA Mall",
    "location_string": "New York, USA",
    "longitude": "-76.17249",
    "state_prov": "New York"
  },
  "time_zone": {
    "current_time": "2026-03-03 06:24:17.824-0500",
    "current_time_unix": 1772537057.824,
    "current_tz_abbreviation": "EST",
    "current_tz_full_name": "Eastern Standard Time",
    "date": "2026-03-03",
    "date_time": "2026-03-03 06:24:17",
    "date_time_txt": "Tuesday, March 03, 2026 06:24:17",
    "date_time_wti": "Tue, 03 Mar 2026 06:24:17 -0500",
    "date_time_ymd": "2026-03-03T06:24:17-0500",
    "dst_end": {
      "date_time_after": "2026-11-01 TIME 01:00",
      "date_time_before": "2026-11-01 TIME 02:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-11-01 TIME 06:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-08 TIME 03:00",
      "date_time_before": "2026-03-08 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-08 TIME 07:00"
    },
    "dst_tz_abbreviation": "EDT",
    "dst_tz_full_name": "Eastern Daylight Time",
    "is_dst": false,
    "month": 3,
    "name": "America/New_York",
    "offset": -5,
    "offset_with_dst": -5,
    "standard_tz_abbreviation": "EST",
    "standard_tz_full_name": "Eastern Standard Time",
    "time_12": "06:24:17 AM",
    "time_24": "06:24:17",
    "week": 10,
    "year": 2026,
    "year_abbr": "26"
  }
}

VII. Get Timezone from Location Coordinates

ipgeolocation timezone --latitude 37.7749 --longitude -122.4194

Sample output:

Response Preview
{
  "time_zone": {
    "current_time": "2026-03-03 03:25:00.249-0800",
    "current_time_unix": 1772537100.249,
    "current_tz_abbreviation": "PST",
    "current_tz_full_name": "Pacific Standard Time",
    "date": "2026-03-03",
    "date_time": "2026-03-03 03:25:00",
    "date_time_txt": "Tuesday, March 03, 2026 03:25:00",
    "date_time_wti": "Tue, 03 Mar 2026 03:25:00 -0800",
    "date_time_ymd": "2026-03-03T03:25:00-0800",
    "dst_end": {
      "date_time_after": "2026-11-01 TIME 01:00",
      "date_time_before": "2026-11-01 TIME 02:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-11-01 TIME 09:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-08 TIME 03:00",
      "date_time_before": "2026-03-08 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-08 TIME 10:00"
    },
    "dst_tz_abbreviation": "PDT",
    "dst_tz_full_name": "Pacific Daylight Time",
    "is_dst": false,
    "month": 3,
    "name": "America/Los_Angeles",
    "offset": -8,
    "offset_with_dst": -8,
    "standard_tz_abbreviation": "PST",
    "standard_tz_full_name": "Pacific Standard Time",
    "time_12": "03:25:00 AM",
    "time_24": "03:25:00",
    "week": 10,
    "year": 2026,
    "year_abbr": "26"
  }
}

VIII. Get Timezone and Airport Details from IATA Code

ipgeolocation timezone --iata DXB

Sample output:

Response Preview
{
  "airport_details": {
    "city": "Dubai",
    "continent_code": "AS",
    "country_code": "AE",
    "elevation_ft": 62,
    "faa_code": "",
    "iata_code": "DXB",
    "icao_code": "OMDB",
    "latitude": "25.25280",
    "longitude": "55.36440",
    "name": "Dubai International Airport",
    "state_code": "AE-DU",
    "type": "large_airport"
  },
  "time_zone": {
    "current_time": "2026-03-03 15:26:04.634+0400",
    "current_time_unix": 1772537164.634,
    "current_tz_abbreviation": "GST",
    "current_tz_full_name": "Gulf Standard Time",
    "date": "2026-03-03",
    "date_time": "2026-03-03 15:26:04",
    "date_time_txt": "Tuesday, March 03, 2026 15:26:04",
    "date_time_wti": "Tue, 03 Mar 2026 15:26:04 +0400",
    "date_time_ymd": "2026-03-03T15:26:04+0400",
    "dst_end": {},
    "dst_exists": false,
    "dst_savings": 0,
    "dst_start": {},
    "dst_tz_abbreviation": "",
    "dst_tz_full_name": "",
    "is_dst": false,
    "month": 3,
    "name": "Asia/Dubai",
    "offset": 4,
    "offset_with_dst": 4,
    "standard_tz_abbreviation": "GST",
    "standard_tz_full_name": "Gulf Standard Time",
    "time_12": "03:26:04 PM",
    "time_24": "15:26:04",
    "week": 10,
    "year": 2026,
    "year_abbr": "26"
  }
}

IX. Get Timezone and City Details from UN/LOCODE

ipgeolocation timezone --lo DEBER

Sample output:

Response Preview
{
  "lo_code_details": {
    "city": "Berlin",
    "country_code": "DE",
    "country_name": "",
    "latitude": "52.51667",
    "lo_code": "DEBER",
    "location_type": "Port, Rail Terminal, Road Terminal, Airport, Postal Exchange",
    "longitude": "13.38333",
    "state_code": "BE"
  },
  "time_zone": {
    "current_time": "2026-03-03 12:26:32.849+0100",
    "current_time_unix": 1772537192.849,
    "current_tz_abbreviation": "CET",
    "current_tz_full_name": "Central European Standard Time",
    "date": "2026-03-03",
    "date_time": "2026-03-03 12:26:32",
    "date_time_txt": "Tuesday, March 03, 2026 12:26:32",
    "date_time_wti": "Tue, 03 Mar 2026 12:26:32 +0100",
    "date_time_ymd": "2026-03-03T12:26:32+0100",
    "dst_end": {
      "date_time_after": "2026-10-25 TIME 02:00",
      "date_time_before": "2026-10-25 TIME 03:00",
      "duration": "-1.00H",
      "gap": false,
      "overlap": true,
      "utc_time": "2026-10-25 TIME 01:00"
    },
    "dst_exists": true,
    "dst_savings": 0,
    "dst_start": {
      "date_time_after": "2026-03-29 TIME 03:00",
      "date_time_before": "2026-03-29 TIME 02:00",
      "duration": "+1.00H",
      "gap": true,
      "overlap": false,
      "utc_time": "2026-03-29 TIME 01:00"
    },
    "dst_tz_abbreviation": "CEST",
    "dst_tz_full_name": "Central European Summer Time",
    "is_dst": false,
    "month": 3,
    "name": "Europe/Berlin",
    "offset": 1,
    "offset_with_dst": 1,
    "standard_tz_abbreviation": "CET",
    "standard_tz_full_name": "Central European Standard Time",
    "time_12": "12:26:32 PM",
    "time_24": "12:26:32",
    "week": 10,
    "year": 2026,
    "year_abbr": "26"
  }
}

Output as YAML:

ipgeolocation timezone --ip 8.8.8.8 --output=yaml

11. time-conversion Command

Convert between time zones using the ipgeolocation.io API to convert a specific time from one time zone to another using time zone identifiers and optional date/time inputs.

For more details, refer to the official documentation: Timezone Converter API.

I. time-conversion Usage

ipgeolocation time-conversion [flags]

II. Flags for time-conversion

FlagTypeDefaultDescription
--tz_fromstring""Time zone to convert from.
--tz_tostring""Time zone to convert to.
--location_fromstring""Location to convert from.
--location_tostring""Location to convert to.
--lat_fromfloat640Latitude to convert from.
--long_fromfloat640Longitude to convert from.
--lat_tofloat640Latitude to convert to.
--long_tofloat640Longitude to convert to.
--iata_fromstring""IATA code to convert from.
--iata_tostring""IATA code to convert to.
--icao_fromstring""ICAO code to convert from.
--icao_tostring""ICAO code to convert to.
--lo_fromstring""LO code to convert from.
--lo_tostring""LO code to convert to.
--timestring""Time to convert.
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Convert Current Time from One Timezone to Another

ipgeolocation time-conversion --tz_from America/New_York --tz_to Europe/London

Sample output:

Response Preview
{
  "original_time": "2026-01-13 07:22:43",
  "converted_time": "2026-01-13 12:22:43",
  "diff_hour": 5,
  "diff_min": 300
}

Convert from one location to another:

ipgeolocation time-conversion --location_from "New York" --location_to London

Convert from one latitude and longitude to another:

ipgeolocation time-conversion --lat_from 37.7749 --long_from -122.4194 --lat_to 51.509865 --long_to -0.118092

Convert from one IATA code to another:

ipgeolocation time-conversion --iata_from DXB --iata_to JFK

Convert from one ICAO code to another (Atlanta to Newark):

ipgeolocation time-conversion --icao_from KATL --icao_to KEWR

Convert from one UN/LOCODE to another (Berlin to New York):

ipgeolocation time-conversion --lo_from DEBER --lo_to USNYC

Output as YAML:

ipgeolocation time-conversion --tz_from America/New_York --tz_to Europe/London --output=yaml

12. astronomy Command

The astronomy command uses the IPGeolocation.io Astronomy API to fetch astronomy-related data such as:

  • Sunrise and sunset
  • Solar noon
  • Moonrise and moonset
  • Moon phase
  • Day length

Choose the calculation location with an IP address, location name, or latitude/longitude. Use --tz to display the event times in another IANA time zone; it does not select a location.

For further information, please visit Astronomy API Documentation.

I. astronomy Usage

ipgeolocation astronomy [flags]

II. Flags for astronomy

FlagTypeDefaultDescription
--ipstring""IPv4 or IPv6 address.
--locationstring""City name.
--latitudefloat640Latitude.
--longitudefloat640Longitude.
--langstring""Response language (if supported).
--tzstring""IANA time zone for output timestamps.
--elevationfloat640Elevation.
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Lookup Astronomy API by Coordinates

Get astronomy info about a specific latitude and longitude:

ipgeolocation astronomy --latitude 37.7749 --longitude -122.4194

Sample output:

Response Preview
{
  "astronomy": {
    "current_time": "05:07:18.340",
    "date": "2026-01-13",
    "day_length": "09:50",
    "evening": {
      "astronomical_twilight_begin": "18:14",
      "astronomical_twilight_end": "18:45",
      "blue_hour_begin": "17:30",
      "blue_hour_end": "17:52",
      "civil_twilight_begin": "17:13",
      "civil_twilight_end": "17:41",
      "golden_hour_begin": "16:33",
      "golden_hour_end": "17:30",
      "nautical_twilight_begin": "17:41",
      "nautical_twilight_end": "18:14"
    },
    "mid_night": "00:18",
    "moon_altitude": 16.07194223979877,
    "moon_angle": 301.4632703453228,
    "moon_azimuth": 138.83883667429063,
    "moon_distance": 405270.18931629026,
    "moon_illumination_percentage": "-23.90",
    "moon_parallactic_angle": -34.64165014870525,
    "moon_phase": "WANING_CRESCENT",
    "moon_status": "-",
    "moonrise": "03:17",
    "moonset": "12:53",
    "morning": {
      "astronomical_twilight_begin": "05:51",
      "astronomical_twilight_end": "06:23",
      "blue_hour_begin": "06:44",
      "blue_hour_end": "07:06",
      "civil_twilight_begin": "06:55",
      "civil_twilight_end": "07:23",
      "golden_hour_begin": "07:06",
      "golden_hour_end": "08:04",
      "nautical_twilight_begin": "06:23",
      "nautical_twilight_end": "06:55"
    },
    "night_begin": "18:45",
    "night_end": "05:51",
    "solar_noon": "12:18",
    "sun_altitude": -26.63562944381545,
    "sun_azimuth": 97.35878744233418,
    "sun_distance": 147120665.60394213,
    "sun_status": "-",
    "sunrise": "07:23",
    "sunset": "17:13"
  },
  "location": {
    "city": "San Francisco",
    "country_name": "United States",
    "elevation": "16",
    "latitude": "37.77490",
    "locality": "South of Market",
    "longitude": "-122.41940",
    "state_prov": "California"
  }
}

IV. Lookup Astronomy API by IP Address

Get astronomy info about your current IP:

ipgeolocation astronomy

Get astronomy information for a specific IP address:

ipgeolocation astronomy --ip 8.8.8.8

Sample output:

Response Preview
{
  "astronomy": {
    "current_time": "05:09:04.314",
    "date": "2026-01-13",
    "day_length": "09:50",
    "evening": {
      "astronomical_twilight_begin": "18:13",
      "astronomical_twilight_end": "18:44",
      "blue_hour_begin": "17:30",
      "blue_hour_end": "17:51",
      "civil_twilight_begin": "17:12",
      "civil_twilight_end": "17:41",
      "golden_hour_begin": "16:33",
      "golden_hour_end": "17:30",
      "nautical_twilight_begin": "17:41",
      "nautical_twilight_end": "18:13"
    },
    "mid_night": "00:16",
    "moon_altitude": 16.728478792843955,
    "moon_angle": 301.47655895571256,
    "moon_azimuth": 139.37283119065324,
    "moon_distance": 405270.54014008155,
    "moon_illumination_percentage": "-23.89",
    "moon_parallactic_angle": -34.405427656780056,
    "moon_phase": "WANING_CRESCENT",
    "moon_status": "-",
    "moonrise": "03:15",
    "moonset": "12:53",
    "morning": {
      "astronomical_twilight_begin": "05:50",
      "astronomical_twilight_end": "06:21",
      "blue_hour_begin": "06:42",
      "blue_hour_end": "07:04",
      "civil_twilight_begin": "06:53",
      "civil_twilight_end": "07:21",
      "golden_hour_begin": "07:04",
      "golden_hour_end": "08:01",
      "nautical_twilight_begin": "06:21",
      "nautical_twilight_end": "06:53"
    },
    "night_begin": "18:44",
    "night_end": "05:50",
    "solar_noon": "12:17",
    "sun_altitude": -25.978681889301882,
    "sun_azimuth": 97.96459578152059,
    "sun_distance": 147120665.60394216,
    "sun_status": "-",
    "sunrise": "07:21",
    "sunset": "17:12"
  },
  "ip": "8.8.8.8",
  "location": {
    "city": "Mountain View",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_code2": "US",
    "country_code3": "USA",
    "country_name": "United States",
    "country_name_official": "United States of America",
    "district": "Santa Clara",
    "elevation": "3",
    "is_eu": false,
    "latitude": "37.42240",
    "locality": "Charleston Terrace",
    "longitude": "-122.08421",
    "state_code": "US-CA",
    "state_prov": "California",
    "zipcode": "94043-1351"
  }
}

V. Lookup Astronomy API by Location String

ipgeolocation astronomy --location "New York, USA"

Sample output:

Response Preview
{
  "astronomy": {
    "current_time": "08:10:53.180",
    "date": "2026-01-13",
    "day_length": "09:23",
    "evening": {
      "astronomical_twilight_begin": "17:59",
      "astronomical_twilight_end": "18:34",
      "blue_hour_begin": "17:12",
      "blue_hour_end": "17:36",
      "civil_twilight_begin": "16:55",
      "civil_twilight_end": "17:24",
      "golden_hour_begin": "16:08",
      "golden_hour_end": "17:12",
      "nautical_twilight_begin": "17:24",
      "nautical_twilight_end": "17:59"
    },
    "mid_night": "00:13",
    "moon_altitude": 23.12401867639373,
    "moon_angle": 301.4902102354391,
    "moon_azimuth": 183.36677049153406,
    "moon_distance": 405270.8986986421,
    "moon_illumination_percentage": "-23.88",
    "moon_parallactic_angle": 2.6870094296532643,
    "moon_phase": "WANING_CRESCENT",
    "moon_status": "-",
    "moonrise": "03:20",
    "moonset": "12:27",
    "morning": {
      "astronomical_twilight_begin": "05:53",
      "astronomical_twilight_end": "06:27",
      "blue_hour_begin": "06:50",
      "blue_hour_end": "07:14",
      "civil_twilight_begin": "07:02",
      "civil_twilight_end": "07:32",
      "golden_hour_begin": "07:14",
      "golden_hour_end": "08:18",
      "nautical_twilight_begin": "06:27",
      "nautical_twilight_end": "07:02"
    },
    "night_begin": "18:34",
    "night_end": "05:53",
    "solar_noon": "12:13",
    "sun_altitude": 4.828766240317727,
    "sun_azimuth": 125.48815354581939,
    "sun_distance": 147120665.60394213,
    "sun_status": "-",
    "sunrise": "07:32",
    "sunset": "16:55"
  },
  "location": {
    "city": "Syracuse",
    "country_name": "United States",
    "elevation": "128",
    "latitude": "43.06923",
    "locality": "Destiny USA Mall",
    "location_string": "New York, USA",
    "longitude": "-76.17249",
    "state_prov": "New York"
  }
}

13. astronomy-timeseries Command

The astronomy-timeseries command uses the IPGeolocation.io Astronomy API to fetch astronomy-related data such as:

  • Sunrise and sunset
  • Solar noon
  • Moonrise and moonset
  • Moon phase
  • Day length

Choose the calculation location with an IP address, location name, or latitude/longitude.

For further information, please visit Astronomy Timeseries API Documentation.

I. astronomy-timeseries Usage

ipgeolocation astronomy-timeseries [flags]

II. Flags for astronomy-timeseries

FlagTypeDefaultDescription
--ipstring""IPv4 or IPv6 address.
--locationstring""City name.
--latitudefloat640Latitude.
--longitudefloat640Longitude.
--langstring""Response language (if supported).
--start-datestring""Start date (e.g. 2023-01-01) Only YYYY-MM-DD.
--end-datestring""End date (e.g. 2023-12-31) Only YYYY-MM-DD
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

III. Get astronomy timeseries info for an IP address

For your own IP address

ipgeolocation astronomy-timeseries --start-date 2023-01-01 --end-date 2023-01-02

IV. Get astronomy timeseries about a specific lat and lon

ipgeolocation astronomy-timeseries --latitude 37.7749 --longitude -122.4194 --start-date 2023-01-01 --end-date 2023-01-02

V. Get astronomy timeseries about a specific location

ipgeolocation astronomy-timeseries --location "New York, USA" --start-date 2023-01-01 --end-date 2023-01-02

Sample output:

Response Preview
{
  "astronomy": [
    {
      "date": "2023-01-01",
      "day_length": "09:08",
      "evening": {
        "astronomical_twilight_begin": "17:48",
        "astronomical_twilight_end": "18:23",
        "blue_hour_begin": "17:00",
        "blue_hour_end": "17:24",
        "civil_twilight_begin": "16:42",
        "civil_twilight_end": "17:12",
        "golden_hour_begin": "15:54",
        "golden_hour_end": "17:00",
        "nautical_twilight_begin": "17:12",
        "nautical_twilight_end": "17:48"
      },
      "mid_night": "00:08",
      "moon_phase": "WAXING_GIBBOUS",
      "moon_status": "-",
      "moonrise": "12:59",
      "moonset": "02:38",
      "morning": {
        "astronomical_twilight_begin": "05:53",
        "astronomical_twilight_end": "06:28",
        "blue_hour_begin": "06:51",
        "blue_hour_end": "07:16",
        "civil_twilight_begin": "07:04",
        "civil_twilight_end": "07:34",
        "golden_hour_begin": "07:16",
        "golden_hour_end": "08:22",
        "nautical_twilight_begin": "06:28",
        "nautical_twilight_end": "07:04"
      },
      "night_begin": "18:23",
      "night_end": "05:53",
      "solar_noon": "12:08",
      "sun_status": "-",
      "sunrise": "07:34",
      "sunset": "16:42"
    },
    {
      "date": "2023-01-02",
      "day_length": "09:09",
      "evening": {
        "astronomical_twilight_begin": "17:49",
        "astronomical_twilight_end": "18:23",
        "blue_hour_begin": "17:01",
        "blue_hour_end": "17:25",
        "civil_twilight_begin": "16:43",
        "civil_twilight_end": "17:13",
        "golden_hour_begin": "15:55",
        "golden_hour_end": "17:01",
        "nautical_twilight_begin": "17:13",
        "nautical_twilight_end": "17:49"
      },
      "mid_night": "00:08",
      "moon_phase": "WAXING_GIBBOUS",
      "moon_status": "-",
      "moonrise": "13:25",
      "moonset": "03:45",
      "morning": {
        "astronomical_twilight_begin": "05:53",
        "astronomical_twilight_end": "06:28",
        "blue_hour_begin": "06:52",
        "blue_hour_end": "07:16",
        "civil_twilight_begin": "07:04",
        "civil_twilight_end": "07:34",
        "golden_hour_begin": "07:16",
        "golden_hour_end": "08:22",
        "nautical_twilight_begin": "06:28",
        "nautical_twilight_end": "07:04"
      },
      "night_begin": "18:23",
      "night_end": "05:53",
      "solar_noon": "12:08",
      "sun_status": "-",
      "sunrise": "07:34",
      "sunset": "16:43"
    }
  ],
  "location": {
    "city": "Syracuse",
    "country_name": "United States",
    "elevation": "128",
    "latitude": "43.06923",
    "locality": "Destiny USA Mall",
    "location_string": "New York, USA",
    "longitude": "-76.17249",
    "state_prov": "New York"
  }
}

14. parse-user-agent Command

The parse-user-agent command uses the IPGeolocation.io User Agent API to parse user agent strings and extract relevant information such as:

  • Device type
  • Operating system
  • Browser
  • Browser version
  • Device vendor
  • Device model

I. parse-user-agent Usage

ipgeolocation parse-user-agent [flags]

II. Flags for parse-user-agent

FlagTypeDefaultDescription
--user-agentstring""User agent string.
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

For further information, please visit User Agent API Documentation.

III. Parse a user agent string

ipgeolocation parse-user-agent --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"

Sample output:

Response Preview
{
  "device": {
    "brand": "Unknown",
    "cpu": "Intel x86_64",
    "name": "Desktop",
    "type": "Desktop"
  },
  "engine": {
    "name": "Blink",
    "type": "Browser",
    "version": "58.0",
    "version_major": "58"
  },
  "name": "Chrome",
  "operating_system": {
    "build": "??",
    "name": "Windows NT",
    "type": "Desktop",
    "version": "10.0",
    "version_major": "10"
  },
  "type": "Browser",
  "user_agent_string": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
  "version": "58.0.3029.110",
  "version_major": "58"
}

15. parse-bulk-user-agents Command

The parse-bulk-user-agents command uses the bulk endpoint of the IPGeolocation.io User Agent API to parse multiple user agent strings and extract relevant information such as:

  • Device type
  • Operating system
  • Browser
  • Browser version
  • Device vendor
  • Device model

I. parse-bulk-user-agents Usage

ipgeolocation parse-bulk-user-agents [flags]

II. Flags for parse-bulk-user-agents

FlagTypeDefaultDescription
--user-agentsstring[][]User agent strings.
--outputstringprettyOutput format: pretty, raw, table, yaml, csv.

For further information, please visit User Agent API bulk parsing documentation.

III. Parse multiple user agent strings

ipgeolocation parse-bulk-user-agents --user-agents "Mozilla/5.0 (Windows NT 10.0; Win64; x64)","curl/7.64.1"

Sample output:

Response Preview
[
  {
    "device": {
      "brand": "Unknown",
      "cpu": "Intel x86_64",
      "name": "Desktop",
      "type": "Desktop"
    },
    "engine": {
      "name": "Mozilla",
      "type": "Browser",
      "version": "5.0",
      "version_major": "5"
    },
    "name": "Windows NT",
    "operating_system": {
      "build": "??",
      "name": "Windows NT",
      "type": "Desktop",
      "version": "10.0",
      "version_major": "10"
    },
    "type": "Browser",
    "user_agent_string": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
    "version": "10.0",
    "version_major": "10"
  },
  {
    "device": {
      "brand": "Curl",
      "cpu": "Unknown",
      "name": "Curl",
      "type": "Robot"
    },
    "engine": {
      "name": "curl",
      "type": "Robot",
      "version": "7.64.1",
      "version_major": "7"
    },
    "name": "Curl",
    "operating_system": {
      "build": "??",
      "name": "Cloud",
      "type": "Cloud",
      "version": "??",
      "version_major": "??"
    },
    "type": "Robot",
    "user_agent_string": "curl/7.64.1",
    "version": "7.64.1",
    "version_major": "7"
  }
]

License

This project is released under the MIT License.

Subscribe to Our Newsletter

Get the latest in geolocation tech, straight to your inbox.