Look up ip geolocation

When the user asks where an IP address is, what city/region/country it's in, who operates it, or what timezone it uses — reach for IPinfo. Single unauthenticated GET returns geolocation, network, and timezone data.

look-up-ip-geolocation · v1 · updated 2026-04-16

Agents: This page is a SKILL.md-style capability guide. For JSON, call GET /api/skills/look-up-ip-geolocation. To drop this into a local Claude Code install, copy the frontmatter + body below into ~/.claude/skills/look-up-ip-geolocation/SKILL.md.

When to use this skill

When the user asks where an IP address is located — city, region, country, coordinates, timezone, postal code — or who operates it (ASN, organization name). Also covers "what's my IP" and "what timezone is this IP in" questions. For ASN details beyond the org line, company data, carrier info, or abuse contacts, a paid IPinfo token is required — this skill covers the free-tier geolocation and network fields. For broader network intelligence (whois, routing), this is the wrong skill.

Your best first call

curl "https://ipinfo.io/8.8.8.8/json"

No auth. No key. Replace 8.8.8.8 with any IPv4 or IPv6 address. Returns a single JSON object with city, region, country, coordinates, postal code, timezone, hostname, and org. For your own IP, omit the address: https://ipinfo.io/json.

Key fields: - ip — the queried address - city, region, country — location hierarchy (country is ISO 3166-1 alpha-2, e.g. US) - loc"lat,lng" string (not an object — split on the comma for separate values) - org — ASN + organization (e.g. AS15169 Google LLC) - hostname — reverse DNS entry; the quickest signal for residential vs data-center traffic - anycast — present and true only when IPinfo detects multi-location advertising (8.8.8.8 is one) - readme — always https://ipinfo.io/missingauth on free-tier responses; a sales prompt, not a documentation link

Fallbacks (when the best call isn't enough)

Pitfalls

One-line summary for the user

I can look up any IP address on ipinfo.io and return its city, region, country, coordinates, timezone, and network operator in a single unauthenticated GET — or fetch just one field as plain text.

APIs this skill uses

IPinfo · primary · verified

Free IP data API provider specializing in IP geolocation. Returns JSON response containing data fields describing the specified IP's region, country, city, postal code, coordinates, and more. Note: Some endpoints (ASN details, company, carr…

Generated from

IPinfo tutorial Getting Started with IPinfo

SKILL.md source (frontmatter + body)
---
name: look-up-ip-geolocation
description: When the user asks where an IP address is, what city/region/country it's in, who operates it, or what timezone it uses — reach for IPinfo. Single unauthenticated GET returns geolocation, network, and timezone data.
---

## When to use this skill

When the user asks where an IP address is located — city, region, country, coordinates, timezone, postal code — or who operates it (ASN, organization name). Also covers "what's my IP" and "what timezone is this IP in" questions. For ASN details beyond the `org` line, company data, carrier info, or abuse contacts, a paid IPinfo token is required — this skill covers the free-tier geolocation and network fields. For broader network intelligence (whois, routing), this is the wrong skill.

## Your best first call

```bash
curl "https://ipinfo.io/8.8.8.8/json"
```

No auth. No key. Replace `8.8.8.8` with any IPv4 or IPv6 address. Returns a single JSON object with city, region, country, coordinates, postal code, timezone, hostname, and org. For your own IP, omit the address: `https://ipinfo.io/json`.

Key fields:
- `ip` — the queried address
- `city`, `region`, `country` — location hierarchy (`country` is ISO 3166-1 alpha-2, e.g. `US`)
- `loc` — `"lat,lng"` string (not an object — split on the comma for separate values)
- `org` — ASN + organization (e.g. `AS15169 Google LLC`)
- `hostname` — reverse DNS entry; the quickest signal for residential vs data-center traffic
- `anycast` — present and `true` only when IPinfo detects multi-location advertising (8.8.8.8 is one)
- `readme` — always `https://ipinfo.io/missingauth` on free-tier responses; a sales prompt, not a documentation link

## Fallbacks (when the best call isn't enough)

- **Need just one field** → append a field name to the URL for plain-text output: `https://ipinfo.io/8.8.8.8/timezone` returns `America/Los_Angeles`. Available suffixes: `/city`, `/region`, `/country`, `/loc`, `/org`, `/postal`, `/timezone`, `/hostname`. Responses are `text/plain`, not JSON.
- **Need your own IP's location** → `https://ipinfo.io/json` with no IP address. IPinfo geolocates the requester automatically.

## Pitfalls

- `loc` is a comma-separated string (`"37.4056,-122.0775"`), not a JSON object. Code that accesses `loc.lat` or `loc.latitude` will fail — split on the comma.
- The plain-text suffix endpoints (`/city`, `/country`, etc.) return `text/plain`, not `application/json`. If your HTTP client parses by Content-Type, use `/{ip}/json` and extract the field yourself.
- `/{ip}/geo` returns nearly the same object as `/{ip}/json` — despite the name suggesting geolocation only, it includes `hostname` and `org`. The only difference is the missing `anycast` field. Don't call `/geo` expecting a smaller payload.
- The `readme` field is a sales prompt for IPinfo's paid tier. Ignore it unless you're considering upgrading.

## One-line summary for the user

I can look up any IP address on ipinfo.io and return its city, region, country, coordinates, timezone, and network operator in a single unauthenticated GET — or fetch just one field as plain text.

« Back to all skills