Instagram Followers - instagram

I need to display the followers list of instagram account in my website.
I have created app and generate access token successfully.
But if i run the instagram api to get the followers list, it shows me the empty result.
https://api.instagram.com/v1/users/self/followed-by?access_token={access_token}
Can anyone help me to get the followers list.

In sandbox mode you will only see users approved to sandbox in API response.
Add one of your followers to sandbox users and let them accept it, then you will just see that user in the API response.
Once you get your app approved by Instagram and go live, you will see all (but I dont think Instagram is approving any app with permission other than basic anymore)

Related

Instagram api returns HTTP status 200 but response contains empty data array

My curl request to get users id is not returning any data.
https://api.instagram.com/v1/users/search?q=xxxxx&access_token=xxxxxxxxxxxxx
Here is the result i am getting:
{"data": [], "meta": {"code": 200}}
Any thought where there might be any issue?
Thanks,
Mojgan
I think you are in Sandbox mode. In Sandbox mode you will only see your data and the users you approved to sandbox.
If you search your username in the API call q=, you will see just your user details in the data=[] response.
Once you go live and have been approved for public_content, you will see all the user results.
Read more about Sandbox mode here:
https://www.instagram.com/developer/sandbox/
Data is restricted to sandbox users and the 20 most recent media from
each sandbox user
Apps in sandbox are restricted to 10 users
Data is restricted to the 10 users and the 20 most recent media from
each of those users
Instagram changed their API settings and ruined so many app across the web this morning. They are switching to FB https://developers.facebook.com/products/instagram/
To use the new Instagram API features, users will need to have a business profile and will be required to use a Facebook Login when granting access to third party tools.

Instagram API get followers list

I am using Instagram public API using the following endpoint but am only getting details of one follower in the response. Why is the API returning only one follower (that is part of sandbox users, none else)?
https://api.instagram.com/v1/users/self/followed-by?access_token=ACCESS_TOKEN where ACCESS_TOKEN is one I got from Instagram.
If your application is in sandbox mode, you can't access data of users other than listed in sandbox users.
As mentioned in API Behavior section of this documentation
Data is restricted to sandbox users and the 20 most recent media from each sandbox user.

Can't access my own followers on instagram API

So i'm trying to access my own followers through the API. I set the scope to include followers_list. However when I call https://api.instagram.com/v1/users/self/follows?access_token=sometokenhere
I receive code 200 and no data. My application is in sandbox mode. Any reason why I can't access my own followers/following?
Thanks.
In Sandbox mode you will only get response for posts and users that are in your sandbox user list.
So add one of the users u follow to sandbox, then only that user will be in API response, once your app is reviewed, approved and live, all the users will show up in API response.
https://www.instagram.com/developer/sandbox/

How to use instagram API?

I have user id's of very few instagram public accounts . All I need to do is to get the follower count information of those accounts . In the developer page they are talking about building an app and authorizing it with the users and getting some tokens and then getting the permitted information from that account . How can I get the follower count of those accounts ? Is it possible to get it without authorization from that account? What if I want to get more information like the media and likes etc?( I couldn't find many pointers in this direction)
In my practice I have not seen any api, that will provide you user personal info without token, instagram too. So you must to create login via instagram, where you will ask about some permissions from user, then if user will provide them you will be able to make requests with token and simply get media information, likes and followers. The only question is to ask user about this all permissions. It's no so hard, you need to do something like this
1.Get user token https://www.instagram.com/oauth/authorize/?client_id=377e67cfbfe840e19a903aa5ea8dbe10&redirect_uri=http://127.0.0.1/&response_type=token&scope=likes+comments+relationships+public_content+follower_list
2. then do requests, for example '/users/self/media/liked', to request this you need to provide access_token which you received in first step and signature.
Like a little example, you can try to look at this code https://github.com/zhorzhz/instagram_api.git. There you will find steps which I said and also some more request examples.
Hope it will help you

Instagram does not show all comments of a media

I am using Instagram API to get a user media comments in my site.
I used this endpoint to get comments of specific media:
https://api.instagram.com/v1/media/{media_id}/comments?access_token={media_owner_access_token}
Variables:
{media_id} is media Instagram Id that Instagram gave to me, it's like:
1250190150128742954_182781845
{media_owner_access_token} is access token of media owner that when user registered in my site Instagram gave it to me it's like:
9857164750.81d09db.20b41a2a356d6442bav22d340a55e1f5g
When I try to get media comments for specific media of a user it will give me just media owner comments but this media contains other people comments on it too!
Is this how Instagram API works? Or I made a mistake here?
And for record I am in sandbox mode not live can it be cause of my problem!?
I am in sandbox mode not live can it be cause of my problem!?
Yes. In sandbox mode, the API will only return data from users who have been invited to your sandbox.
From the Instagram API docs:
To help you develop and test your app, the users and media available in Sandbox mode are real Instagram data (i.e. what is normally visible in the Instagram app), but with the following conditions:
Apps in sandbox are restricted to 10 users
Data is restricted to the 10 users and the 20 most recent media from each of those users
Reduced API rate limits
You'll need to get your app approved for live use, and request the proper scopes when generating your token.
See https://www.instagram.com/developer/sandbox/ for more information.

Resources