0

I use the api below for bitcoin price :
https://api.coindesk.com/v1/bpi/currentprice.json
But coindesk hasn't ETHEREUM price in it's api.
What api should i use to get ETHEREUM price?


Also the api below does not work any more :
https://api.coinmarketcap.com/v1/ticker/ethereum/
eth
  • 85,679
  • 53
  • 285
  • 406
SilverLight
  • 103
  • 1
  • 5

1 Answers1

3

Try https://min-api.cryptocompare.com.

Here is an example of how you can fetch information programmatically:

const request = require("request");

request.get("https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,CNY,JPY,GBP", function(error, response, body) {
    if (error)
        throw error;
    else if (!response)
        throw new Error("no response");
    else if (response.statusCode != 200)
        throw new Error("bad response");
    else
        console.log(JSON.stringify(JSON.parse(body), null, 4));
});
goodvibration
  • 26,003
  • 5
  • 46
  • 86
  • Really thanks dear, Is it free or will close after a while? – SilverLight Apr 23 '20 at 19:46
  • @SilverLight: I'm not the owner of this web-service, you know. Please feel free to accept the answer (by clicking on the V next to it), if you feel that it has answered your question. – goodvibration Apr 23 '20 at 19:55
  • Thanks, But it seems it is not free & has limitations. I want to use it in my web site. daily 200 300 users will call this api. – SilverLight Apr 23 '20 at 20:25
  • @SilverLight: No problem. Was free last time I used it. – goodvibration Apr 23 '20 at 20:33
  • They say use an api key, It seems it has 100,000 calls for one month limit. – SilverLight Apr 23 '20 at 21:13
  • There should be an unlimited api out there - just for eth price. – SilverLight Apr 23 '20 at 21:25
  • 1
    What do you think about this one : https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd – SilverLight Apr 23 '20 at 21:55
  • It seems that request npm package is deprecated now Here is the updated code :
    
    requests("https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,CNY,JPY,GBP")
    .on('data', data => {
        console.log(JSON.stringify(JSON.parse(data), null, 4));
    });
    
    – Thykof Mar 06 '21 at 08:20