E
E
elmes2018-06-25 11:17:25
Python
elmes, 2018-06-25 11:17:25

How to find out the number of views of a post in VK using python 3 and vk api?

Hello. Wrote a small parser in python 3 via api vk. I need to get information from community walls about posts (number of likes, reposts, comments and views). The parser works through the requests library and returns the result as json. This returns everything except views (the views object in the documentation).
My request looks like this:
r = requests.get(' https://api.vk.com/method/wall.get ', params={'owner_id': id, 'count': 1, 'access_token': access_token , 'offset': 0, 'version': 5.73})
response = r.json()
which is exactly what I need. Actually, the question is - am I doing something wrong, is it some kind of api bug, or is it simply impossible to get with the tools that I use (requests library). I would be grateful for help)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2018-07-12
@fixator10

The version is specified by the parameter v, notversion

r = requests.get("https://api.vk.com/method/wall.get", params={"owner_id": id, "count": 1, "offset": 0, "access_token": access_token, "v": "5.80"})
response = r.json()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question