C
C
corgi_dec2020-08-12 16:38:10
Python
corgi_dec, 2020-08-12 16:38:10

VK Api: How to download user data using users.get and execute?

I have a txt list with 100k users. You need to upload data about them. I don't understand how execute works. I'm using a similar build:

import requests

code = """
return API.users.get({
"user_ids": id1, id2, id3,
"v": "5.122"
});"""

r = requests.post(
    url="https://api.vk.com/method/execute",
        data={
            "code": code,
            "access_token": "здесь токен",
            "v": "5.122"
        }
)
response_data = r.json()


The server terminates the connection due to the number of requests being exceeded. How can I bypass the restriction?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2020-08-12
@anerev

As I understand it, execute calls intermediate VK API methods, I think you can pass a list of id to 'code' and already there execute a request 1000 at a time in a cycle and return a ready-made array . The problem is that I don’t know JS and I can’t tell you exactly how to do this, but judging by the description, it’s possible and most likely you need to dig in this direction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question