Jump to content
  • Sign Up
×
×
  • Create New...

Get started

API Endpoint
https://api.hopzone.eu/

The Hopzone API provides access to read server info and server vote data, create server vote url for players with IPv6 for games that do not use IPv6 (like lineage 2)

To maintain compatibility between IPv4 and IPv6 internet providers who use v4-v6 Tunnels to operate on the IPv6 internet, making it impossible for hopzone to see the same IP as the Lineage2 server and then compare whether the person voted or not.

To solve the issue this API has new logic functions an extra field in the voting URL called vote_id created by a vote request that generates a new vote with status "pending", next the vote link is generated and the player is sent to vote from your side in that link, on a successful vote the status from "pending" will be "completed" along with other information you can see bellow on this page.

With the vote id you can check if the player has voted by checking the vote status is "completed" instead of the IP Address, and deliver a reward for this user.

The Hopzone API is used with POST or GET request methods.

To use this API, you need an API key. Add a server to get your own API key.


GET request method

Retrieve vote info with player's IP Address

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {PLAYER-IP} with your player's IP Address
 curl -X GET "https://api.hopzone.eu/v1/?api_key={API-KEY}&ip={PLAYER-IP}&type=json"

# Note you can run the command here: https://reqbin.com/curl

			

To retrieve the vote info you need to make a GET request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "vote_time": 1734782710,
    "server_time": 1734782254,
    "api_version": "1",
    "vote_id": 3,
    "vote_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_forwarded_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_connecting_ip": {
        "type": "IPv6",
        "hexadecimal_digits": {
            "segment_1": "2001",
            "segment_2": "cdba",
            "segment_3": "0000",
            "segment_4": "0000",
            "segment_5": "0000",
            "segment_6": "0000",
            "segment_7": "3257",
            "segment_8": "9652"
        }
    },
    "server_id": 19,
    "user_id": 5,
    "hours_since_vote": 8,
    "status": "completed"
}

			

QUERY PARAMETERS

Field Type Length Description
*api_key String 25 Your API key.
*ip String 7-46 An alphanumeric string value preferably player's IP Address.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "IXXX" error code.
vote_time Integer 10 number of seconds since the Unix Epoch
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
vote_id Integer 1-11 number of unique vote id
server_id Integer 1-11 number of unique server id
user_id Integer 1-11 number of unique user id who voted
hours_since_vote Integer 1-2 number of unique user id who voted
status String 7-9 Will return "completed" or "pending".
vote_ip Array 2 Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
forwarded_ip Array 2 (Proxy) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
connecting_ip Array 2 (CloudFlare) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {PLAYER-IP} with the player's IP Address ie: $player_ip = "21.41.51.61";
// you should retrieve player's IP from database

$api_key
= "{API-KEY}";
$player_ip
= "{PLAYER-IP}";
$endpoint
= "https://hopzone.eu/v1/";
$data
= "?api_key=$api_key&ip=$player_ip&type=json";

$curl
= curl_init();
curl_setopt
($curl, CURLOPT_URL, $endpoint . $data);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec($curl);
curl_close($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {PLAYER-IP} with the player's IP Address
URL url = new URL("https://api.hopzone.eu/v1/?api_key={API-KEY}&ip={PLAYER-IP}&type=json");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {PLAYER-IP} with the player's IP Address
const url = 'https://api.hopzone.eu/v1/?api_key={API-KEY}&ip={PLAYER-IP}&type=json';

const response = await fetch(url);

const text = await response.text();

console
.log(text);
// replace {API-KEY} with your api key
// replace {PLAYER-IP} with the player's IP Address
var url = "https://api.hopzone.eu/v1/?api_key={API-KEY}&ip={PLAYER-IP}&type=json";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

POST request method

Retrieve vote info with player's IP Address

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {PLAYER-IP} with your player's IP Address
 curl \
 -X POST https://api.hopzone.eu/v1/ \
 -d 'api_key={API-KEY}' \
 -d 'ip={PLAYER-IP}' \
 -d 'type=json'

# Note you can run the command here: https://reqbin.com/curl

			

To retrieve the vote info you need to make a POST request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "vote_time": 1734782710,
    "server_time": 1734782254,
    "api_version": "1",
    "vote_id": 3,
    "vote_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_forwarded_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_connecting_ip": {
        "type": "IPv6",
        "hexadecimal_digits": {
            "segment_1": "2001",
            "segment_2": "cdba",
            "segment_3": "0000",
            "segment_4": "0000",
            "segment_5": "0000",
            "segment_6": "0000",
            "segment_7": "3257",
            "segment_8": "9652"
        }
    },
    "server_id": 19,
    "user_id": 5,
    "hours_since_vote": 8,
    "status": "completed"
}

			

