使用 instagram API 从 public 个帐户获取媒体

Get media from public accounts with instagram API

我在一家公司工作,该公司在 public 健身房或等候室等地方的大屏幕上显示内容。

一位客户要求应用程序显示名人帐户中的 Instagram 内容,因此我使用 Instagram API.

创建了一个

问题是该应用程序在 sandbox mode 中,它获取空白数据。

我好像只能显示来自沙盒用户(不是碧昂斯)的媒体,当我提交审核时它被拒绝了,因为它不符合要求。

有没有办法让它工作?

在测试期间,我使用了在互联网上找到的有效访问令牌,但我认为这不是有效的解决方案。

你是对的,当应用程序处于 sandbox mode 时,你只能看到你预先设置的沙盒用户在 Instagram 上的数据。在此模式下,您不会在 Instagram 上获得任何 public 数据。

根据 API,您的应用不符合获得批准所需的条件。

来自 Permissions Review 页面:

Valid Use Cases

We will approve submissions of apps that fall into these use cases:

  • To help individuals share their own content with 3rd party apps
  • To help brands and advertisers understand and manage their audience and digital media rights
  • To help broadcasters and publishers discover content, get digital > rights to media, and share media with proper attribution

他们还列出了无法获得批准的应用程序用例,您的应用程序似乎符合其中之一:

Here are some examples of scenarios that will not be approved:

  • One-off projects. If you are an agency building websites or other integrations, note that we don't grant permissions to clients created for one-off projects. If you are interested in building a product, platform, or widget that will be used as a service across multiple projects, then you may submit a single client_id that you can use across multiple projects
    ...

要获得批准,您应该修改您的申请以符合标准,或许构建多个项目?

你也可以尝试从这个URL中提取数据:https://www.instagram.com/<username>/media/

对于 Beyonce 帐户,使用:https://www.instagram.com/beyonce/media/

最后,access token 每个应用程序都是唯一的,因此您不能随机使用。这是有关 how to generate access token 应用程序的教程。