Created
November 29, 2023 16:16
-
-
Save danstarns/ba6458087a1710c7066e171129a8bd97 to your computer and use it in GitHub Desktop.
USDT/GBP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this in node 18 and up | |
(async () => { | |
const API_KEY = `KEY`; | |
const url = `https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=USDT&CMC_PRO_API_KEY=${API_KEY}&convert=GBP`; | |
const response = await fetch(url, { | |
method: "GET", | |
headers: { | |
Accept: "application/json", | |
}, | |
}); | |
const json = await response.json(); | |
console.log(json.data.USDT.quote.GBP.price); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment