Skip to main content

Why do I see 'http error. HTML returned when expecting JSON'?

This error means your exchange returned an HTML page instead of a JSON response. No action needed — your bot will automatically keep trying and continue trading.

Written by Pete Darby
Updated over a week ago

The error 'http error. HTML returned when expecting JSON' appears when your exchange returns an HTML page — for example a 504 Cloudflare error page — instead of a JSON response. Cryptohopper expects JSON from the exchange API. When it receives HTML instead, it logs this message rather than storing the full HTML response.

Cause

This is a temporary issue on the exchange side. It happens most commonly with Kraken and Poloniex, typically when the exchange is temporarily unavailable or overloaded.

What to do

You don't need to do anything. Your trading bot will automatically keep trying to reach the exchange API and continue its work.

Understanding the adjacent error message

To understand what your bot was trying to do when the error occurred, check the message directly above or below it in the Output section at the bottom of your Dashboard. For example, a message like 'Could not get balances' means the HTML error page was returned while your bot was trying to retrieve your account balance.

Did this answer your question?