ShieldX Toolly
Open a tool Donate
Home Home
Blog Blog
FAQ FAQ
Open a tool Donate
Back to cheatsheets
Developer

IP Address Lookup & Geolocation

Geolocate IP addresses, find ISP, ASN, country, and abuse contact information.

2 snippets Beginner ip-address-lookup
IP geolocationASNISPabuse contact

What you'll learn

  • IP lookup via API
  • ASN lookup via Team Cymru

How to use these snippets

  1. Click the Copy button next to any snippet to copy it to your clipboard.
  2. Paste the code into your project, IDE, or terminal.
  3. Replace placeholder values (like example.com or your-secret) with your actual data.
  4. Review the code comments for important security notes and caveats.
  5. Try the interactive related tool to see the concept in action.
Code Snippets

Copy-paste code snippets

2 ready-to-use snippets for ip address lookup & geolocation. Click copy and paste into your project.

IP lookup via API
                async function lookupIP(ip) {
  // Using ipapi.co (free tier)
  const res = await fetch(
    `https://ipapi.co/${ip}/json/`
  );
  const data = await res.json();

  return {
    country: data.country_name,
    city: data.city,
    isp: data.org,
    asn: data.asn,
    timezone: data.timezone,
    latitude: data.latitude,
    longitude: data.longitude,
  };
}
              
ASN lookup via Team Cymru
                # Map IP to ASN via WHOIS
whois -h whois.cymru.com " -v 8.8.8.8"
# Output: AS|IP|BGP Prefix|CC|Registry|Allocated|AS Name

# Bulk ASN lookup
whois -h whois.cymru.com " -v 8.8.8.8,1.1.1.1"

# Find abuse contact
whois 8.8.8.8 | grep -i "abuse"
              
Tool

Try this concept hands-on with the interactive tool.

100% Free · No signup · No cost

Generate something unguessable right now

148 bits of entropy, a crack-time estimate you can trust, and a clipboard that clears itself after 30 seconds.

Open the toolkit

Part of the Toolly ecosystem · secure.toolly.site