php - Instagram API $data returning NULL


I am trying to display my instagram followers counts in a custom PHP file.

I am trying this code:

$url = '$token';
$content      =   file_get_contents($url);
$data         =   json_decode($content, true);

It only returnsNULL.

What should I do?




I am not sure if$token is just a placeholder to hide sensitive information, but if not, you have to pass your personal access token via the URL instead of$token:

$url = '$token';

You will have to retrieve this token first via the oAuth authentication flow as described in the Instagram API docs.




do you have authorize your access token scope?? if no, you must activate the authorize here :

People are also looking for solutions to the problem: javascript - PHP Ajax code unable to update database


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.