curl
curl Examples
curl is probably already on your machine. It’s the fastest way to test any API, and ours is no exception. No libraries to install, no dependencies to manage. Just your terminal and a URL.
All Seven Endpoints
Get Your Own IP
curl https://whatismyip.technology/api
Returns your public IP address as a JSON object. Simple as it gets.
Full IP Lookup
curl https://whatismyip.technology/api/8.8.8.8
Returns everything we know about that IP: location, ISP, ASN, privacy flags, company info. The whole thing.
Geolocation Only
curl https://whatismyip.technology/api/8.8.8.8/geo
Just the location data. Country, city, region, coordinates, postal code.
ASN and Network Info
curl https://whatismyip.technology/api/8.8.8.8/asn
Autonomous System Number, ISP name, organization, network range.
Privacy and Threat Detection
curl https://whatismyip.technology/api/8.8.8.8/privacy
VPN detection, proxy detection, Tor exit node check, threat flags.
Company and Abuse Info
curl https://whatismyip.technology/api/8.8.8.8/company
Who owns this IP, what kind of org they are, abuse contact details.
Bulk Lookup
curl -X POST https://whatismyip.technology/api/bulk \
-H "Content-Type: application/json" \
-d '{"ips": ["8.8.8.8", "1.1.1.1", "208.67.222.222"]}'
Send up to 100 IPs in one request. Way better than hammering us one at a time.
Pipe to jq for Pretty Output
Raw JSON is fine, but pretty JSON is better.
curl -s https://whatismyip.technology/api/8.8.8.8 | jq .
Pull out specific fields:
curl -s https://whatismyip.technology/api/8.8.8.8 | jq '.city, .country'
Get just the IP as plain text:
curl -s https://whatismyip.technology/api | jq -r '.ip'
Save to a File
curl -s https://whatismyip.technology/api/8.8.8.8 > ip_info.json
Save just the country code:
curl -s https://whatismyip.technology/api/8.8.8.8 | jq -r '.country_code' > country.txt
Use in Shell Scripts
Check if an IP is using a VPN:
#!/bin/bash
IP="$1"
IS_VPN=$(curl -s "https://whatismyip.technology/api/$IP/privacy" | jq -r '.is_vpn')
if [ "$IS_VPN" = "true" ]; then
echo "$IP is behind a VPN"
else
echo "$IP is not using a VPN"
fi
Log your current IP with a timestamp:
#!/bin/bash
MYIP=$(curl -s https://whatismyip.technology/api | jq -r '.ip')
echo "$(date '+%Y-%m-%d %H:%M:%S') $MYIP" >> ip_log.txt
Loop through a list of IPs:
#!/bin/bash
while IFS= read -r ip; do
COUNTRY=$(curl -s "https://whatismyip.technology/api/$ip/geo" | jq -r '.country')
echo "$ip -> $COUNTRY"
sleep 0.5
done < ip_list.txt
That’s curl. No install, no config, no drama. Just URLs and JSON.