According to Stephen-Boltzmann law Wikipedia article,
the total energy radiated per unit surface area of a black body across all wavelengths per unit time
is:
$$j=\sigma T^4$$
So the total energy radiated accounting for the whole surface area is $E_{total}=\sigma T^4 A$.
I also know that the quantity:
$$\frac{2h\nu^3}{c^2}\frac{1}{e^{\frac{h\nu}{kT}}-1}$$
quoting from Wikipedia, is:
is the amount of power per unit surface area per unit solid angle per unit frequency emitted at a frequency $\nu$, by a black body at temperature $T$.
I integrate this function between $\nu=0$ and $\nu=\infty$. I get $\frac{1}{\pi}\sigma T^4$. So the total energy emitted by a black budy in all directions must be $\sigma T^4$ times its surface area $A$, times solid angle $4\pi$ (since we want radiation emitted in all directions), ie
$$E_{total} = 4 \sigma T^4A$$
As we can see, the results don't agree. Which formula then gives the total energy radiated from the whole of the black body in all directions in unit time? Why is the reasoning which gave the wrong result wrong?