The growing demand for cheap, safe, recyclable, and environmentally friendly batteries highlights the importance of the development of organic electrode materials. Here, we present a novel redox-active polymer comprising a polyaniline-type conjugated backbone and quinizarin and anthraquinone units. The synthesized polymer was explored as a cathode material for batteries, and it delivered promising performance characteristics in both lithium and potassium cells. Excellent lithiation efficiency enabled high discharge capacity values of >400 mA g−1 in combination with good stability upon charge–discharge cycling. Similarly, the potassium cells with the polymer-based cathodes demonstrated a high discharge capacity of >200 mAh g−1 at 50 mA g−1 and impressive stability: no capacity deterioration was observed for over 3000 cycles at 11 A g−1, which was among the best results reported for K ion battery cathodes to date. The synthetic availability and low projected cost of the designed material paves a way to its practical implementation in scalable and inexpensive organic batteries, which are emerging as a sustainable energy storage technology.