代码之家  ›  专栏  ›  技术社区  ›  Tushar Pingale

获取Instagram Stories Json

  •  2
  • Tushar Pingale  · 技术社区  · 9 年前

    // https://i.instagram.com/api/v1/feed/user/MY_USER_ID/reel_media/
    
    {
      "message": "login_required",
      "logout_reason": 2,
      "status": "fail"
    }
    

    代码:

    String id = userInfoHashmap.get(InstagramApp.TAG_ID);
    
        JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "https://i.instagram.com/api/v1/feed/user/"+id +"/reel_media/?access_token="+mApp.getTOken(), new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                Log.d("ID: ", String.valueOf(response));
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
    
            }
        });
    
    2 回复  |  直到 9 年前
        1
  •  3
  •   Alec Garcia    9 年前

    目前,Instagram故事没有官方API。

    为了验证对该非官方API端点的请求,您必须发送设备“sessionid”,而不是Instagram应用程序的访问令牌。

    https://medium.com/@calialec/chrome-ig-story-bribing-the-instagram-story-api-with-cookies-c813e6dff911

    此外,请查看我的GitHub repo,查看我将Cookie注入请求的位置: https://github.com/CaliAlec/ChromeIGStory/blob/master/event/src/index.js#L167

        2
  •  -1
  •   redead    9 年前

    你看过Instagram API文档了吗?它 states 您需要一个访问令牌来调用API。将访问令牌作为查询参数添加到端点。