Websocket connection closed with code 1008 Payload too long

Sometimes my websocket client connection is closed with code=1008, message=Payload too long.
What does that mean? I’m using only @depth20 subscriptions.

The message sent to the server included a body which was too large.

What language and library do you use?

I have the same error. I’m using python’s standard asyncio and websockets library.

I can’t find anything mentioning payload size at Binance API Documentation

Because you can subscribe 1024 steams, I’m trying to do so with single message. That is why this error a bit strange (not mentioned in docs).

We use a split method to reduce the generated payloads to less than 350 subscriptions. We have had no problems with this for 2-3 years.

1 Like