/bandwidth/get_usage_by_day


GET https://api.sitehost.nz/1.0/bandwidth/get_usage_by_day.json

Gets bandwidth usage of an IP address for a specific day.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
ip_addrstringYesThe IP address.Example: 192.168.10.1/32
params[from]stringThe from timestamp.Example: 1461131200
params[to]stringThe to timestamp.Example: 1461931200

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/bandwidth/get_usage_by_day.json?apikey=your_key_here&client_id=1&ip_addr=192.168.10.1%2F32&params[from]=1461131200&params[to]=1461931200", false);

xmlHttp.send();

var response = xmlHttp.responseText;

Response

200:

application/json
{
  "return": {
    "192.168.10.1/32": {
      "2014-05-16": {
        "DOMESTIC": {
          "peak_in": 0,
          "offpeak_in": 0,
          "peak_out": 0.1436,
          "offpeak_out": 0
        },
        "INTERNATIONAL": {
          "peak_in": 0,
          "offpeak_in": 0,
          "peak_out": 0,
          "offpeak_out": 0
        }
      } 
    }
  },
  "msg": "Successful",
  "status": true,
  "time
}