Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I find Instagram Stories using the Public API?

Released here: http://blog.instagram.com/post/148348940287/160802-stories

No note of Stories being available via the API.

like image 584
John Hayes Avatar asked Aug 08 '16 08:08

John Hayes


People also ask

Can you search public Instagram stories?

Similar to the location-based search results, if there are stories related to a hashtag you're searching, the round icon with the Instagram-colored ring will appear at the top of the search results page, allowing you to view those public stories.

What information can I get from Instagram API?

The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.

Is Instagram's API public?

Instagram API ChangesIn 2018, Instagram shut down its public API. Meaning, third-party apps can no longer access the API from Instagram without permission. Third-party apps now need to be approved by Instagram before they can access the API.


3 Answers

This is available now, but only if the user authorizes your app. The user's account would also need to be an Instagram Business Account.

https://developers.facebook.com/docs/instagram-api/reference/user/stories

like image 138
ryechus Avatar answered Oct 18 '22 00:10

ryechus


There is no public API, but you can get the story json data by going to instagram.com login with your account and paste this code in the console, it will output data in console

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
  if (xhttp.readyState == 4 && xhttp.status == 200) {
     console.log(xhttp.responseText);
  }
};
xhttp.open("GET", "https://i.instagram.com/api/v1/feed/reels_tray/", true);
xhttp.send();

(you have to do it from instagram.com and user logged in)

like image 44
krisrak Avatar answered Oct 18 '22 00:10

krisrak


Yes, with two endpoints:

  1. Perform a GET to https://www.instagram.com/{username}/?__a=1 to get the user id under ROOT.graphql.user.id

  2. Perform a GET to https://i.instagram.com/api/v1/feed/user/{user_id}/reel_media/ and be sure to use a valid User-Agent header (e.g.: Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; 828x1792; 165586599))

Remember this only works for public profiles, if you need something private (i.e. visible from your profile) you need to add two coockies to the requests: ds_user_id and sessionid. You can get those values with browser extensions (e.g.: EditThisCookie). Also, never share these values with anyone because they represent your authentication to Instagram.

Lastly: yes, the stories you will get from the endpoint won't be shown as watched.

like image 29
Xfox Avatar answered Oct 17 '22 23:10

Xfox