IPinfo API: Get IP location
Finds the public location and network operator of an IPv4 or IPv6 address. Private and reserved addresses have no public location.
Unofficial. Not affiliated with or endorsed by IPinfo.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Ip Address, required
ip_address Public IPv4 or IPv6 address, for example 8.8.8.8.
8.8.8.8
Input as JSON
{ "ip_address": "8.8.8.8"}Output
{ "city": "Mountain View", "region": "California", "hostname": "dns.google", "latitude": 38.0088, "longitude": -122.1175, "time_zone": "America/Los_Angeles" , "ip_address": "8.8.8.8", "ipinfo_link": "https://ipinfo.io/8.8.8.8" , "postal_code": "94043", "country_code": "US", "country_name": "United States", "organization": "Google LLC", "network_number": "AS15169"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"ipinfo.io/get_ip_location","input":{"ip_address":"8.8.8.8"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "ipinfo.io/get_ip_location" , "input": { "ip_address": "8.8.8.8" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "ipinfo.io/get_ip_location" , "input": { "ip_address": "8.8.8.8" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run ipinfo.io/get_ip_location# with {"ip_address":"8.8.8.8"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "ip_address" ], "properties": { "ip_address": { "type": "string", "description": "Public IPv4 or IPv6 address, for example 8.8.8.8." } }}Output schema
{ "type": "object", "required": [ "ip_address", "hostname", "city", "region", "country_name", "country_code", "postal_code", "time_zone", "organization", "network_number", "ipinfo_link", "latitude", "longitude" ], "properties": { "city": { "type": [ "string", "null" ], "description": "City, if available." }, "region": { "type": [ "string", "null" ], "description": "Region or state, if available." }, "hostname": { "type": [ "string", "null" ], "description": "Hostname, if available." }, "latitude": { "type": [ "number", "null" ], "description": "Latitude, if available." }, "longitude": { "type": [ "number", "null" ], "description": "Longitude, if available." }, "time_zone": { "type": [ "string", "null" ], "description": "IANA time zone, if available." }, "ip_address": { "type": "string", "description": "Looked-up IP address." }, "ipinfo_link": { "type": "string", "description": "IPinfo page for this address." }, "postal_code": { "type": [ "string", "null" ], "description": "Postal code, if available." }, "country_code": { "type": [ "string", "null" ], "description": "Two-letter country code." }, "country_name": { "type": [ "string", "null" ], "description": "Full country name." }, "organization": { "type": [ "string", "null" ], "description": "Organization or internet provider name, if available." }, "network_number": { "type": [ "string", "null" ], "description": "Autonomous system number, if available." } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
ipinfo.io/get_ip_location- Returns
- city, region, country, postal code, time zone, organization, AS number, coordinates
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method ipinfo.io/get_ip_location with the inputs above.
Ask your agent
- Where is the IP address 8.8.8.8 located? I need the city and country.
- Look up the network operator and AS number for 1.1.1.1 on ipinfo.io.
- What timezone and postal code belong to the public IP 203.0.113.45?
- Find the coordinates and region for 2001:4860:4860::8888 please.
- Which organization owns the IP 185.199.108.153, and what city is it in?
See more
Looks up a UK postcode on Postcodes.io, including its location, administrative areas and whether it is still in use. Retired postcodes return location and retirement year only.
postcodes.io/get_postcodeMatches a US street address and returns its city or place, county, state, ZIP code, census tract, congressional and state legislative districts, coordinates and FIPS codes. Districts follow the Census Geocoder's current geography vintage and may differ from sitting representation.
census.gov/get_address_detailsFinds postal codes, place names and coordinates for a town and state or region in a country covered by Zippopotam.us.
zippopotam.us/search_postal_codesLooks up the places, regions and coordinates for a postal code in a supported country on Zippopotam.us.
zippopotam.us/get_postal_codeFinds map coordinates and address details for an address or place on OpenStreetMap, optionally restricted to a country.
openstreetmap.org/get_coordinatesLooks up a public Google Maps place by name and location and returns its profile: address, rating, hours, phone, website and photos.
google.com/get_placeGets AirNow current air quality, pollutant readings and today's and tomorrow's forecasts for a US city or ZIP code, or a covered Canadian or Mexican city.
airnow.gov/get_air_qualityLists UK postcodes nearest to a postcode or named place, with distance, ward, council and coordinates. For places sharing a name, a city or town is preferred.
postcodes.io/list_nearby_postcodes