1

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,

Amir Mog
  • 321
  • 1
  • 4
  • 17

1 Answers1

1

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!

Community
  • 1
  • 1
coderz
  • 1,366
  • 1
  • 12
  • 23
  • Thank you very much. To test, how can I add more users to test the functionality? And generally how should an being in sandbox mode be able to try any of these endpoints? – Amir Mog Dec 15 '15 at 00:06
  • @AmirMog, you can add more sandbox users by going to your sandbox tab of your manage client dashboard in [developer panel](http://instagram.com/developer) and add instagram users. For more details check their documentation. – coderz Dec 15 '15 at 05:29