L
L
Leonid2017-10-02 19:22:28
PHP
Leonid, 2017-10-02 19:22:28

Is it possible to get photos from an open Instagram account without using an Access token?

Actually, there is a task to get photos from an open Instagram account without using an Access token - is it possible?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Leonid, 2017-10-02
@easycode

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'] . '">';
    }
}

It will be necessary to receive more than 20 photos with a large number of requests, each time inserting ?max_id=ХХХХ into the request - this is the id of the photo received in the last request.

O
oh, 2017-10-02
well @AnneSmith

you can steal pictures by parsing the page

F
Fixid, 2017-10-02
@Fixid

selenium

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question