An IP geolocation API in Python returns city, ASN, and security flags. On ipXapi that is GET /api/ip?ip=. Official fixture: 148.105.12.120 (MailChimp / AS14782, Mountain View).
Basic is $29.99/mo with a 7-day trial or 50 requests. MCP: mcp.ipxapi.com.
Request: official MailChimp IP
curl "https://ipxapi.com/api/ip?ip=148.105.12.120" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_KEY"
Python: same contract
import os, urllib.request
req = urllib.request.Request(
"https://ipxapi.com/api/ip?ip=148.105.12.120",
headers={"Authorization": "Bearer " + os.environ["IPXAPI_KEY"], "Accept": "application/json"},
)
print(urllib.request.urlopen(req).read().decode())
Response: official test-drive fixture
{
"status": "success",
"country": "United States",
"countryCode": "US",
"city": "Mountain View",
"lat": 37.40599,
"lon": -122.0786,
"isp": "MailChimp",
"as": "AS14782 MailChimp",
"query": "148.105.12.120"
}
Look up the IP you actually care about. Do not treat this as the reader’s address.
Go live
1. Register — 7-day trial or 50 requests.
2. Copy the Bearer key.
3. GET /api/ip?ip=.
4. Store city, lat, lon, as, and security flags.
Look up an IP in Python →