A modern web application demonstrating the usage of Alchemy's Price API endpoints for cryptocurrency price tracking and historical data analysis.
- Price by Symbol: Get current prices for multiple cryptocurrencies using their symbols
- Price by Address: Fetch token prices using their contract addresses across different networks
- Supports Ethereum, Polygon, and Arbitrum networks
- Includes USDC contract address example (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)
- Historical Prices: View historical price data with customizable time ranges and intervals
-
Frontend:
- HTML5
- CSS3 (with modern features like CSS Variables, Flexbox, and Grid)
- JavaScript (ES6+)
- Custom UI components with neon/cyberpunk theme
-
Backend:
- Node.js
- Express.js
- Vercel Serverless Functions
- node-fetch for API requests
-
APIs:
- Alchemy Price API
- Token Prices By Symbol
- Token Prices By Address
- Historical Token Prices
- Alchemy Price API
- Node.js (v14 or higher)
- npm (Node Package Manager)
- Alchemy API Key
- Clone the repository:
git clone https://github.com/gabriel-dg/alchemy-prices-api
cd alchemy-prices-api
- Install dependencies:
npm install
- Create a
.env
file in the root directory and add your Alchemy API key:
ALCHEMY_API_KEY=your_alchemy_api_key_here
- Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
alchemy-prices-api/
├── api/
│ └── index.js # Serverless API endpoints
├── public/
│ ├── index.html # Main HTML file
│ ├── styles.css # Styles with neon theme
│ └── app.js # Frontend JavaScript
├── vercel.json # Vercel configuration
├── package.json
├── .env
└── README.md
- Get current prices for multiple tokens using their symbols
- Support for comma-separated symbols (e.g., "BTC,ETH,USDT")
- Displays price and last update time
- Fetch token prices using contract addresses
- Support for multiple networks (Ethereum, Polygon, Arbitrum)
- Includes example USDC contract address
- Dynamic address list management with add/remove functionality
- View historical price data for any token
- Customizable date range selection
- Multiple interval options (1h, 1d, 1w)
- Paginated results with 10 entries per page
This project is deployed on Vercel. To deploy your own instance:
- Fork this repository
- Create a Vercel account
- Import your forked repository
- Add your
ALCHEMY_API_KEY
to the environment variables - Deploy!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Alchemy for providing the Price API
- Vercel for hosting the application