Skip to main content

Get statistics

Gets the overall community statistics for a period

Function GetStatistics(Val StartDate, Val EndDate, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
StartDate--datefromDateStart date of the period
EndDate--datetoDateEnd date of the period
Parameters--authStructure Of StringAuthorization JSON or path to .json

Returns: Map Of KeyAndValue - serialized JSON response from VK


1C:Enterprise/OneScript code example
    Parameters = GetVKParameters();

CurrentDate = OPI_Tools.GetCurrentDate();
StartDate = BegOfDay(CurrentDate);
EndDate = EndOfDay(StartDate);

Result = OPI_VK.GetStatistics(StartDate, EndDate, Parameters);
    # JSON data can also be passed as a path to a .json file

oint vk GetStatistics \
--datefrom "2024-10-31T00:00:00" \
--dateto "2024-10-31T23:59:59" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": [
{
"activity": {
"comments": 1,
"likes": 1
},
"period_from": 1728432000,
"period_to": 1728518399,
"reach": {
"age": [
{
"value": "12-18",
"count": 0
},
{
"value": "18-21",
"count": 0
},
{
"value": "21-24",
"count": 1
},
{
"value": "24-27",
"count": 0
},
{
"value": "27-30",
"count": 0
},
{
"value": "30-35",
"count": 0
},
{
"value": "35-45",
"count": 0
},
{
"value": "45-100",
"count": 0
}
],
"cities": [],
"countries": [
{
"code": "BY",
"count": 1,
"name": "Беларусь",
"value": 3
}
],
"mobile_reach": 1,
"reach": 1,
"reach_subscribers": 1,
"sex": [
{
"value": "f",
"count": 0
},
{
"value": "m",
"count": 1
}
],
"sex_age": [
{
"value": "f;12-18",
"count": 0
},
{
"value": "f;18-21",
"count": 0
},
{
"value": "f;21-24",
"count": 0
},
{
"value": "f;24-27",
"count": 0
},
{
"value": "f;27-30",
"count": 0
},
{
"value": "f;30-35",
"count": 0
},
{
"value": "f;35-45",
"count": 0
},
{
"value": "f;45-100",
"count": 0
},
{
"value": "m;12-18",
"count": 0
},
{
"value": "m;18-21",
"count": 0
},
{
"value": "m;21-24",
"count": 1
},
{
"value": "m;24-27",
"count": 0
},
{
"value": "m;27-30",
"count": 0
},
{
"value": "m;30-35",
"count": 0
},
{
"value": "m;35-45",
"count": 0
},
{
"value": "m;45-100",
"count": 0
}
]
},
"visitors": {
"cities": [],
"countries": [
{
"code": "RU",
"count": 1,
"name": "Россия",
"value": 1
}
],
"mobile_views": 0,
"views": 1,
"visitors": 1
}
},
{
"activity": {
...