Get Instagram Stories Json

10,387

There is currently no official API for Instagram Stories.

In order to authenticate the request to that unofficial API endpoint, you must send a device 'sessionid', not your Instagram app's access token.

You can read my Medium article describing what you need to make a successful request to retrieve Instagram Stories: https://medium.com/@calialec/chrome-ig-story-bribing-the-instagram-story-api-with-cookies-c813e6dff911

Also, check out my GitHub repo to see where I'm injecting the cookies into the request: https://github.com/CaliAlec/ChromeIGStory/blob/master/event/src/index.js#L167

Share:
10,387

Related videos on Youtube

Tushar Pingale
Author by

Tushar Pingale

Updated on May 28, 2022

Comments

  • Tushar Pingale
    Tushar Pingale almost 2 years

    How can I get Instagram Stories in JSON Object by using Instagram API? I have tried using the following URL, but I am getting this error.

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

    Code :

    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) {
    
            }
        });
    
    • Orvenito
      Orvenito over 6 years
      bro, you have to login.
    • Tushar Pingale
      Tushar Pingale over 6 years
      where to add the authorization code in the Api Url. I got the authorization token.
    • Orvenito
      Orvenito over 6 years
      show some code.
    • Tushar Pingale
      Tushar Pingale over 6 years
      @Orvenito see my code
  • Tushar Pingale
    Tushar Pingale over 6 years
    Here is my api that i am using i.instagram.com/api/v1/feed/user/MY_USER_ID/reel_media/… but same error
  • redead
    redead over 6 years
    You should change the URL to the documented form: api.instagram.com/v1/feed/user/MY_USER_ID/reel_media/…
  • redead
    redead over 6 years
    Try to paste the URL to a browser. You should get your desired result there. Otherwise your access token may have expired
  • Tushar Pingale
    Tushar Pingale over 6 years
    Same error. Can you make sure, it is the same URL required to fetch Instagram stories?
  • redead
    redead over 6 years
    Have a look at sandbox mode. instagram.com/developer/sandbox
  • Mykyta Bondarenko
    Mykyta Bondarenko almost 6 years
    Hi. I have the same issue now. It appeared just a day ago for me :( I use all 3 cookies: sessionid (I regenerate it for each session), csrftoken and ds_user_id
  • Vishal Patoliya ツ
    Vishal Patoliya ツ about 5 years
    @Alec I have not found github project, can you help me please.
  • Vishal Patoliya ツ
    Vishal Patoliya ツ about 5 years
    @redead this url is not working can you please help me for that
  • Alec Garcia
    Alec Garcia about 5 years
    @VishalPatoliyaツ Due to a Cease & Desist letter from Facebook, I have been forced to take down the GitHub repo.