Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It turned out that https://www.instagram.com/user/media/ - gives out a feed of user's photos in JSON format)
$user = 'username';
$url = "https://www.instagram.com/$user/media/";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$json = curl_exec($ch);
curl_close($ch);
$result = json_decode($json, true);
if (count($result['items'])) {
foreach ($result['items'] as $_item) {
echo '<img src="' . $_item['images']['thumbnail']['url'] . '">';
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question