Beginning of work

API queries URL:

 https://api.iplogger.org/{module}/{method}/

 

where {module} is API module and {method} is method in module.

 

Example request for retrieve information about IP address:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.iplogger.org/ip/info/");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-token: {YOUR_SECRET_KEY}',
    'Content-Type: multipart/form-data'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
     'ip' => '8.8.8.8'
]);

$res = curl_exec($ch);
curl_close($ch);

$res = json_decode($res, true);

print_r($res);

All requests to the server can be in JSON or FORM-DATA format

All responses from the server returned in JSON format

All requests must contain your secret key, which can be created in the Account -> API section

Any requests from the server may generate errors. The error is reported via the status variable in the response.

 

Example error response: 

 {'status': 'key_unknown'}

If the response assumes data content, the data will be passed through the result variable:

 {

 'status': 'ok', 

 'result': [

   'ip': '8.8.8.8', 

   'country': 'US',

   'city': 'California',

   'continent': 'South America'

 ]

}

 

 

 

 

Article Details

Article ID:
9
Category:
Date added:
2022-11-04 16:48:03
Views:
1,753
Rating (Votes):
(10)

Related articles