What is the easiest way to display Instagram track count

I use WordPress and try to figure out the easiest way to display the number of Instagram followers the user has.

During the search, I found several Instagram PHP scripts that seem a bit crowded for what I'm trying to display.

From reading Stackoverflow messages, I came across a message that says this code:

$userinfo = wp_remote_get("https://api.instagram.com/v1/users/3955450?access_token=f0d225aa955c4bd9ae563f87f831efab"); $userinfo = json_decode($userinfo); $followers = $userinfo['data']['counts']['followed_by']; echo "Folled by: " . $followers . " people"; 

This is a simple and perfect script HOWEVER, it does not return any data.

I installed the client on the Instagram developer site, but I can not get the above script to display any data.

Any help would be greatly appreciated.

+4
source share
2 answers

Try the following:

 $result = file_get_contents("https://api.instagram.com/v1/users/3955450?access_token=f0d225aa955c4bd9ae563f87f831efab"); $obj = json_decode($result); echo $obj->data[0]->id; 
+3
source

Have you tried the url in the API console? The user may be protected or you may not get the result correctly.

0
source

All Articles