【问题标题】:Instagram API for implementing Instagram Video Downloader, InstaDP and Instagram Stories用于实现 Instagram Video Downloader、InstaDP 和 Instagram Stories 的 Instagram API
【发布时间】:2020-04-26 17:06:19
【问题描述】:

我正在搜索获取用户 DP 和故事的 Instagram API。我尝试了一些方法,例如从 https://api.instagram.com/v1/users/{user-id}/media/recent?callback=&client_id={client_id} 获取 DP,但它一次又一次地被阻止并在我拥有的 Instagram 应用程序上提示一个活动弹出窗口接受几次。有谁知道他们为所有 Instagram 工具 https://instadownloaderpro.com 使用什么 API,尤其是 Instagram Video Downloader 工具?我也尝试了 mgp25/Instagram-API,但它不允许我获得 Insta DP 和 Stories。 Facebook Graph API 是否在这种情况下工作?

【问题讨论】:

    标签: instagram instagram-api instagram-graph-api instagram-story


    【解决方案1】:
    You could use this code for InstaDP
    
    use MetzWeb\Instagram\Instagram;
    
    $instagram = new Instagram(array(
        'apiKey'      => 'YOUR_APP_KEY',
        'apiSecret'   => 'YOUR_APP_SECRET',
        'apiCallback' => 'YOUR_APP_CALLBACK'
    ));
    
    // grab OAuth callback code
    $code = $_GET['code']; 
    // or maybe $code = $request->code; // if you are using Laravel
    $data = $instagram->getOAuthToken($code);
    
    // set user access token
    $instagram->setAccessToken($data);
    
    // and
    $pictures = $instagram->getUserMedia();
    

    【讨论】:

      【解决方案2】:

      如果 Insta api 现在还没有完全消失,他们正在停用它。所以可能不值得建立任何可持续的东西。在过去的 5 年里,我一直致力于社交 API,并且我已经能够获得我想要批准的所有可能存在的范围。

      是的,您可以使用 Graph API。有一些注意事项。

      开箱即用,您至少需要申请。这些也不能保证获得批准。

      • instagram_basic
      • instagram_manage_insights
      • manage_pages 或 pages_show_list(均为 Facebook)

      下面是详细介绍

      1. Instagram(通过 Facebook Graph API)分解了对 DP 和故事的访问。没有抓取故事只能通过使用 Instagram Insights 范围访问,这也需要从该帐户对 Creator 和 Business 类型帐户进行身份验证。您必须通过 Facebook 对该范围的批准流程。一旦获得批准,您经过身份验证的令牌可以在大约 30 天内访问这些数据。

      https://developers.facebook.com/docs/instagram-api/guides/insights

      1. 现在,您可以从 Business Discovery API 为任何创建者和业务类型帐户获取 DP 和媒体,而无需对您要查找的帐户进行身份验证。但是,您必须验证您拥有的帐户,才能通过该帐户令牌进行搜索。您必须获得 Instagram 公共 API 范围的批准。

      https://developers.facebook.com/docs/instagram-api/guides/business-discovery https://developers.facebook.com/docs/instagram-api/reference/user/business_discovery

      1. 您无法从私人/个人 Instagram 帐户获取故事,但您可以使用 Instagram 基本显示 API 获取 DP 和媒体。此范围确实需要身份验证。一旦获得批准,您经过身份验证的令牌可以访问此数据一小时。这通常用于约会应用程序和游戏等您可能想要 OAuth 您的 Insta 帐户并提供您的个人资料图片或个人资料照片的事情。此 API 附带的所有媒体也没有任何相关的指标。

      https://developers.facebook.com/docs/instagram-basic-display-api

      有关创作者和企业帐户的其他信息: https://developers.facebook.com/docs/instagram-api/reference/user

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多