如何从instagram API打印get请求?

2024-10-05 14:21:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用instagram API对一些图像进行爬网,但我始终收到以下错误:

{'meta': {'error_type': 'OAuthParameterException', 'error_message': 'Missing client_id or access_token URL parameter.', 'code': 400}}

AttributeError: module 'urllib3.response' has no attribute 'content'

下面是我用python编写的代码:

^{pr2}$

Tags: or图像clienttokenapiidmessageaccess
1条回答
网友
1楼 · 发布于 2024-10-05 14:21:35

您需要在OAuth2上下文中执行api查询。 你可以在apigee console

如果需要以编程方式获取数据,请使用python-instagramlib设置必需的数据(access_token)

from instagram.client import InstagramAPI
api = InstagramAPI(access_token = 'YOUR ACCESS TOKEN')
#tested arguments
q=None
count=100
lat=51
lng=0.098 
min_timestamp, max_timestamp =None,None
distance=1000
result = api.media_search(q,count,lat,lng,min_timestamp,max_timestamp,distance)

相关问题 更多 >