0

sorry for bad english, let's just say i want to embed specific price of coin for example ethereum and bitcoin $20 price in my website, in other words it shows $20 rate of btc and eth on my website not whole coin price.

1 Answer 1

2

You can use any exchange api or cryptocurrency market data api such as:

https://coinmarketcap.com/api/

Example:

https://api.coinmarketcap.com/v2/ticker/1/?convert=USD returns the following:

{
    "data": {
        "id": 1, 
        "name": "Bitcoin", 
        "symbol": "BTC", 
        "website_slug": "bitcoin", 
        "rank": 1, 
        "circulating_supply": 17193862.0, 
        "total_supply": 17193862.0, 
        "max_supply": 21000000.0, 
        "quotes": {
            "USD": {
                "price": 6963.44528122, 
                "volume_24h": 3783503583.4896, 
                "market_cap": 119728517210.0, 
                "percent_change_1h": -0.51, 
                "percent_change_24h": -1.1, 
                "percent_change_7d": -14.16
            }
        }, 
        "last_updated": 1533575182
    }, 
    "metadata": {
        "timestamp": 1533574768, 
        "error": null
    }
}

You can then access the price using javascript and calculate how much $20 is worth.

Not the answer you're looking for? Browse other questions tagged or ask your own question.