Add a server

Take a look at our APIs to check the votes and track your stats

API documentation

Voting API (v2.0)

Our API allows you to verify that a user's vote has been completed. It returns the data in JSON with the date of the vote, the time remaining before the next one and the nickname.

<?php
$API_token = TOKEN; // Token of your server
$API_ip = $_SERVER['REMOTE_ADDR']; // IP address of the user
$json = file_get_contents("https://serveur-prive.net/api/vote/json/$API_token/$API_ip");
$json_data = json_decode($json);

if($json_data->status == 1) {
echo 'You have voted successfully';

// You can use the following variables:
$json_data->vote; // Corresponds to the date of the vote in timestamp format
$json_data->nextvote; // Corresponds to the number of seconds remaining before the user can vote again
$json_data->pseudo; // Username of the user (if he specified his username during his vote)
}
else {
echo 'Have not or already voted';
}
?>

Result Example

"status" = 1

{
"status":1,
"vote":1539775097,
"nextvote":3749,
"pseudo":"Trevor"
}


"status" = 0

{"status":0,"message":"Error message"}

Statistics API (v2.0)

Statistics API that retrieves the number of votes, clicks, comments, note or the position of your server in JSON format.

<?php
$API_token = TOKEN; // Token of your server
$json = file_get_contents("https://serveur-prive.net/api/stats/json/$API_token");
$json_data = json_decode($json);

if($json_data->status == 1) {
echo $json_data->position;
echo $json_data->vote;
echo $json_data->click;
echo $json_data->comment;
echo $json_data->note;
}
else {
echo 'Incorrect Token';
}
?>

Result Example

"status" = 1

{
"status":1,
"position":12,
"vote":1157,
"click":451,
"comment":9,
"note":5
}


"status" = 0

{"status":0,"message":"Error message"}

Known incompatibilities

If you use Cloudflare on your website, the IP address is recovered in this way.

<?php
// Cloudflare IP recovery
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
?>