QUERY PARAMETERS

Field Type Length Description
* api_key String 25 Your API key.
*ip String 7-46 An alphanumeric string value preferably player's IP Address.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "IXXX" error code.
vote_time Integer 10 number of seconds since the Unix Epoch
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
vote_id Integer 1-11 number of unique vote id
server_id Integer 1-11 number of unique server id
user_id Integer 1-11 number of unique user id who voted
hours_since_vote Integer 1-2 number of unique user id who voted
status String 7-9 Will return "completed" or "pending".
vote_ip Array 2 Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
forwarded_ip Array 2 (Proxy) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
connecting_ip Array 2 (CloudFlare) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {PLAYER-IP} with the player's IP Address ie: $player_ip = "21.41.51.61";
// you should retrieve player's IP from database

$api_key
= "{API-KEY}";
$player_ip
= "{PLAYER-IP}";
$endpoint
= "https://hopzone.eu/v1/";

curl_setopt
($curl, CURLOPT_URL, $endpoint);
curl_setopt
($curl, CURLOPT_POST, true);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

$headers
= array(
     
"Content-Type: application/x-www-form-urlencoded",
);
curl_setopt
($curl, CURLOPT_HTTPHEADER, $headers);

$data
= "api_key=$api_key&ip=$player_ip&type=json";

curl_setopt
($curl, CURLOPT_POSTFIELDS, $data);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec();
curl_close
($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {PLAYER-IP} with the player's IP Address
URL url = new URL("https://api.hopzone.eu/v1/");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http
.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

String data = "api_key={API-KEY}&ip={PLAYER-IP}&type=json";

byte
[] out = data.getBytes(StandardCharsets.UTF_8);

OutputStream stream = http.getOutputStream();
stream
.write(out);

System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {PLAYER-IP} with the player's IP Address
const url = 'https://api.hopzone.eu/v1/';

const data = "api_key={API-KEY}&ip={PLAYER-IP}&type=json";

const response = await fetch(url, {
     method
: 'POST',
     headers
: {
          
'Content-Type': 'application/x-www-form-urlencoded',
     
},
     body
: data,
});

const text = await response.text();

console
.log(text);
// replace {API-KEY} with your api key
// replace {PLAYER-IP} with the player's IP Address
var url = "https://api.hopzone.eu/v1/";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";

httpRequest
.ContentType = "application/x-www-form-urlencoded";

var data
= "api_key={API-KEY}&ip={PLAYER-IP}&type=json";

using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
     streamWriter
.Write(data);
}

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

GET request method

Retrieve vote info with vote id

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {VOTE-ID} with your vote id Address
 curl -X GET "https://api.hopzone.eu/v1/?api_key={API-KEY}&vote_id={VOTE-ID}&type=json"

# Note you can run the command here: https://reqbin.com/curl

			

To retrieve the vote info you need to make a GET request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "vote_time": 1734782710,
    "server_time": 1734782254,
    "api_version": "1",
    "vote_id": 3,
    "vote_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_forwarded_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_connecting_ip": {
        "type": "IPv6",
        "hexadecimal_digits": {
            "segment_1": "2001",
            "segment_2": "cdba",
            "segment_3": "0000",
            "segment_4": "0000",
            "segment_5": "0000",
            "segment_6": "0000",
            "segment_7": "3257",
            "segment_8": "9652"
        }
    },
    "server_id": 19,
    "user_id": 5,
    "hours_since_vote": 8,
    "status": "completed"
}

			

QUERY PARAMETERS

Field Type Length Description
*api_key String 25 Your API key.
* vote_id Integer 1-19. The vote id.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "VXXX" error code.
vote_time Integer 10 number of seconds since the Unix Epoch
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
vote_id Integer 1-11 number of unique vote id
server_id Integer 1-11 number of unique server id
user_id Integer 1-11 number of unique user id who voted
hours_since_vote Integer 1-2 number of unique user id who voted
status String 7-9 Will return "completed" or "pending".
vote_ip Array 2 Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
forwarded_ip Array 2 (Proxy) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
connecting_ip Array 2 (CloudFlare) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {VOTE-ID} with the vote id ie: $vote_id = 3;
// you can retrieve vote id from the API

