如何使用新的Graph API访问任何用户的Instagram feed? [英] How to access Instagram feed of any user with new Graph API?
问题描述
Facebook最近推出了 Instagram Graph API ,该API可以获取数据在与您的Facebook公司页面相关的Instagram页面上, instagram.com/developers 指出:
Facebook recently introduced Instagram Graph API, which allows to fetch data from Instagram page that is connected to your Facebook company page, instagram.com/developers states:
Instagram Graph API 现在对所有开发人员可用.
对于非商业Instagram帐户,请继续使用现有的Instagram API .
The Instagram Graph API is Now Available to All Developers.
For Non-Business Instagram Accounts please continue to use the existing Instagram API.
例如,如果我的公司有帐户instagram.com/my_first_company
,那么我只能检索其供稿,而没有其他人.
So, for example, if my company has account instagram.com/my_first_company
, I can only retrieve its feed and no one else.
从旧的API文档:
public_content-读取用户的任何公开个人资料信息和媒体 代表(不再接受申请)
public_content - to read any public profile info and media on a user’s behalf (applications no longer accepted)
- 拥有
public_content
权限的现有工具会发生什么? (例如,有很多用于各种CMS的插件,可以显示最近的Instagram照片) - 现在是否有任何有效的方法来访问
public_content
(访问任何提要)(除了获取Instagram网站的HTML页面外)? - 是否有计划为非企业客户启用Graph API?何时?
- What will happen to existing tools that have
public_content
permission? (for example, there are tons of plugins for various CMS that allow to display recent Instagram photos) - Is there any valid way to access
public_content
(access to any feed) right now (besides fetching HTML pages of Instagram website)? - Are there any plans to enable Graph API for non-business customers, of so when?
-
获取Instagram企业帐户ID:
graph.facebook.com/v2.8/<fbPageId>?fields=instagram_business_account
. (fbPageId
是帐户链接到的Facebook页面的页面ID) Get the Instagram business account id:
graph.facebook.com/v2.8/<fbPageId>?fields=instagram_business_account
. (thefbPageId
is the page id of the facebook page the account is linked)
UPD.似乎有一个?__a=1
终结点,该终结点允许无需任何标记即可访问任何公共提要的近期照片.但这不是官方的,没人知道Instagram何时/是否将其关闭.如果您这样做-请让我知道.
UPD. There seem to be ?__a=1
endpoint that allows to get access to recent photos of any public feed without any tokens. But it's not official and no one knows when/if Instagram will close it. If you do - please let me know.
UPD 2. Instagram删除了?__a=1
终结点,不确定持续多长时间,可能永远.当前访问instagram feed的唯一方法是取消instagram.com网站,这是一个恐怖.
UPD 2. Instagram removed ?__a=1
endpoint, not sure for how long, probably forever. Currently the only way to access instagram feed is to scrap instagram.com website, which is a horror.
推荐答案
先决条件:您首先需要将Instagram商业帐户与FB Page关联. https://help.instagram.com/356902681064399 -可以从Instagram帐户的个人资料页面进行操作
Prerequisite: You first need the business Instagram account to be linked with FB Page. https://help.instagram.com/356902681064399 - That one can do from the profile page of Instagram account.
要获取instagram媒体供稿:graph.facebook.com/v2.8/<igBusinessId>/media
要获取Instagram帐户的媒体供稿. (igBusinessId
是上面链接的instagram_business_account
中返回的ID)-根据页面access_token,这仍然是拥有的媒体.没有其他用户的供稿.
To fetch instagram media feed: graph.facebook.com/v2.8/<igBusinessId>/media
to fetch the media feed of the Instagram account. (the igBusinessId
is the id returned in above linked instagram_business_account
) - This is still owned media as per the page access_token. Not any other user's feed.
All other endpoints (such as comments moderation, detailed insights API) mentioned here works on the business media list returned on above call.
请注意:
这仍然不允许获取未经身份验证的用户的Instagram feed.现在无法通过API实现.没有通过API到达public_content
范围的有效方法.启用此功能的Instagram营销合作伙伴很少.但是,现在一般不建议使用范围!
Please note:
This still does not allow to fetch un-authenticated user's Instagram feed. That is not possible via API now. There is no valid way via API to get to public_content
scope. There can be few Instagram Marketing partners for which this is enabled. But, in general the scope is deprecated now!
当前,要使FB graph API正常工作,我们需要将业务页面链接到Instagram帐户.如上所述,api使用页面令牌.
Currently, for FB graph API to work we need linked business page to Instagram account. As above apis uses page tokens.
这篇关于如何使用新的Graph API访问任何用户的Instagram feed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!