Ip2Geo API service

Ip2Geo API service IP geo location detection service


Basic information

This service will locate the geo-location of a specific ipv4 or ipv6 IP address. The service uses a combination of public databases, services and exceptions made on the basis of tests in order to get more accurate results.
* 99.99% accuracy in locating a country and a continent.
* 99.99% accuracy when locating an ISP.
* 90% accuracy when locating a city.

** The percentages are rounded off based on our personal testing.

Your detected location

United States (US)
Ashburn ( 39.0481,-77.4728 )


Token and service authentication

You need to be logged in user before you can use the service.

We simplified the login / registration in the easiest way possible. Only you need to sign in with your Google / Gmail account to continue. After logging into the token field (below) you will be able to use your personal token on PHP.mk services.

Personal Token

Login to show token!


Using the Service v1.0

Version ({version}): v1.0

IP address ({ip}): ?ip= e.g. ""

service end-point



Example HTTP/GET request


Example PHP

$url='https://api.php.mk/ip2geo/v1.0?token=&ip='.urlencode(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);
$response= json_decode($jsonResponse,true);
echo '<pre>';

Example cUrl

curl -X GET  'https://api.php.mk/ip2geo/v1.0?token=&ip=';

Example Javascript

var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    var response_data=JSON.parse(this.responseText).data;
xhr.open("GET", "https://api.php.mk/ip2geo/v1.0?token=&ip=");

Example jQuery / JavaScript







Service response

The answer is always in JSON format

The answer from the service is the data for the requested location in JSON format.

Example response

    "error": false,
    "status_text": "OK",
    "status_code": 200,
    "data": {
        "ip": "95.180.xxx.xxx",
        "continent": {
            "code": "EU",
            "name": "Europe"
        "country": {
            "code": "MK",
            "code3": "MKD",
            "name": "Macedonia"
        "city": {
            "name": "Skopje",
            "postal_code": "1000",
            "latitude": "41.9973",
            "longitude": "21.4325"
        "isp": {
            "name": "Име на интернет провајдерот",
            "asn": "AS123456"