A simple JavaScript script for fetching the current price of a cryptocurrency using the CoinGecko API.
This script demonstrates how to retrieve the current price of a cryptocurrency by providing its symbol. It utilizes the CoinGecko API, a reliable source for real-time cryptocurrency data.
- Fetches the current price of a cryptocurrency.
- Supports various cryptocurrency symbols (e.g., Bitcoin, Ethereum).
- Utilizes the CoinGecko API for accurate and up-to-date data.
- Asynchronous HTTP requests using the
axios
library.
-
Ensure that you have the
axios
library installed:npm install axios
-
Run the script:
node crypto_price_fetcher.js
-
Enter the cryptocurrency symbol when prompted.