lagerfeuer / cryptocompare

Python3 Wrapper for the CryptoCompare API
MIT License
181 stars 73 forks source link

Error getting coin information #61

Closed anshumannandan closed 1 year ago

anshumannandan commented 1 year ago

The function cryptocompare.get_coin_list(format=False) is returning no response, the response is : Error getting coin information. Expecting value: line 1 column 1 (char 0) was working totally fine till yesterday but started getting error today. ss

lagerfeuer commented 1 year ago

Hi @anshumannandan, thanks for raising this issue. It seems that the CryptoCompare API started blocking requests of this nature recently. This is what I'm seeing:

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

Have you tried it with an API key? That might work.

anshumannandan commented 1 year ago

I'm already using an API key and all the functions except this one are working absolutely fine with the same key.

lagerfeuer commented 1 year ago

Hm, okay. I'm not actively maintaining this library anymore, but I'll try to take a look if I find time. I also found out, that get_exchanges didn't work. Thanks for reporting.

varunboiri commented 1 year ago

Hm, okay. I'm not actively maintaining this library anymore, but I'll try to take a look if I find time. I also found out, that get_exchanges didn't work. Thanks for reporting.

I am also facing the same problem. I have made a python project on live prices of cryptocurrencies and I have to present it the day after tomorrow. So I would be very grateful If you fix it by today. It's showing the same error for live prices also. I tried by both using Api and without API

lagerfeuer commented 1 year ago

It seems they are blocking some user agents for certain endpoints. As a workaround, you can get a list of the coins with the following:

curl -H 'User-Agent: HTTPie/3.2.1' https://www.cryptocompare.com/api/data/coinlist | jq '.Data | keys'
anshumannandan commented 1 year ago

Both the functions have started to work again.