arduino-coinmarketcap-api icon indicating copy to clipboard operation
arduino-coinmarketcap-api copied to clipboard

Error with json

Open JuttDB opened this issue 7 years ago • 7 comments

........ WiFi connected IP address: 192.168.1.9

Getting ticker data for bitcoin Error getting data: Failed to parse JSON


Getting ticker data for ethereum Error getting data: Failed to parse JSON


Getting ticker data for dogecoin Error getting data: Failed to parse JSON

i already installed Arduinojson by Benoit Blanchon Ver 5.13.0

JuttDB avatar Jan 21 '18 09:01 JuttDB

I started getting the same this for coinmarketcap and cryptonator today as well. strange

Error getting data: Failed to parse JSON

gillisllc avatar Jan 26 '18 04:01 gillisllc

Might have to use a proxy to handle the https translation Similar to this example for cryptonator

Check this out: http://httptohttps.mrtimcakes.com/

http://httptohttps.mrtimcakes.com/https://cryptonator.com/api/ticker/btc-usd

Should be able to update the #include <CoinMarketCapApi.h>

gillisllc avatar Jan 26 '18 05:01 gillisllc

seems to work now when you update coinmarketcap fro your arduino IDE

gillisllc avatar Jan 26 '18 05:01 gillisllc

The original version of this library used HTTP as coinmarket cap supported it and its much lighter on memory.

They shut off the HTTP endpoint and now only support HTTPS, so the library had to be upgraded for that.

Not sure if that is the original posters problem, but it explains your issue @gillisllc

witnessmenow avatar Feb 02 '18 01:02 witnessmenow

This is a bug... The reason for this issue is that the client->stop(); is missing at the end of the SendGetToCoinMarketCap method. After adding this it works fine without the json error :

....
			if (avail) {
				// Serial.println("Body:");
				// Serial.println(body);
				// Serial.println("END");
				break;
			}
		}
		client->stop();
	}

  return body;
}

Jingjok86 avatar Mar 04 '18 17:03 Jingjok86

Problem with ArduinoJson-API ?

12:13:36.946 -> Getting ticker data for bitcoin Error getting data: Failed to parse JSON 12:13:40.487 -> ---------------------------

davidwowa avatar Jan 21 '19 11:01 davidwowa

This library is obsolete.
The problem is not ArduinoJson. The problem is coinmarketcap killed version 1. The library must be changed to supply an API key (version 2).

Michail1 avatar Jul 25 '20 06:07 Michail1