8

does anyone know can I get photos from instagram user without using access token. It doesn't make sense that I see photos on http://instagram.com/{user} but can not get them using instagram api.

Thanks

Ibrahim19
  • 123
  • 1
  • 1
  • 5

5 Answers5

2

to get the photos You don't need to use the access_token. just call:

https://api.instagram.com/v1/users/{user-id}/media/recent?callback=&client_id={client_id}

you can create your client_id here:

https://instagram.com/developer/clients/manage/

emen
  • 6,050
  • 11
  • 57
  • 94
1

No I don't believe this is possible using their api.

From instagram's documentation: (http://instagram.com/developer/authentication/)

Authenticated requests require an access_token. ... We only require authentication in cases where your application is making requests on behalf of a user (commenting, liking, browsing a user’s feed, etc.).

You might be able to work out some kind of hack. Here's a php implementation using followgram.me http://www.barattalo.it/2011/08/18/how-to-use-instagr-am-photos/

Ryan Epp
  • 931
  • 1
  • 10
  • 21
  • Thanks Ryan. I am not sure but I think followgram.me uses access token to get user instagram photos. After it expire I guess followgram will not be able to get my latest photos. – Ibrahim19 Apr 20 '13 at 20:11
  • "browsing a user’s feed" is not the same as the photos the user posts themselves. For most situations, you only need the `client_id` – dayuloli Jan 19 '15 at 04:57
  • This is not the correct answer as has been stated. Javier and dayuloli has the correct answer below – AndyRyan Mar 23 '15 at 14:52
1

You don't need to use the access_token at all. Just register your application with Instagram, get the client_id and use that to query.

To quote the documentation:

Note that in many situations, you may not need to authenticate users at all. For instance, you may request popular photos without authenticating (i.e. you do not need to provide an access_token; just use your client ID with your request). We only require authentication in cases where your application is making requests on behalf of a user (commenting, liking, browsing a user’s feed, etc.).

dayuloli
  • 16,205
  • 16
  • 71
  • 126
0

Hello Here I have Example to get image of user Please Follow Code

/* Get image in your instagram Account */

$set_scope_your_app ="https://www.instagram.com/oauth/authorize/?

client_id=Added-your-client_id&

redirect_uri=Added-your-redirect_uri&response_typ

e=code&scope=public_content";


$get_acess_token = "https://instagram.com/oauth/authorize/?

client_id=Added-your-client_id&

redirect_uri=Added-your-redirect_uri&respons

e_type=token";

$url="https://api.instagram.com/v1/users/self/media/recent/?access_token=Added-your-access_token";
 $json = file_get_contents($url);
$data = json_decode($json);


$images = array();
foreach( $data->data as $user_data ) {
    $images[] = (array) $user_data->images;
}

$standard = array_map( function( $item ) {
    return $item['standard_resolution']->url;
}, $images );

echo "<pre>";
print_r($standard);


echo "<pre>";
print_r($standard);

I have get Refferece from Get User Media or Image in Your Instagram Example

Jydipsinh Parmar
  • 484
  • 5
  • 14
0

There are 2 ways to get data

1) client side - you need to give client_id

2) server side - you need to give access_token

https://api.instagram.com/v1/users/#{instagram_id}/media/recent/?access_token=#{@token}"

this will give you the recent uploaded photo of that user whose instagram_id is given...

Apoorv
  • 1,338
  • 1
  • 17
  • 18