User Tools

Site Tools


api:geoip:get

API : GeoIP Get

Introduction

This request will return the country code and country name that a given IP address is located within.

Request

URL https://api.telecomx.dk/geoip/IP_ADDRESS
Method GET
Access level VIEWER, MANAGER, OWNER, RESELLER, RESELLER_ADMIN, ADMIN
Param IP_ADDRESS IP address to lookup - IPv4.

Query example

https://api.telecomx.dk/geoip/203.0.113.10

Response

JSON object
ip String The IP address that was looked up.
countryCode String ISO3166-1 2 char country code.
country String Country name (english).
continent String Continent name (english).
postal String Postal code - if available.
city String City - if available.
location Object Location data.
location.accuracy_radius Number Accuracy of the position in KM.
location.latitude Number Latitude.
location.longitude Number Longitude.
location.time_zone String Timezone of the location - if available.

Example

{
  "ip": "203.0.113.10",
  "countryCode": "DK",
  "country": "Denmark",
  "continent": "Europe",
  "postal": "2500",
  "city": "Valby",
  "location": {
    "accuracy_radius": 20,
    "latitude": 55.6647,
    "longitude": 12.5024,
    "time_zone": "Europe/Copenhagen"
  }
}

Errors

Error code Message Description
400 ip IP address is invalid
403 access_denied Insufficient access level
404 ip IP address not found in the GeoIP database
422 ip IP address is private or special and cannot be looked up
500 internal_error <Unspecified>
api/geoip/get.txt · Last modified: by Mikkel Meerwaldt Jørgensen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki