无需登录屏幕即可获取 Instagram 访问令牌
Get Instagram access token without login screen
我正在我的网站上使用新版 Instagram api。代码隐藏是c#。
我需要检索带有给定主题标签的照片,然后在我的网页中显示这些照片。
是否可以在不为访问我的网络应用程序以获取访问令牌的每个用户显示登录屏幕的情况下执行此操作?
我可以在 public instagram 页面中看到我想要的每个标签,而无需自我验证(Es:https://www.instagram.com/explore/tags/ciao/)。
如果答案是否定的,我可以通过 api 验证自己并避免登录屏幕吗?
提前致谢,对不起我的英语。
来自 Instagram API 文档:
You can retrieve photos with a given hashtag by accessing the following URL with your access_token
(replace ACCESS-TOKEN
with your own):
https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=ACCESS_TOKEN
The Instagram API requires an access_token
from authenticated users for each endpoint. We no longer support making requests using just the client_id
.
此 access_token
不需要是您的用户的令牌。它可能是你的代币。但它必须是某人的。
请务必同时查看 rate limit 文档。每个访问令牌的速率限制都是独立的,因此您可能需要生成多个访问令牌并 round-robin 它们。您还可以允许您的用户在需要时登录,并在他们登录后使用他们的访问令牌。
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
var token = 'YOUR_ACCESS_TOKEN',
hashtag='vindiesel', // hashtag without # symbol
num_photos = 4;
$.ajax({
url: 'https://api.instagram.com/v1/tags/' + hashtag + '/media/recent',
dataType: 'jsonp',
type: 'GET',
data: {access_token: token, count: num_photos},
success: function(data){
console.log(data);
for(x in data.data){
$('ul').append('<li><img src="'+data.data[x].images.standard_resolution.url+'"></li>');
}
},
error: function(data){
console.log(data);
}
});
</script>
我正在我的网站上使用新版 Instagram api。代码隐藏是c#。 我需要检索带有给定主题标签的照片,然后在我的网页中显示这些照片。
是否可以在不为访问我的网络应用程序以获取访问令牌的每个用户显示登录屏幕的情况下执行此操作?
我可以在 public instagram 页面中看到我想要的每个标签,而无需自我验证(Es:https://www.instagram.com/explore/tags/ciao/)。
如果答案是否定的,我可以通过 api 验证自己并避免登录屏幕吗?
提前致谢,对不起我的英语。
来自 Instagram API 文档:
You can retrieve photos with a given hashtag by accessing the following URL with your
access_token
(replaceACCESS-TOKEN
with your own):https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=ACCESS_TOKEN
The Instagram API requires an
access_token
from authenticated users for each endpoint. We no longer support making requests using just theclient_id
.
此 access_token
不需要是您的用户的令牌。它可能是你的代币。但它必须是某人的。
请务必同时查看 rate limit 文档。每个访问令牌的速率限制都是独立的,因此您可能需要生成多个访问令牌并 round-robin 它们。您还可以允许您的用户在需要时登录,并在他们登录后使用他们的访问令牌。
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
var token = 'YOUR_ACCESS_TOKEN',
hashtag='vindiesel', // hashtag without # symbol
num_photos = 4;
$.ajax({
url: 'https://api.instagram.com/v1/tags/' + hashtag + '/media/recent',
dataType: 'jsonp',
type: 'GET',
data: {access_token: token, count: num_photos},
success: function(data){
console.log(data);
for(x in data.data){
$('ul').append('<li><img src="'+data.data[x].images.standard_resolution.url+'"></li>');
}
},
error: function(data){
console.log(data);
}
});
</script>