IntégrationsTime data

Receiving time data

Time data is used to build charts. The data on them is aggregated by days, for example, day 1 – 110 visits, 232 events, day 2 – 134 visits, 357 events, etc.

Request format #

To get time data, execute the GET request:

GET https://content.mql5.com/api/v1/reports/website/{WEBSITE_ID}/daily
 ?metrics=<string>
 &date_from=<unixtime>
 &date_to=<unixtime>
 &order=<string>

Set the website ID as {WEBSITE_ID}. It can be obtained in the website settings (ID field) of the Finteza panel.

Request parameters #

Parameter

Type

Description

metrics *

string

List of metrics (comma-separated), for example, metrics=visits,events.

date_from *

unixtime

Data request initial date. Specified in seconds since 1970.01.01, for example, date_from=1549027860.

date_to *

unixtime

Data request end date. Specified in seconds since 1970.01.01, for example, date_from=1549027860.

order

string

Name of the field sorting is to be based on. To reverse the sorting, set "-" before the field name, for example, order=-visits.

* – required parameters.

Sample request #

GET https://content.mql5.com/v1/reports/website/dxnnhxrwpcwsgwowveipxmslrznjfhzarp/table
 ?metrics=webvisits,events
 &date_from=1549027860
 &date_to=1549632660

Sample response #

{
    "data": {
        "offset": 0,
        "limit": 20,
        "date_from": 1549027860,
        "date_to": 1549632660,
        "where": {
            "os""windows",
            "device""*mobile",
            "country""!ru",
        },
        "order""webvisits",
        "items": [ {
            "ua_device""Desktop",
            "ua_device_model""Apple",
            "webvisits": 4205748,
            "events": 1247138
        }, {
            "ua_device""Mobile",
            "ua_device_model""Apple",
            "webvisits": 42050,
            "events": 1247
        }, {
            "ua_device""Tablet",
            "ua_device_model""Apple",
            "webvisits": 420,
            "events": 12
        } ]
    }
}