I'm almost new to python. I'm writing an instagram bot to share posts of my page to people on instagram. But i get restricted most of the times by instagram.
My first question is how to use proxies in instagrapi to bypass the restrictions. And the code below is what instagrapi documentation has put on their github page.
from instagrapi import Client
cl = Client()
before_ip = cl._send_public_request("https://api.ipify.org/")
cl.set_proxy("http://<api_key>:wifi;ca;;;toronto@proxy.soax.com:9137")
after_ip = cl._send_public_request("https://api.ipify.org/")
print(f"Before: {before_ip}")
print(f"After: {after_ip}")
But I actually don't know how to use it. I mean, how should I play with the proxies while the bot is on and working? should i just use once when robot starts, or I have to change proxy after a couple of actions done? (like gathering 10 users from instagram)
And in any of these ways, how should the code look like?