$api_key
= "{API-KEY}";
$vote_id
= "{VOTE-ID}";
$endpoint
= "https://hopzone.eu/v1/";
$data
= "?api_key=$api_key&vote_id=$vote_id&type=json";

$curl
= curl_init();
curl_setopt
($curl, CURLOPT_URL, $endpoint . $data);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec($curl);
curl_close($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {VOTE-ID} with the vote id
URL url = new URL("https://api.hopzone.eu/v1/?api_key={API-KEY}&vote_id={VOTE-ID}&type=json");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {VOTE-ID} with the vote id
const url = 'https://api.hopzone.eu/v1/?api_key={API-KEY}&vote_id={VOTE-ID}&type=json';

const response = await fetch(url);

const text = await response.text();

console
.log(text);
// replace {API-KEY} with your api key
// replace {VOTE-ID} with the vote id
var url = "https://api.hopzone.eu/v1/?api_key={API-KEY}&vote_id={VOTE-ID}&type=json";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

POST request method

Retrieve vote info with vote id

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {VOTE-ID} with the vote id
 curl \
 -X POST https://api.hopzone.eu/v1/ \
 -d 'api_key={API-KEY}' \
 -d 'vote_id={VOTE-ID}' \
 -d 'type=json'

# Note you can run the command here: https://reqbin.com/curl

			

To retrieve the vote info you need to make a POST request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "vote_time": 1734782710,
    "server_time": 1734782254,
    "api_version": "1",
    "vote_id": 3,
    "vote_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_forwarded_ip": {
        "type": "IPv4",
        "digits": "55.55.55.55"
    },
    "vote_connecting_ip": {
        "type": "IPv6",
        "hexadecimal_digits": {
            "segment_1": "2001",
            "segment_2": "cdba",
            "segment_3": "0000",
            "segment_4": "0000",
            "segment_5": "0000",
            "segment_6": "0000",
            "segment_7": "3257",
            "segment_8": "9652"
        }
    },
    "server_id": 19,
    "user_id": 5,
    "hours_since_vote": 8,
    "status": "completed"
}

			

QUERY PARAMETERS

Field Type Length Description
* api_key String 25 Your API key.
* vote_id Integer 1-19. The vote id.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "VXXX" error code.
vote_time Integer 10 number of seconds since the Unix Epoch
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
vote_id Integer 1-11 number of unique vote id
server_id Integer 1-11 number of unique server id
user_id Integer 1-11 number of unique user id who voted
hours_since_vote Integer 1-2 number of unique user id who voted
status String 7-9 Will return "completed" or "pending".
vote_ip Array 2 Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
forwarded_ip Array 2 (Proxy) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
connecting_ip Array 2 (CloudFlare) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {VOTE-ID} with the vote id ie: $vote_id = 3;
// you can retrieve the vote id from the API

$api_key
= "{API-KEY}";
$vote_id
= "{VOTE-ID}";
$endpoint
= "https://hopzone.eu/v1/";

curl_setopt
($curl, CURLOPT_URL, $endpoint);
curl_setopt
($curl, CURLOPT_POST, true);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

$headers
= array(
     
"Content-Type: application/x-www-form-urlencoded",
);
curl_setopt
($curl, CURLOPT_HTTPHEADER, $headers);

$data
= "api_key=$api_key&vote_id=$vote_id&type=json";

curl_setopt
($curl, CURLOPT_POSTFIELDS, $data);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec();
curl_close
($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {VOTE-ID} with the vote id
URL url = new URL("https://api.hopzone.eu/v1/");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http
.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

String data = "api_key={API-KEY}&vote_id={VOTE-ID}&type=json";

byte
[] out = data.getBytes(StandardCharsets.UTF_8);

OutputStream stream = http.getOutputStream();
stream
.write(out);

System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {VOTE-ID} with the vote id
const url = 'https://api.hopzone.eu/v1/';

const data = "api_key={API-KEY}&vote_id={VOTE-ID}&type=json";

const response = await fetch(url, {
     method
: 'POST',
     headers
: {
          
'Content-Type': 'application/x-www-form-urlencoded',
     
},
     body
: data,
});

const text = await response.text();

console
.log(text);
// replace {API-KEY} with your api key
// replace {VOTE-ID} with the vote id
var url = "https://api.hopzone.eu/v1/";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";

httpRequest
.ContentType = "application/x-www-form-urlencoded";

var data
= "api_key={API-KEY}&vote_id={VOTE-ID}&type=json";

using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
     streamWriter
.Write(data);
}

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

