homerboy homerboy - 4 months ago 35
JSON Question

Check if an Instagram account is public or private

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?

Answer

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