Ir al contenido
POST AI agent ready /v1/ip/lookup

IP Geolocation API - Free IP Address Lookup

Returns geolocation data for an IP address, including country, city, region, coordinates, timezone, ASN, and Cloudflare data center. If no IP is provided, the caller's own IP is used.

Parameters

string

IPv4 or IPv6 address to geolocate. Omit to look up the caller's own IP.

Code examples

curl -X POST https://api.botoi.com/v1/ip/lookup \
  -H "Content-Type: application/json" \
  -d '{"ip":"203.0.113.1"}'

When to use this API

Personalize content by visitor location

Detect a visitor's country and city on page load to show localized pricing, language, or shipping options. A SaaS checkout page can call this endpoint to pre-fill the currency selector based on the visitor's country code.

Fraud scoring in payment pipelines

Compare the IP geolocation of a transaction against the billing address on file. Flag orders where the IP resolves to a different country than the card issuer, and route flagged transactions through manual review.

Compliance logging for access audits

Record the country and region of every admin login to an internal dashboard. Generate a monthly report of access events grouped by geography to satisfy SOC 2 or GDPR audit requirements.

Frequently asked questions

How accurate is the IP geolocation data?
Country-level accuracy is above 99%. City-level accuracy varies by region but is typically 80-90% for major ISPs. Mobile carrier IPs and VPNs may resolve to the carrier headquarters instead of the user's physical location.
Does this endpoint support IPv6 addresses?
Yes. Pass any valid IPv6 address in the ip field. The response includes the same geolocation fields as IPv4 lookups.
What happens if I omit the ip parameter?
The endpoint returns geolocation data for the caller's own IP address. This is useful for detecting a website visitor's location without any client-side JavaScript.
What is the ASN field?
ASN stands for Autonomous System Number. It identifies the network operator (like Comcast, AWS, or Cloudflare) that owns the IP address block. The as_organization field gives you the human-readable name.
Is there a rate limit on this endpoint?
Anonymous requests are limited to 5 per minute based on your IP. Authenticated requests with an API key get higher limits depending on your plan.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.