1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-29 22:27:42 +02:00
Files
OpenIntegrations/docs/en/md/VK/Statistics/Get-statistics.mdx
Vitaly the Alpaca (bot) f0b670e998 Main build (Jenkins)
2025-11-05 19:43:00 +03:00

220 lines
4.2 KiB
Plaintext
Vendored

---
sidebar_position: 1
description: Get statistics and other functions to work with VK in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, VK]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Get statistics
Gets the overall community statistics for a period
`Function GetStatistics(Val StartDate, Val EndDate, Val Parameters = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| StartDate | --datefrom | Date | ✔ | Start date of the period |
| EndDate | --dateto | Date | ✔ | End date of the period |
| Parameters | --auth | Structure Of String | ✖ | Authorization parameters. See GetAuthParameters |
Returns: Map Of KeyAndValue - serialized JSON response from VK
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Parameters = GetVKParameters();
CurrentDate = OPI_Tools.GetCurrentDate();
StartDate = BegOfDay(CurrentDate);
EndDate = EndOfDay(StartDate);
Result = OPI_VK.GetStatistics(StartDate, EndDate, Parameters);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint vk GetStatistics \
--datefrom "2025-10-30T00:00:00" \
--dateto "2025-10-30T23:59:59" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint vk GetStatistics ^
--datefrom "2025-10-30T00:00:00" ^
--dateto "2025-10-30T23:59:59" ^
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
```
</TabItem>
</Tabs>
```json title="Result"
{
"response": [
{
"activity": {
"comments": 4,
"likes": 4
},
"period_from": 1761868800,
"period_to": 1761955199,
"reach": {
"age": [
{
"value": "12-18",
"count": 0
},
{
"value": "18-21",
"count": 0
},
{
"value": "21-24",
"count": 0
},
{
"value": "24-27",
"count": 1
},
{
"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": 0
},
{
"value": "m;24-27",
"count": 1
},
{
"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": [],
"mobile_views": 0,
"views": 0,
"visitors": 0
}
},
{
"activity": {
"comments": 7,
"likes": 7
},
"period_from": 1761782400,
"period_to": 1761868799,
"reach": {
"age": [
...
```