今天Instagram本身通过使用下面的URL给用户详细信息,但现在它不起作用。
https://i.instagram.com/api/v1/users/{userID}/info/
先谢谢你了
q3qa4bjr1#
同样的问题从Instagram注销,然后重定向到:
https://www.instagram.com/accounts/login/?next=/api/v1/users/{userID}/info/
yb3bgrhw2#
使用python库**“ensta”**。
pip install ensta
为了您的目的,您可以使用此功能:
from ensta import Guest guest = Guest() username = guest.get_username("user_id"). # UserID to Username info = guest.profile_info(username) print(info)
uyto3xhc3#
python您需要User-Agent和登录会话
headers = { 'User-Agent': 'Instagram 27.0.0.7.97 (iPhone7,2; iPhone OS 9_3_3; en_US; en-US; scale=2.00; 750x1334) AppleWebKit/420+'} session = requests.Session() "login stuff here" response = session.get(url, headers=headers)
测试和工作
3条答案
按热度按时间q3qa4bjr1#
同样的问题
从Instagram注销,然后重定向到:
yb3bgrhw2#
使用python库**“ensta”**。
用法
安装
示例
为了您的目的,您可以使用此功能:
uyto3xhc3#
python您需要User-Agent和登录会话
测试和工作