Skip to main content

Traffic Usage in a Time Window

Shows the traffic details based on a specified time range.

Parameters

Parameter

Type

Required

Description

user_key

string

Yes

API User Token

user_secret

string

Yes

API User Secret Token

from

string

Yes

Y-m-d date format.

to

string

Yes

Y-m-d date format.

type

string

Yes

stream or progressive.

interval

string

Yes

hourly, daily, monthly

limit

int

No

Maximum 100, default 50.

page

int

No

Default 1

zone_ids

array

No

int value(s).

Return Values

Variable

Type

total

integer

pages

integer

page

integer

limit

integer

stats

object

datetime

string

timezone

string

hit

integer

traffic

float

bandwidth

float

Example PHP Code

CODE
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.medianova.com/v1/report/histogram?",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Example Output

CODE
{
    "status": true,
    "data": {
        "total": 10,
        "pages": 2,
        "page": 1,
        "limit": 5,
        "stats": [
            {
                "datetime": "2016-08-01 00:00:00",
                "timezone":"GMT+3",
                "hit": 1070549,
                "traffic": 79701715128,
                "bandwidth": 177114923
            },
            {
                "datetime": "2016-08-01 01:00:00",
                "timezone":"GMT+3",
                "hit": 712711,
                "traffic": 67422618602,
                "bandwidth": 149828041
            },
            {
                "datetime": "2016-08-01 02:00:00",
                "timezone":"GMT+3",
                "hit": 464501,
                "traffic": 50434938302,
                "bandwidth": 112077641
            },
            {
                "datetime": "2016-08-01 03:00:00",
                "timezone":"GMT+3",
                "hit": 369792,
                "traffic": 33773256360,
                "bandwidth": 75051681
            },
            {
                "datetime": "2016-08-01 04:00:00",
                "timezone":"GMT+3",
                "hit": 254861,
                "traffic": 20045031448,
                "bandwidth": 44544514
            }
        ]
    }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.