GET request method

Retrieve server info

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {SERVER-ID} with your server Id
 curl -X GET "https://api.hopzone.eu/v1/?api_key={API-KEY}&server_id={SERVER-ID}&type=json"

# Note you can run the command here: https://reqbin.com/curl

			

To retrieve server info you need to make a GET request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "api_version": "1",
    "server_time": 1682929874,
    "server_id": 19,
    "monthly_votes":
    [
        "vote_1": {
            "vote_ip": {
                "type": "IPv6",
                "hexadecimal_digits": {
                    "segment_1": "2001",
                    "segment_2": "cdba",
                    "segment_3": "0000",
                    "segment_4": "0000",
                    "segment_5": "0000",
                    "segment_6": "0000",
                    "segment_7": "3257",
                    "segment_8": "9652"
                }
            },
            "vote_forwarded_ip": {
                "type": "IPv6",
                "hexadecimal_digits": {
                    "segment_1": "684d",
                    "segment_1": "1111",
                    "segment_1": "0222",
                    "segment_1": "3333",
                    "segment_1": "4444",
                    "segment_1": "5555",
                    "segment_1": "0006",
                    "segment_1": "0077"
                }
            },
            "vote_connecting_ip": {
                "type": "IPv4",
                "digits": "12.11.194.61"
            },
            "status": "completed",
            "user_id": 6,
            "vote_id": 1251,
            "vote_time": 1682929871,
            "hours_since_vote": 11
        },
        "vote_2": {
            "vote_ip": {
                "type": "IPv4",
                "digits": "128.55.91.4"
            },
            "vote_forwarded_ip": {
                "type": "IPv4",
                "digits": "128.55.91.4"
            },
            "vote_connecting_ip": {
                "type": "IPv4",
                "digits": "128.55.91.4"
            },
            "status": "completed",
            "user_id": 5,
            "vote_id": 1245,
            "vote_time": 1682929871,
            "hours_since_vote": 11
        }
    ],
    "total_monthly_votes": 2
}

			

QUERY PARAMETERS

Field Type Length Description
* api_key String 25 Your API key.
* server_id Integer 1-11 Your Server Id.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "SXXX" error code.
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
server_id Integer 1-11 number of unique server id
total_monthly_votes Integer 1-11 The total votes of the current month
[] Array Will return an array list of votes from the current month
Field Type Length Description
vote_time Integer 10 number of seconds since the Unix Epoch
vote_id Integer 1-11 number of unique vote id
user_id Integer 1-11 number of unique user id who voted
hours_since_vote Integer 1-2 number of unique user id who voted
status String 7-9 Will return "completed" or "pending".
vote_ip Array 2 Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
forwarded_ip Array 2 (Proxy) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
connecting_ip Array 2 (CloudFlare) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {SERVER-ID} with your server id ie: $server_id = 19;
$api_key
= "{API-KEY}";
$server_id
= "{SERVER-ID}";

$endpoint
= "https://api.hopzone.eu/v1/";
$data
= "?api_key=$api_key&server_id=$server_id&type=json";

