Dimitris Dimitriadis
Dimitris Dimitriadis

Reputation: 294

Ge User Profile Information using Instagram Basic Display API

I have found a way to get the Instagram feed of a profile using Instagram Basic Display API. However, I can not retrieve the user profile data such as the number of followers, the Instagram profile picture, etc. Is there any way to get this data using the Instagram Basic Display API?

This post is similar with this but I want to get all the information of my account's profile without using a scraper.

Upvotes: 0

Views: 272

Answers (1)

TharakaNirmana
TharakaNirmana

Reputation: 10353

You can not get the followers count with Instagram Basic Display API. You can get the user profile like this:

$url = 'https://graph.instagram.com/'.$user_id.'/?';
                 $data = array('access_token'  => $long_lived_access_token, 'fields'=> 'username');
                 $string = http_build_query($data);
                 $ch = curl_init($url.$string);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                 $result = curl_exec($ch);
                 curl_close($ch);

Upvotes: 0

Related Questions