Cheapsats API documentation
Cheapsats provides several simple APIs to fetch bitcoin price related data. The data is returned in JSON format. Here, we will explain how to use the following APIs:
- Per-sat median
- Sat median
- Btc median
https://api.cheapsats.com/per-sat/median
This API returns the median price per satoshi in various currencies from all exchanges. To use this API, simply send a GET request to the URL.
fetch('https://api.cheapsats.com/btc/median')
.then(response => response.json())
.then(data => console.log(data));
https://api.cheapsats.com/sat/median
This API returns the median price of a currency unit in satoshis in various currencies from all exchanges. To use this API, simply send a GET request to the URL.
fetch('https://api.cheapsats.com/sat/median')
.then(response =>response.json())
.then(data => console.log(data));
https://api.cheapsats.com/btc/median
This API returns the median price of a Bitcoin in various currencies from all exchanges. To use this API, simply send a GET request to the URL.
fetch('https://api.cheapsats.com/btc/median')
.then(response => response.json())
.then(data => console.log(data));