$curl
= curl_init();
curl_setopt
($curl, CURLOPT_URL, $endpoint . $data);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec($curl);
curl_close($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {SERVER-ID} with your server id
URL url = new URL("https://api.hopzone.eu/v1/?api_key={API-KEY}&server_id={SERVER-ID}&type=json");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {SERVER-ID} with your server id
const url = 'https://api.hopzone.eu/v1/?api_key={API-KEY}&server_id={SERVER-ID}&type=json';

const response = await fetch(url);

const text = await response.text();

console
.log(text);
// replace {API-KEY} with your api key
// replace {SERVER-ID} with your server id
var url = "https://api.hopzone.eu/v1/?api_key={API-KEY}&server_id={SERVER-ID}&type=json";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

POST request method

Retrieve server info

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {SERVER-ID} with your server Id
 curl \
 -X POST https://api.hopzone.eu/v1/ \
 -d 'api_key={API-KEY}' \
 -d 'server_id={SERVER-ID}' \
 -d 'type=json'

# Note you can run the command here: https://reqbin.com/curl

			

To retrieve server info you need to make a POST request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "api_version": "1",
    "server_time": 1682929874,
    "server_id": 19,
    "monthly_votes":
    [
        "vote_1": {
            "vote_ip": {
                "type": "IPv6",
                "hexadecimal_digits": {
                    "segment_1": "2001",
                    "segment_2": "cdba",
                    "segment_3": "0000",
                    "segment_4": "0000",
                    "segment_5": "0000",
                    "segment_6": "0000",
                    "segment_7": "3257",
                    "segment_8": "9652"
                }
            },
            "vote_forwarded_ip": {
                "type": "IPv6",
                "hexadecimal_digits": {
                    "segment_1": "684d",
                    "segment_1": "1111",
                    "segment_1": "0222",
                    "segment_1": "3333",
                    "segment_1": "4444",
                    "segment_1": "5555",
                    "segment_1": "0006",
                    "segment_1": "0077"
                }
            },
            "vote_connecting_ip": {
                "type": "IPv4",
                "digits": "12.11.194.61"
            },
            "status": "completed",
            "user_id": 6,
            "vote_id": 1251,
            "vote_time": 1682929871,
            "hours_since_vote": 11
        },
        "vote_2": {
            "vote_ip": {
                "type": "IPv4",
                "digits": "128.55.91.4"
            },
            "vote_forwarded_ip": {
                "type": "IPv4",
                "digits": "128.55.91.4"
            },
            "vote_connecting_ip": {
                "type": "IPv4",
                "digits": "128.55.91.4"
            },
            "status": "completed",
            "user_id": 5,
            "vote_id": 1245,
            "vote_time": 1682929871,
            "hours_since_vote": 11
        }
    ],
    "total_monthly_votes": 2
}

			

QUERY PARAMETERS

Field Type Length Description
* api_key String 25 Your API key.
* server_id Integer 1-11 Your Server Id.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "SXXX" error code.
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
server_id Integer 1-11 number of unique server id
total_monthly_votes Integer 1-11 The total votes of the current month
[] Array Will return an array list of votes from the current month
Field Type Length Description
vote_time Integer 10 number of seconds since the Unix Epoch
vote_id Integer 1-11 number of unique vote id
user_id Integer 1-11 number of unique user id who voted
hours_since_vote Integer 1-2 number of unique user id who voted
status String 7-9 Will return "completed" or "pending".
vote_ip Array 2 Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
forwarded_ip Array 2 (Proxy) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
connecting_ip Array 2 (CloudFlare) Will return an array with "type" => ["IPv4", "IPv6"] and a string of "digits" for IPv4 or an array of 8 strings "hexadecimal_digits" for IPv6 to form an example of 2001:cdba:0000:3257:9652.
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {SERVER-ID} with your server id ie: $server_id = 19;
$api_key
= "{API-KEY}";
$server_id
= "{SERVER-ID}";

$endpoint
= "https://api.hopzone.eu/v1/";

$curl
= curl_init();
curl_setopt
($curl, CURLOPT_URL, $endpoint);
curl_setopt
($curl, CURLOPT_POST, true);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

$headers
= array(
     "Content-Type: application/x-www-form-urlencoded",
);
curl_setopt
($curl, CURLOPT_HTTPHEADER, $headers);

$data
= "api_key=$api_key&server_id={SERVER-ID}&type=json";

curl_setopt
($curl, CURLOPT_POSTFIELDS, $data);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec($curl);
curl_close
($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {SERVER-ID} with your server id
URL url = new URL("https://api.hopzone.eu/v1/");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http
.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

String data = "api_key={API-KEY}&server_id={SERVER-ID}&type=json";

byte
[] out = data.getBytes(StandardCharsets.UTF_8);

OutputStream stream = http.getOutputStream();
stream
.write(out);
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {SERVER-ID} with your server id
const url = 'https://api.hopzone.eu/v1/';

const data = "api_key={API-KEY}&server_id={SERVER-ID}&type=json";

const response = await fetch(url, {
     method
: 'POST',
     headers
: {
          
'Content-Type': 'application/x-www-form-urlencoded',
     
},
     body
: data,
});

const text = await response.text();

console
.log(text);
// replace {API-KEY} with your api key
// replace {SERVER-ID} with your server id
var url = "https://api.hopzone.eu/v1/";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";

httpRequest
.ContentType = "application/x-www-form-urlencoded";

var data
= "api_key={API-KEY}&server_id={SERVER-ID}&type=json";

using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
     streamWriter
.Write(data);
}

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

