Raw JSON Output
Overview
Section titled “Overview”The -r / --raw flag outputs clean JSON instead of the formatted table. This makes ipwhoami composable with other tools.
ipwhoami -r 8.8.8.8{ "ip": "8.8.8.8", "city": "Mountain View", "region": "California", "country": "US", "org": "AS15169 Google LLC", "location": "37.4056,-122.0775", "timezone": "America/Los_Angeles"}Pipe to jq
Section titled “Pipe to jq”Extract specific fields:
# Get just the cityipwhoami -r 8.8.8.8 | jq -r .city# Mountain View
# Get coordinatesipwhoami -r 8.8.8.8 | jq -r .location# 37.4056,-122.0775Use in Scripts
Section titled “Use in Scripts”#!/bin/bashIP="8.8.8.8"COUNTRY=$(ipwhoami -r "$IP" | jq -r .country)
if [ "$COUNTRY" = "US" ]; then echo "US-based IP"fiRaw Compare Mode
Section titled “Raw Compare Mode”Combine -r with -c to get JSON from all providers:
ipwhoami -c -r 1.1.1.1Each provider’s output is a separate JSON object, prefixed with a comment line (// ipinfo, // ipapi, etc.) for easy parsing.