Instagram API - User photos

后端 未结 5 1451
迷失自我
迷失自我 2021-01-12 17:59

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 t

相关标签:
5条回答
  • 2021-01-12 18:34

    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

    0 讨论(0)
  • 2021-01-12 18:39

    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/

    0 讨论(0)
  • 2021-01-12 18:42

    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.).

    0 讨论(0)
  • 2021-01-12 18:48

    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...

    0 讨论(0)
  • 2021-01-12 18:54

    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/

    0 讨论(0)
提交回复
热议问题