Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if an Instagram account is public or private

Tags:

I have looked this particular question: Find out whether a user has a public or private profile on instagram using API?, but I don't see a return bool value target_user_is_private as mentioned in the above question. I also don't see any other way to check; none of the endpoints on https://www.instagram.com/developer/endpoints/relationships/ seems to tell me if an account if private or not. Is there any way to check?

like image 476
patrickhuang94 Avatar asked Aug 01 '16 23:08

patrickhuang94


1 Answers

This endpoint returns target_user_is_private

  https://api.instagram.com/v1/users/{user-id}/relationship?access_token=ACCESS-TOKEN

If you are in sandbox mode then you will not get a response with relationship for any user other than your sandbox approved user.

If you are in sandbox mode, add a user to your sandbox, and then use the above API with that user's {user-id}, you will get a response with target_user_is_private

like image 140
krisrak Avatar answered Sep 28 '22 02:09

krisrak