Instagram Media/Feed API

Instagram Media/Feed API

我目前正在研究网络应用程序中的 Instagram 提要集成。 官方 API 是:Instagram Graph API and Instagram Platform API.

然后我在 SO here and 上发现了一个像 https://www.instagram.com/instagram/media/ 这样的端点,这似乎是一个未记录的(至少我没有在 facebook/instagram 文档上看到它)。 它是公开访问的,您可以获得很多关于帖子的信息,包括点赞和评论。

所以我的问题是:

它不是官方的API,它可能随时停止工作,不适合在应用程序中使用。其他 Instagram 未记录的 API 过去已经停止工作,它可以用于一次性项目,但我不会在 app/website.

中使用它

此端点已于 2017 年 11 月 7 日停止工作。但您可以使用其他端点获得相同的结果:

GET /users/user-id/media/recent
https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN

Get the most recent media published by a user.
The public_content scope is required if the user is not the owner of the access_token.

REQUIREMENTS
Scope: public_content

PARAMETERS
ACCESS_TOKEN    A valid access token.
MAX_ID  Return media earlier than this max_id.
MIN_ID  Return media later than this min_id.
COUNT   Count of media to return.

https://www.instagram.com/developer/endpoints/users/#get_users_media_recent

我在打字稿上写了 small library。它不需要访问令牌或客户端 id.The 库在后台使用 RegExp。您可以这样获取照片:

import Nanogram from 'nanogram.js';

const instagramParser = new Nanogram();

instagramParser.getMediaByUsername('instagram').then((media) => {
  console.log(media);
 });