We study the higher spin algebras of two-dimensional conformal field theory from the perspective of quantum integrability. Starting from Maulik-Okounkov instanton R-matrix and applying the procedure of algebraic Bethe ansatz, we obtain infinite commuting families of Hamiltonians of quantum ILW hierarchy parametrized by the 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\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$ \\mathcal{W} $$\\end{document}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 captures the representation theory of W\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$ \\mathcal{W} $$\\end{document}N minimal models.