https://github.com/ivancheban/bitcoin-price
A static web page that checks and displays the current price of Bitcoin in USD
https://github.com/ivancheban/bitcoin-price
bitcoin-price
Last synced: about 1 month ago
JSON representation
A static web page that checks and displays the current price of Bitcoin in USD
- Host: GitHub
- URL: https://github.com/ivancheban/bitcoin-price
- Owner: ivancheban
- Created: 2024-01-06T16:20:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-02T14:53:57.000Z (9 months ago)
- Last Synced: 2025-04-09T04:36:47.017Z (6 months ago)
- Topics: bitcoin-price
- Language: HTML
- Homepage: https://bitcoin-price-checker.netlify.app/
- Size: 371 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bitcoin Price Checker
> **Note:** The description below and the code in this repo are created using Copilot by Microsoft.
This repository contains a static web page that checks and displays the current price of Bitcoin in USD.
## Project Overview
The project uses the Axios library to make HTTP requests to the Coinbase API, which provides real-time Bitcoin prices. The web page updates every 30 seconds to display the latest price.
## Code Explanation
The code is written in HTML and JavaScript. It uses the Axios library to make HTTP requests to the Coinbase API. The API endpoint used is 'https://api.coinbase.com/v2/prices/BTC-USD/buy', which returns the current buying price of Bitcoin in USD.
An asynchronous JavaScript function, `getBitcoinPrice()`, is defined to make the API request and update the web page with the latest price. This function is called immediately when the page loads, and then every 30 seconds using the `setInterval()` function.
## How to Use
To use this project:
1. Clone the repository to your local machine.
2. Open the HTML file in a web browser.> **Note:** This project is for informational purposes only and should not be used as financial advice.
## Contributing
Contributions to improve the code or add new features are welcome. Submit pull requests.
## License
This project is licensed under the MIT License.