JSON Decode Error upon querying token price

Hello,

I’m querying the token price every few seconds for my project via the Python requests library. I’ve noticed that the server tends to return a JSON Decode Error after a few mins to hours of running.

Are you aware of this server-side response error? Is there anything I could do to fix this? I tried catching the error but it still breaks the code when it happens as it highly depends on the correct and timely returns of price.

you could get errors from time to time from web3api, you should retry same query again in case of an error, can you also paste the error massage that you get?

Yes, I’m retrying the queries after a short delay but I’ve found that it chains the fails. I’ll paste the error here if it appears again. I’m catching it with the ValueError handler but sometimes it passes the handler too.

Do you know why this happens on the server-side? Could the API request have a native retry in itself (I’ve seen some API providers do this)?