Amir Mog
Amir Mog

Reputation: 321

User obj problems with Instagram API

I created an instagram developer account and got client_secret and client_id, I successfully authenticated my own user (myusername) and received an access_token.

When I try to use this endpoint https://api.instagram.com/v1/users/search?q=[USERNAME]&access_token=[ACCESS TOKEN]

For the user that I authenticated with 'myusername' it returns a user obj as follow but for any other usernames other than this I only get:

{"meta":{"code":200},"data":[]}

My question is if I have a list of instagram IDs.

Is there a way to get public data of these users? What I need to get for each of these users, is an object similar to this:

{"username":"someusername","bio":"","website":"","profile_picture":"https://scontent.cdninstagram.com/hphotos-xpt1/t51.2885-19/119054229_960211434022564_1442328159_a.jpg","full_name":"Robert Some Last Name","counts":{"media":12,"followed_by":13,"follows":350},"id":"23237xxxxx"}

Any help would be much appreciated.

Best,

Upvotes: 1

Views: 262

Answers (1)

coderz
coderz

Reputation: 1366

I guess your app is in Sandbox mode.

I hope you know Instagram has recently changed their api structure and endpoints and introduced a concept called Sandbox mode. So if your app was created after Nov 17 of 2015, it is automatically placed in Sandbox mode.

So for Sandbox mode, you can only fetch data from verified Sandbox users of your app. Sandbox mode is basically like a filter, only your app's verified sandbox users are allowed to pass through.

For details, check my question-cum-answer here : Sandbox explained in brief.

Now since the users you are trying to fetch aren't verified sandbox users for your app, you will receive empty data(as if those users didn't existed for your app)

Hope it helps you!

Upvotes: 1

Related Questions