如何使用API通过标签获取所有Instagram帖子(不仅是我自己帐户的帖子)
如何通过API使用主题标签获取所有 Instagram帖子(不仅是我自己帐户的帖子)
How to get ALL Instagram POSTs by hashtag with the API (not only the posts of my own account)
我试图获取所有带有精确标签的instagram图片,但我只收到自己的带有标签的开发人员帐户帖子.
I am trying to get all the instagram pictures tagged with a precise hashtag but I only receive my own developer account posts tagged with the hashtag.
我目前在本地开发环境中工作,也许是问题所在吗?
I am currently working in local development environment, maybe that's the problem?
此外,什么是沙盒模式,我应该怎么做才能进入真实"模式?
Furthermore, what is Sandbox mode, and what should I do to go "Real" mode ?
在平台政策中,其写为"未经用户明确同意,您不能使用API平台来爬网或存储用户的媒体.".
In the platform policy, it's written "You cannot use the API Platform to crawl or store users' media without their express consent." .
这是否意味着我试图做的事根本不可能?
Does it mean that what I am trying to do is simply not possible ?
感谢您的帮助
You can get the posts in raw JSON by simply accessing this URL: https://www.instagram.com/explore/tags/summer/?__a=1
然后只使用javascript/jquery通过帖子循环获取数据.您将获得12个帖子,还有一个变量来查看是否还有更多页面.
Then just use javascript/jquery to fetch the data an loop through the posts. You get 12 posts, and a variable to see if there are more pages.
获取最新6篇帖子的示例:
$.get('https://www.instagram.com/explore/tags/summer/?__a=1', function (data, status) {
for(var i = 0; i < 6; i++) {
var $this = data.graphql.hashtag.edge_hashtag_to_media.edges[i].node;
$('#container').append('<img src="'+ $this.thumbnail_resources[2].src +'">');
}
});