I want to show the last photos of my instagram on my website, can I do that with their API? - instagram

I'm using a javascript code (instafeed.js) to connect to the Instagram API and get the last photos of my Instagram account. The problem is that the thing works for a few days and then the token I got from instagram "expires" or something and it stops working. It throws me Uncaught Error: Error from Instagram: The access_token provided is invalid.
I believe (I might be wrong) it's because I never sent my "app" for review and they are giving me a "sandbox mode" token. Or should I be able to use their API for this simple thing without approval?
Should I send my website for review or is this not an intended use of their API? And if it's not, what should I do?

You should be able to use API in sandbox mode to access your latest 20 posts. You dont need to get reviewed.
Not sure about access_token expiring, in live mode it never expires, so I expect sandbox to be same

Related

Instagram API logout link not working anymore

Does anybody know why this link is not working?
https://instagram.com/accounts/logout
One week ago it was working, but now it doesn't log me out anymore :/
Probably problems with the Instagram API, is it completely necessary to use the logout URL?, because it seems that you could only delete the token. If the user doesn't want your app to access their data they will cancel your app access. See: How to log out of the instagram API?

Instagram API says user does not exist

The user jwinery clearly exists: https://www.instagram.com/jwinery/
Querying the search API (/v1/users/search?q=jwinery&access_token=) gives you this user id: 321285908
Querying the users API (/v1/users/321285908/?access_token=) gives you this response:
{"meta": {"error_type": "APINotFoundError", "code": 400, "error_message": "this user does not exist"}}
My user is not in sandbox mode and has been approved, the access token is valid, and this has worked with thousands of users already. I know Instagram doesn't have the best error reporting so could this be another issue with jwinery or is Instagram just borking this? jwinery is obviously not private, but I don't use Instagram so I don't know all the other things that could be going on.
very interesting
https://www.instagram.com/jwinery/ said does not exist.
Search API is showing the id as valid, but user API for id does not return user info. this user does not exist
I checked the user #jwinery on instagram app, it opened, but asked me to confirm I'm over 21, and then it showed images on Instagram app.
Then I checked on https://www.instagram.com/jwinery/, it worked.
I used User API, it responded with data.
So I guess, API does not give you correct response until you have opened that user in App and then confirm over 21.
Also the access_token you use for API call should of the same user that was used to confirm over 21 on instagram app, then it will start working on API
So I guess this is a new category of profile type, that is not supported correctly in API yet.

Instagram API not returning data

I am quite new to the Instagram API. I have been able to authorize myself and get an access token. I used the following URL to search for users, but to no avail:
https://api.instagram.com/v1/users/search?q=jack&access_token=3316552483.1677ed0.ab992a6bf15c4bbe99f093e59043547b&count=10
Keep in mind this specific URL will not work because that is not my real access token. However, when I do use my reall access token, I get this response:
{
"meta": {
"code": 200
},
"data": []
}
I have scanned the API documentation and I cannot find where my problem is. Keep in mind, I am a sandbox user, and that may have something to do with it.
Looks like you are in Sandbox mode, it will only show your and your sandbox user's posts in API response, here is documentation for sandbox:
The behavior of the API when you are in sandbox mode is the same as
when your app is live, but comes with the following restrictions:
Data is restricted to sandbox users and the 20 most recent media from each sandbox user
Reduced API rate limits
The first point is important and it means that the API behaves as if
the only users on Instagram were your sandbox users, and the only
media ever posted were the last 20 for each of these users.
In the API call, search your username then it will be shown in API response

Retrieve tagged photos from Instagrams API without forcing user to login?

I want to retrieve a list of recent photos with a given tag to display on a website in a very simple gallery.
For that, the doc says I need an access token. However, it seems that the only way to authenticate against Instagram is through OAuth; which involves sending the user to instagram and allowing my application access to their basic data. However, I don't want my users to do anything; I'd like my application to authenticate against Instagram for me and then retrieve the data I want.
Sounds simple, but all online documentation seems to end up in "Redirect your user to...". And I find no sensible ways to do this programatically; it's all about sending users away, letting them authenticate, and then receiving the access token afterwards. I could of course scrape the HTML, parse the forms (for example, the unique-per-session csrfmiddlewaretoken field which needs to be posted along with login requests etc) and let my server side application pretend to be my own user and login/authorize the app, but that doesn't seem like the way to go.
I could also just authenticate manually in the browser, pick up the auth token and paste into my application; but as the doc says: "do not assume your access_token is valid forever." - so I'd like this to be fully automated.
If I try to create a WebClient and POST to https://www.instagram.com/oauth/authorize/?client_id={clientId}&redirect_uri={redirectUri}&response_type=code&scope=basic it just returns a 403 Forbidden which is of no use. (For what it's worth, I'm using C# and have found instasharp, but this problem is not tied to any given platform...)
Am I completely overlooking something, or am I right that server side authentication against Instagram has become really complicated? Most other social media platform API's I've touched lets me get some form of authentication token just by posting a combination of the application id and secret.

Is there any way to get user news through the official Instagram API?

I want to build Instagram client for Ubuntu. I already figured out how to get data like user feed through access token through Instagram API. But I can't figure out how to get user news (e.g. someone liked your photo, mentioned you in comment etc.), I guess user need to be logged on to watch his news (via http://instagram.com/api/v1/news/inbox/).
So, the question: is there any way to get user feed through API, or through access token? I don't want to request user password in my application, all I got is access token.
This endpoint (v1/news/inbox/) is not supported by official Instagram API. By the way; you can't access the data.

Resources