如何通过API获取Instagram个人资料图片? [英] How to get Instagram Profile Picture via API?

查看:141
本文介绍了如何通过API获取Instagram个人资料图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Instagram API提取Instagram个人资料图片? 基本图形API不包含个人资料图片,而旧版API已停产.

How do I extract an Instagram Profile picture using Instagram API? The basic graph API doesn't contain profile picture and the legacy API has been discontinued.

推荐答案

使用以下URL之一

  • https://www.instagram.com/USERNAME/?__a=1
  • https://i.instagram.com/api/v1/users/USER_ID/info/

注意:要获取Instagram USER_ID ,请在Instagram USERNAME

如果使用第二个URL,则需要在请求中放入一些用户代理.这就是我对cURL的处理方式.

If you use second URL, you need to put some user-agent with your request. This is How I do with cURL.

curl -s -H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; 828x1792; 165586599)' https://i.instagram.com/api/v1/users/USER_ID/info/

这篇关于如何通过API获取Instagram个人资料图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