DEV Community

GuGuData
GuGuData

Posted on

IP Address Geolocation API

The IP Address Geolocation API provided by GuguData offers a powerful and efficient way to retrieve geographical information for any IP address. Whether you're working with IPv4 or IPv6, this API enables you to quickly identify the user's country, state, city, and coordinates (latitude and longitude).

This is an essential tool for developers who need reliable location data for applications involving fraud detection, content localization, user behavior analysis, or network diagnostics.

๐Ÿ‘‰ Try the Demo


๐ŸŒ Key Features

  • โœ… Supports both IPv4 and IPv6 formats
  • ๐Ÿ“Œ Returns detailed location data: Country, State/Province, City, Latitude, Longitude
  • โšก Real-time results with ultra-fast API response
  • ๐Ÿ”’ Full HTTPS support, including TLS v1.0โ€“v1.3 and Apple ATS compatibility
  • ๐ŸŒ Globally distributed CDN nodes ensure low latency and high availability
  • ๐Ÿ“Š Perfect for:
    • Fraud detection and risk analysis
    • Content and language localization
    • Regional user analytics
    • Network performance monitoring

๐Ÿ”ง API Endpoint

  • Base URL: https://api.gugudata.io/v1/location/ip
  • Method: GET
  • Authorization: Requires appkey (available from your GuguData developer dashboard)

๐Ÿ“ฅ Request Parameters

Parameter Type Required Description
appkey string Yes Your API key from GuguData
ip string Yes The IP address to lookup (IPv4 or IPv6, e.g., 8.8.8.8, 2001:db8::)

๐Ÿ“ค Response Format

The API returns a structured JSON object. Below are key response fields:

Metadata (under dataStatus)

Field Type Description
requestParameter string Echo of the request
statusCode integer HTTP response code
status string Status result (e.g., "OK")
statusDescription string Human-readable status message
responseDateTime string Timestamp of the response
dataTotalCount integer Number of results (usually 1)

Geolocation Data (under data)

Field Type Description
countryCode string ISO country code (e.g., "US", "CN")
state string State or province
city string City name
latitude number Latitude coordinate
longitude number Longitude coordinate

โš ๏ธ Error Codes

Code Meaning Description
200 Success Geolocation data retrieved successfully
400 Parameter Error Invalid IP format or missing parameters
402 Invalid APPKEY Check if your API key is valid
403 Account in Arrears Your account needs reactivation
429 Too Many Requests Rate limited: max 100 requests/sec
500 Internal Server Error Service failed to process request
503 Service Unavailable Temporary outage or maintenance

๐Ÿงฉ Use Cases

โœ… Fraud Detection

Compare user IP with declared region to detect suspicious behavior.

๐ŸŒ Content Localization

Customize site language or layout based on user location.

๐Ÿ“ˆ Marketing & Analytics

Group users by region to tailor campaigns and reports.

๐Ÿ›ก๏ธ Access Control

Restrict content availability by country or region.


๐Ÿ–ผ๏ธ API Preview

IP Address Geolocation API Preview


๐Ÿ“š Related APIs

Looking for more data APIs? Visit the GuguData API Marketplace for a full list of tools for data analysis, content moderation, and location intelligence.


Top comments (0)