生成登录令牌Instagram API,而无需登录? [英] Generate access token Instagram API, without having to log in?

查看:422
本文介绍了生成登录令牌Instagram API,而无需登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在构建一个餐厅应用程序,我想要的功能之一是允许该应用程序的用户查看特定餐厅的Instagram帐户中的照片. 而且我希望用户无需登录Instagram帐户就能看到此内容,因此他们甚至不需要Instagram帐户即可工作.

So I am building a restaurant app and one of the features I want is to allow a user of the app to see photos from a particular restaurant's Instagram account. And I want a user to be able to see this without having to login to their Instagram account, so they shouldn't even need an Instagram account for this to work.

所以我已经阅读了这个答案

So I have read this answer How can I get a user's media from Instagram without authenticating as a user?

我尝试了它所说的内容并使用了client_id(当我使用个人Instagram帐户注册应用程序时收到了该信息),但我仍然收到一条错误消息:

And I tried what it said and used the client_id(which I recieved when I registered my app using my personal Instagram account), but I still get an error back saying :

{
    meta: {
          error_type: "OAuthAccessTokenException",
          code: 400,
          error_message: "The access_token provided is invalid."
     }
}

我要命中的端点是:

https://api.instagram.com/v1/users/search?q=[USERNAME]&client_id=[CLIENT ID]

那么我是否绝对需要访问令牌才能工作(因此必须强制用户登录)?

So do I absolutely need an access token for this to work(and thus have to enforce a user to log in) ?

如果我这样做了,那么有没有办法在不强制用户登录的情况下生成访问令牌?

If I do, then is there way to generate an access token somehow without forcing the user log in?

我相信这是有办法解决的,因为流行的约会应用程序Tinder具有我正在寻找的所需功能,因为它使您无需登录即可查看别人的Instagram帐户中的照片! (我刚刚在5分钟前验证过!)

I believe there is a way around this, as the popular dating app Tinder has this desired functionality I am looking for, as it allows you to see photos from people's Instagram account without having to log in! (I have just verified this 5 minutes ago!)

在此方面的任何帮助将不胜感激.

Any help on this would be much appreciated.

谢谢.

推荐答案

编辑2018年4月:在Facebook隐私案之后,该端点立即停用.似乎我们需要直接在个人资料页面中解析<script>标记中嵌入的JSON:

Edit April 2018: After facebook privacy case this endpoint is immediately put out of service. It seems we need to parse the JSON embedded in <script> tag directly within the profile page:

<script type="text/javascript">window._sharedData = {"activity_counts":...

欢迎提出更好的主意.

您可以使用最新链接

You can use the most recent link

获取 https://www.instagram.com/ {username}/?__ a = 1

GET https://www.instagram.com/{username}/?__a=1

以JSON格式获取最新的20条帖子.希望您能很好地利用它.

to get latest 20 posts in JSON format. Hope you put this to good use.

其他方法不再有效: https://www.instagram.com/ {username}/media/

edit: other ways aren't valid anymore: https://www.instagram.com/{username}/media/

这篇关于生成登录令牌Instagram API,而无需登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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