JUHE API Marketplace
API Service

IP Geolocation

Returns the geographical location, city, region, coordinates, and timezone information for any given IP address.

99.9%
Uptime
32ms
Avg Response
10K+
Daily Requests
IP Geolocation Response
1{
2 "code": "200",
3 "msg": "Success",
4 "data": {
5 "ip": "34.102.212.180",
6 "ip_version": 4,
7 "country_name": "United States",
8 "country_code": "US",
9 "city_name": "Los Angeles",
10 "region_name": "California",
11 "zip_code": "90012",
12 "time_zone": "America/Los_Angeles",
13 "lat": 34.0522,
14 "lon": -118.2437
15 }
16}
JSON16 lines

Try Live Demo

Test the API with real data instantly. No registration required.

IP Geolocation API Demo

IP lookup is charged separately, Not shared with IP API Calls charges.

The following is an example of IP (122.193.105.243) search results.

Your IP address is: 139.162.101.153

IP Version
Country Name
Country Code
Region Name
City Name
ZIP Code
4
China
CN
Jiangsu
Suzhou
215003
Local Time
Time Zone
Olson Time Zone
Latitude & Longitude
Weather Station
IDD & Area Code
2020-03-10T12:18:26+08:00
+08:00
Asia/Shanghai
31.31139,120.61806
CHXX0014 Changshu
(86) 0512
ISP
Domain
Net Speed
Classification of ISP
China Unicom Jiangsu Province Network
chinaunicom.com
DSL
ISP/MOB
Mobile Carrier
Mobile Country Code - MCC
Mobile Country Code - MNC
China Unicom
460
01

API Introduction

About this API

The IP Geolocation API is a powerful and precise IP address location service that can instantly convert any IPv4 or IPv6 address into detailed geographic and network information. With a single API call, you can obtain not only the country, state, city, postal code, and latitude/longitude of an IP address, but also rich data dimensions such as its Internet Service Provider (ISP), timezone, and even network connection speed. This API is the cornerstone for building any application that needs to be aware of a user's geographic location and is widely used in fields such as content personalization, targeted advertising, network security, and fraud detection.

Key Features

  • High-Precision Geolocation: Provides multi-dimensional geographic data including country, region/province, city, postal code, latitude/longitude, and timezone.
  • Comprehensive Network Information: Returns detailed network-level information such as the IP address's ISP, Autonomous System Number (ASN), domain, and network speed.
  • IPv4 & IPv6 Dual Support: Fully compatible with both IPv4 and IPv6 address queries, ensuring usability in modern network environments.
  • Rich Contextual Data: Advanced versions can provide more dimensional information, such as mobile network codes (MNC/MCC), currency information, language information, and even proxy type and fraud risk scores, offering deeper insights for business decisions.
  • Multi-format and Multi-language Responses: Supports both JSON and XML response formats and can return geographic names in multiple languages (such as Chinese, Spanish, Japanese, etc.) based on request parameters, facilitating the development of internationalized applications.

Use Cases

Scenario 1: Content and Currency Localization for E-commerce Websites

Situation: A global e-commerce website wants to provide a localized shopping experience for users from different countries. Implementation: When a user first visits the website, the server obtains their IP address and immediately calls the IP Geolocation API. The API returns the user's country code (country_code) and currency code. Based on this information, the website can automatically switch the page language to the country's mainstream language and display all product prices in the local currency. For example, a user from Germany visiting the site will automatically see a German interface and products priced in Euros (EUR), which greatly reduces the user's cognitive load, effectively reduces cart abandonment rates, and increases conversion rates.

Scenario 2: Enhance Security for Online Service Registration and Login

Situation: An online bank or payment platform needs to prevent fraudulent registrations and account takeover activities. Implementation: When a user registers or logs in, the system records the IP address of the operation and calls this API for analysis. If the is_proxy field returned by the API is true, or if the IP's geographic location is far from the user's usual login location (for example, a US user's account suddenly logs in from an Eastern European IP within minutes), the system can trigger a high-risk alert. At this point, the user can be required to perform additional identity verification (such as a two-factor authentication code), or the suspicious operation can be temporarily frozen, effectively preventing potential fraud and attacks.

Scenario 3: Implement Precise Geographic Targeting for Digital Advertising

Situation: An advertising platform needs to display the most relevant ads based on the user's geographic location. Implementation: When an ad request occurs, the platform obtains the user's IP address and calls the IP Geolocation API. The API returns the user's city (city_name) and region (region_name). The ad platform can use this information to match and serve ads from its ad library that are highly relevant to that region. For example, it can show ads for a local ski resort to users in "California," or push discounts for Broadway shows to users in "New York City." This precise geographic targeting can significantly improve ad click-through rates and conversion effectiveness.

How it Works: Endpoints & Response

This API receives an IP address as a query parameter through a core endpoint and returns a JSON object containing rich geographic and network information.

Endpoint Example: https://hub.juheapi.com/ip2location/v1/query

The fields in the response body are intuitive and comprehensive. Fields like country_name, city_name, and zip_code directly provide usable geographic information. The lat and lon fields provide precise latitude and longitude coordinates, which can be easily integrated with map services (like Google Maps, Baidu Maps) to mark the user's location on a map. The time_zone field is crucial for applications that need to handle cross-timezone scheduling or logging. This structured response makes it easy for developers to turn IP addresses into valuable business insights.

Quick Actions

Pricing

FREE
Get Started with 100 requests
No Credit Card Required
View All Plans

Key Features

Real-time Processing
High Accuracy
Low Latency
Scalable Infrastructure