login($credentials->getLogin(), $credentials->getPassword()); // 184263228 is pgrimaud's account id $userId = 184263228; $follow = $api->follow($userId); echo $follow . PHP_EOL; } catch (InstagramException $e) { print_r($e->getMessage()); } catch (CacheException $e) { print_r($e->getMessage()); }