GET request method

Create vote link with server id

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {SERVER-ID} with your server id
 curl -X GET "https://api.hopzone.eu/v1/?api_key={API-KEY}&generate={SERVER-ID}&type=json"

# Note you can run the command here: https://reqbin.com/curl

			

To create a vote link you need to make a GET request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "api_version": "1",
    "server_time": 1682929874,
    "vote_id": 1251,
    "url": "https://hopzone.eu/vote/6/1251",
    "parts": {
            "endpoint": "https://hopzone.eu/vote/",
            "server_id": 6,
            "vote_id": 1251,
    }
}

			

QUERY PARAMETERS

Field Type Length Description
* api_key String 25 Your API key.
*generate Integer 1-25 An alphanumeric string value preferably player's name.
type String 3-4 Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "GXXX" error code.
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
vote_id Integer 1-11 number of unique server id
url String 1 Will return the full url, so the player can vote.
parts Array Will return an array list of the url parts "endpoint", "server_id" and "vote_id"
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {SERVER-ID} with the server id ie: $server_id = 19;

$api_key = "{API-KEY}";
$server_id
= "{SERVER-ID}";
$endpoint
= "https://api.hopzone.eu/v1/";
$data
= "?api_key=$api_key&generate=$server_id&type=json";

$curl
= curl_init();
curl_setopt
($curl, CURLOPT_URL, $endpoint . $data);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec($curl);
curl_close
($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {SERVER-ID} with the server id
URL url
= new URL("https://api.hopzone.eu/v1/?api_key={API-KEY}&generate={SERVER-ID}&type=json");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {SERVER-ID} with the server id
const url = 'https://api.hopzone.eu/v1/?api_key={API-KEY}&generate={SERVER-ID}&type=json';
const response = await fetch(url);
const text = await response.text();
console
.log(text);
// replace {API-KEY} with your api key
// replace {SERVER-ID} with the server id
var url
= "https://api.hopzone.eu/v1/?api_key={API-KEY}&generate={SERVER-ID}&type=json";
var httpRequest
= (HttpWebRequest)WebRequest.Create(url);
var httpResponse = (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}
Console.WriteLine(httpResponse.StatusCode);

POST request method

Create vote link with server id

				
# Here is a curl example
# replace {API-KEY} with your api key
# replace {SERVER-ID} with your server id
 curl \
 -X POST https://api.hopzone.eu/v1/ \
 -d 'api_key={API-KEY}' \
 -d 'generate={SERVER-ID}' \
 -d 'type=json'

# Note you can run the command here: https://reqbin.com/curl

			

To create a vote link you need to make a POST request to the following endpoint:
https://api.hopzone.eu/v1/

Result json example:
            	
{
    "error": "OK",
    "api_version": "1",
    "server_time": 1682929874,
    "vote_id": 1251,
    "url": "https://hopzone.eu/vote/6/1251",
    "parts": {
            "endpoint": "https://hopzone.eu/vote/",
            "server_id": 6,
            "vote_id": 1251,
    }
}

			

QUERY PARAMETERS

Field Type Length Description
* api_key String 25 Your API key.
*generate Integer 1-25 An integer value of the server id.
type String 3-4 characters. Output print values: json|xml Default: json

RESULT PARAMETERS

Field Type Length Description
error String 2 or 4 Will return "OK" or "GXXX" error code.
server_time Integer 10 number of seconds since the Unix Epoch
api_version String 1 Will return the API version.
vote_id Integer 1-11 number of unique server id
url String 1 Will return the full url, so the player can vote.
parts Array Will return an array list of the url parts "endpoint", "server_id" and "vote_id"
<?php
// replace {API-KEY} with your api key ie: $api_key = "a8htap4a4uoga43hrah";
// replace {SERVER-ID} with the server id ie: $server_id = 19;

$api_key = "{API-KEY}";
$server_id
= "{SERVER-ID}";
$endpoint
= "https://hopzone.eu/v1/";


$curl
= curl_init();
curl_setopt
($curl, CURLOPT_URL, $endpoint);
curl_setopt
($curl, CURLOPT_POST, true);
curl_setopt
($curl, CURLOPT_RETURNTRANSFER, true);

$headers
= array(
     
"Content-Type: application/json",
);
curl_setopt
($curl, CURLOPT_HTTPHEADER, $headers);

$data
= '{"api_key":"'.$api_key.'","generate":"'.$server_id.'"}';

curl_setopt
($curl, CURLOPT_POSTFIELDS, $data);

//for debug only!
curl_setopt
($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp
= curl_exec($curl);
curl_close
($curl);
var_dump
($resp);

?>
// replace {API-KEY} with your api key
// replace {SERVER-ID} with the server id
URL url = new URL("https://api.hopzone.eu/v1/");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http
.setRequestMethod("POST");
http
.setDoOutput(true);
http
.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
String data = "api_key={API-KEY}&generate={SERVER-ID}&type=json";

byte
[] out = data.getBytes(StandardCharsets.UTF_8);

OutputStream stream = http.getOutputStream();
stream
.write(out);

System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http
.disconnect();
// replace {API-KEY} with your api key
// replace {SERVER-ID} with the server id
const url = 'https://api.hopzone.eu/v1/';
const data = "api_key={API-KEY}&generate={SERVER-ID}&type=json";
const response = await fetch(url, {
     method
: 'POST',
     headers
: {
          
'Content-Type': 'application/x-www-form-urlencoded',
     
},
     body
: data,
});
const text = await response.text();
console
.log(text);
// replace {API-KEY} with your api key
// replace {SERVER-ID} with the server id
var url = "https://api.hopzone.eu/v1/";

var httpRequest
= (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";

httpRequest
.ContentType = "application/x-www-form-urlencoded";

var data
= "api_key={API-KEY}&generate={SERVER-ID}&type=json";

using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
     streamWriter
.Write(data);
}

var httpResponse
= (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
     var result
= streamReader.ReadToEnd();
}

Console.WriteLine(httpResponse.StatusCode);

Errors

The Hopzone API uses the following error codes:

Error Code Description
M000 Parameters are missing. This error appears when a mandatory parameter is missing.
M001 Too many parameters given. This error appears when too many parameters added in the request.
A002 Missing api_key. This error appears if the API key is missing.
A003 Wrong length for api_key. This error appears if the API key length is not 25 characters.
A004 Illegal characters found on api_key. This error appears if you use an invalid character other than a-Z and 0-9.
N005 Missing name. This error appears if the name parameter is missing.
N006 Wrong length for name. This error appears if the name parameter has less than 3 or more than 25 characters.
N007 Illegal characters found on name. This error appears if you use an invalid character other than a-Z and 0-9.
I008 Missing IP Address. This error appears if the IP Address parameter is missing.
I009 Invalid IP Address. This error appears if the IP Address parameter is not an IPv4 or IPv6 format.
I010 Wrong length for IP Address. This error appears if the IP Address parameter has less than 7 or more than 45 characters.
I011 Invalid IP Address. This error appears if you use an reserved range IP Address.
G012 Invalid generate. This error appears if the generate parameter is not a valid integer.
G014 Missing generate. This error appears if the generate parameter is missing.
G015 Wrong length for generate. This error appears if the generate parameter has less than 1 or more than 25 characters.
V016 Invalid vote_id. This error appears if the vote_id parameter is not a valid integer.
V017 Missing vote_id. This error appears if the vote_id parameter is missing.
V018 Wrong length for vote_id. This error appears if the vote_id parameter has less than 1 or more than 19 characters.
S019 Invalid server_id. This error appears if the server_id parameter is not a valid integer.
S020 Missing server_id. This error appears if the server_id parameter is missing.
S021 Wrong length for server_id. This error appears if the server_id parameter has less than 1 or more than 19 characters.
X666 if you see this error call GOD.

Important Information

Privacy Notice: We utilize cookies to optimize your browsing experience and analyze website traffic. By consenting, you acknowledge and agree to our Cookie Policy, ensuring your privacy preferences are respected.