I want to check if a user is private on Instagram. When searching on the internet I found this: Getting basic information from Instagram using PHP
$raw = file_get_contents('https://www.instagram.com/USERNAME');
preg_match('/\"followed_by\"\:\s?\{\"count\"\:\s?([0-9]+)/',$raw,$m);
print intval($m[1]);
Which uses a regex to check the number of followers for a user.
Now I'm trying to use a regex to check if a user is private or not but I'm unable to figure it out. The field is stated in the JSON response as is_private
but I have not been able to get it working.
Is this the right way to do it?