I want to fetch Related/Similar/Suggested accounts for a particular Instagram username.
I have tried following methods, but it doesn't give the suggested users
from instagram_private_api import Client
api = Client(username, password)
api.user_info(userid)
api.username_info(target_username)
api.username_detail_info(userid)
I have found that with given URL
https://www.instagram.com/{username}/?__a=1
we can get the suggested profiles like this
import requests
user_agent = 'Chrome'
url = 'https://www.instagram.com/{username}/?__a=1'
res = requests.get(url, headers={'user-agent':user_agent})
data = res.json()
data2 = data['graphql']['user']['edge_related_profiles']['edges']
len(data2)
>>>80
Somehow I am not able to use web_api. But I have found that user_info2 uses the same URL to get the info about the username. It always returns JSONDecodeError. Is there any other method in` private or web api to get suggested profiles?
Before submitting an issue, make sure you have:
Which client are you using?
instagram_private_api/
)instagram_web_api/
)Describe your Feature Request:
I want to fetch Related/Similar/Suggested accounts for a particular Instagram username.
I have tried following methods, but it doesn't give the suggested users
I have found that with given URL
we can get the suggested profiles like this
Somehow I am not able to use
web_api
. But I have found thatuser_info2
uses the same URL to get the info about the username. It always returnsJSONDecodeError
. Is there any other method in` private or web api to get suggested profiles?