Y
Y
yischyk2019-06-22 13:31:04
API
yischyk, 2019-06-22 13:31:04

How to get the reach value on a VK post?

There is a code

$wall = json_decode(file_get_contents('https://api.vk.com/method/wall.get?owner_id=-181643085&fields=id,text,date,views&access_token='.$token.'&v='.$v), true);
 foreach ($wall['response']['count'] as $wall_get) {
   echo $wall_get['views'];
 }

Can't get the reach of all posts

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Prilepa, 2019-06-22
@yischyk

Here is the documentation: https://vk.com/dev/objects/post
As far as I can see, coverage is not given there.

for some reason you are iterating over $wall['response']['count'] in the code - this is the same number-quantity, you need to iterate over $wall['response']['items'] - maybe this is the problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question