diff --git a/index.html b/index.html
index 18b88ca..273532c 100644
--- a/index.html
+++ b/index.html
@@ -23,7 +23,7 @@
About the Repository
Crypto Price Predictor
-
+
diff --git a/script.js b/script.js
index 641df68..6965cfc 100644
--- a/script.js
+++ b/script.js
@@ -1,11 +1,106 @@
document.getElementById("predict-btn").addEventListener("click", function() {
- let crypto = document.getElementById("crypto").value.toUpperCase();
+ let cryptoInput = document.getElementById("crypto").value.toUpperCase();
+
+ // A map of symbols to their corresponding API names
+ const cryptoMap = {
+ // Major cryptocurrencies
+ 'BTC': 'bitcoin',
+ 'ETH': 'ethereum',
+ 'USDT': 'tether',
+ 'BNB': 'binancecoin',
+ 'USDC': 'usd-coin',
+ 'XRP': 'ripple',
+ 'DOGE': 'dogecoin',
+ 'ADA': 'cardano',
+ 'SOL': 'solana',
+ 'DOT': 'polkadot',
+ 'MATIC': 'matic-network',
+ 'SHIB': 'shiba-inu',
+ 'LTC': 'litecoin',
+ 'TRX': 'tron',
+ 'AVAX': 'avalanche-2',
+ 'ATOM': 'cosmos',
+ 'LINK': 'chainlink',
+ 'XMR': 'monero',
+ 'BCH': 'bitcoin-cash',
+ 'ALGO': 'algorand',
+ 'ICP': 'internet-computer',
+ 'VET': 'vechain',
+ 'FIL': 'filecoin',
+ 'NEAR': 'near',
+ 'HBAR': 'hedera-hashgraph',
+
+ // Stablecoins
+ 'DAI': 'dai',
+ 'BUSD': 'binance-usd',
+ 'PAX': 'paxos-standard',
+
+ // DeFi tokens
+ 'UNI': 'uniswap',
+ 'AAVE': 'aave',
+ 'SUSHI': 'sushi',
+ 'COMP': 'compound-governance-token',
+ 'YFI': 'yearn-finance',
+
+ // Layer 2 solutions and scaling
+ 'LRC': 'loopring',
+ 'ZRX': '0x',
+ 'OMG': 'omisego',
+
+ // NFT and metaverse tokens
+ 'MANA': 'decentraland',
+ 'SAND': 'the-sandbox',
+ 'ENJ': 'enjincoin',
+ 'AXS': 'axie-infinity',
+ 'GALA': 'gala',
+
+ // Privacy coins
+ 'ZEC': 'zcash',
+ 'DASH': 'dash',
+
+ // Other popular tokens
+ 'FTM': 'fantom',
+ 'GRT': 'the-graph',
+ '1INCH': '1inch',
+ 'CHZ': 'chiliz',
+ 'BAT': 'basic-attention-token',
+ 'CRV': 'curve-dao-token',
+ 'KSM': 'kusama',
+ 'QTUM': 'qtum',
+ 'ZIL': 'zilliqa',
+ 'EGLD': 'elrond-erd-2',
+ 'HOT': 'holotoken',
+ 'THETA': 'theta-token',
+ 'HNT': 'helium',
+ 'SNX': 'synthetix-network-token',
+ 'RUNE': 'thorchain',
+ 'XLM': 'stellar',
+ 'REN': 'ren',
+ 'FTT': 'ftx-token',
+ 'RVN': 'ravencoin',
+ 'KAVA': 'kava',
+ 'CRO': 'crypto-com-chain',
+ 'MIOTA': 'iota',
+ 'ETC': 'ethereum-classic',
+
+ // Meme coins
+ 'BABYDOGE': 'baby-doge-coin',
+ 'SAFEMOON': 'safemoon',
+ 'ELON': 'dogelon-mars',
+
+ // Add more symbols and tokens as needed
+ };
+
+
+ // Convert the input to either the API-friendly name or keep it as it is
+ let crypto = cryptoMap[cryptoInput] || cryptoInput.toLowerCase();
+
if (crypto) {
fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${crypto}&vs_currencies=usd`)
.then(response => response.json())
.then(data => {
- if (data[crypto.toLowerCase()]) {
- document.getElementById("price").innerText = "$" + data[crypto.toLowerCase()].usd;
+ if (data[crypto]) {
+ document.getElementById("price").innerText = "$" + data[crypto].usd;
} else {
document.getElementById("price").innerText = "Cryptocurrency not found!";
}