IP Geolocation API
This free geolocation API allows you to get detailed location information about a specific IP address. It provides the following information:
- ISO 3166-1 alpha-2 country code
- Name of the country
- Name of the city
- Postcode of the city
- Longitude
- Latitude
- Name of the continent
- Code of the continent
- Timezone
- List of languages spoken in the country
- International dialing prefix
- Information about the currency used in the country
Geolocation API Request example
Method: POST
Content Type: application/json
Endpoint: https://aaapis.com/api/v1/info/ip/
curl --L --X POST 'https://aaapis.com/api/v1/info/ip/' \
--H 'Authorization: Token YOUR_TOKEN' \
--H 'Content-Type: application/json' \
--data-raw '{
"ip_address": "46.51.224.0"
}'You can also use an IPV6 address to get information about this specific IP address.
curl --L --X POST 'https://aaapis.com/api/v1/info/api/' \
--H 'Authorization: Token YOUR_TOKEN' \
--H 'Content-Type: application/json' \
--data-raw '{
"ip_address": "::2e33:e000"
}'Response
The API will provide a response containing information about the specified IP address.
{
"ip_address": "46.51.224.0",
"city_name": "Tokyo",
"city_postcode": "151-0053",
"country_name": "Japan",
"country_code": "JP",
"area": "13",
"continent_name": "Asia",
"continent_code": "AS",
"longitude": 139.6899,
"latitude": 35.6893,
"time_zone": "Asia/Tokyo",
"language": [
"ja"
],
"currency": {
"code": "JPY",
"name": "Japanese Yen",
"symbol": "Â¥"
},
"phone_international_prefix": 81
}IP Geolocation API Parameters
| Parameter | Type | Optionnal | Description |
|---|---|---|---|
| ip_address | string | No | Used to specify the IPV4 or IPV6 address. |
HTTP Response Status Codes
Aaapis employs standard HTTP response codes to signify the outcome, whether successful or unsuccessful, of an API request.Typically, codes falling within the 2xx range signify success. Codes within the 4xx range indicate an error attributable to inadequate information provided (e.g., a missing required parameter). Codes in the 5xx range denote an error related to Aaapis' servers.
| Code | Description |
|---|---|
| 200 | This status code indicates that the request was successful. The server successfully processed the request and is sending back the requested data. |
| 401 | This status code indicates that the request requires user authentication. The server received the request, but it needs authentication to fulfill it. This could mean that the Authorization header is missing or invalid. |
| 400 | This status code indicates that the server could not understand the request due to invalid syntax. This could mean that the JSON object in the request is malformed or missing required fields. The client must modify the request and try again. |
| 500 | This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This could be due to a problem with the server itself. The client should not modify the request and can try again later. |
Explore our comprehensive guides for the IP Geolocation API:
- Understanding IP Geolocation: A Comprehensive Guide
IP Geolocation is a technology used to determine the geographic location of a device connected to the internet using its IP address. This is accomplished …
- The Role of Geolocation in E-commerce Security
Geolocation technology is a potent asset for e-commerce platforms, offering a myriad of benefits that go beyond mere location identification. Explore how …