Well, this is not a great answer, but here is how I dealt with the same task. After I have the username from the API, I do the following regular expression in the source of my profile page:
$response = file_get_contents('https://instagram.com/'.$username); if (preg_match('/"user":\{"username":"'.$username.'",.*?"isVerified":true\},"__path":".*?'.$username.'.*?"/s', $response) || preg_match('/<meta content=".*?official.*?account.*?" name="description" \/>/is', $response)) { print "VERIFIED USER!"; }
As I said, these are super hacks, but the API does not currently provide isVerified. Until I use this regex. It searches for "isVerified": the true part of the JSON structure you are referencing. (example: https://instagram.com/taylorswift )
We also added an additional check, where if there is an “official account” in the meta tag, then we consider it to be official. (example: https://instagram.com/3doorsdown ) We added this check because Instagram started making verified accounts in 2014, and there are many celebrities who have not received an unverified badge. He should pick up some parts, but it may well bring false positives.
NOTE. This decision will be violated if Instagram ever changes the structure or JSON meta tags on its pages, so use them at your own risk. We needed a script to check a small number of usernames for checked icons, and I came up with it very quickly. The best solution would be with every update to their API.
source share