We study the higher spin algebras of two-dimensional conformal field theory from the perspective of quantum integrability. Starting from Maulik-Okounkov instanton Rmatrix and applying the procedure of algebraic Bethe ansatz, we obtain infinite commuting families of Hamiltonians of quantum ILW hierarchy labeled by shape of the auxiliary torus. We calculate explicitly the first five of these Hamiltonians. Then, we numerically verify that their joint spectrum can be parametriezed by solutions of Litvinov's Bethe ansatz equations and we conjecture a general formula for the joint spectrum of all ILW Hamiltonians, based on results of Feigin, Jimbo, Miwa and Mukhin.There are two interesting degeneration limits, the infinitely thick and the infinitely thin auxiliary torus. In one of these limits, the ILW hierarchy degenerates to Yangian or Benjamin-Ono hiearchy and the Bethe equations can be easily solved. The other limit is singular but we can nevertheless extract local Hamiltonians corresponding to quantum KdV or KP hierarchy. Litvinov's Bethe equations in this local limit provide an alternative to Bethe ansatz equations of Bazhanov, Lukyanov and Zamolodchikov, but are more transparent, work at any rank and are manifestly symmetric under triality symmetry of W 1+∞ . Finally, we illustrate analytic properties of the solutions of Bethe equations in minimal models, in particular for Lee-Yang CFT. The analytic structure of Bethe roots is very rich as it reflects the whole representation theory of W N minimal models.