Instagram API - User photos

后端 未结 5 1486
迷失自我
迷失自我 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 "
    ";
    print_r($standard);
    
    
    echo "
    ";
    print_r($standard);
    

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

提交回复
热议问题