Consumes the CoinMarketCap API, acquiring the price data and change of the day in %, of the first hundred cryptocurrency in the list and saving the data to a csv file.
Poetry 1.0.0
Python 3.9
Requests 2.28.1
Create a free account in: https://coinmarketcap.com/api/
varenv.py
-
Copy the API Key of your account from: https://pro.coinmarketcap.com/account
# Private API KEY # https://pro.coinmarketcap.com/account API_KEY = "YOUR PRIVATE API KEY"
- Clone the repository:
$ git clone https://github.com/brunomcr/consuming-coinMarketcap-API.git
$ cd consuming-coinMarketcap-API/
- Install dependencies:
$ poetry install
- Run main code and saving the data in .csv:
$ poetry run python main.py
✅ With the main code executed, you can view the data in coinMarketCap.csv!
coinMarketCap.csv
Name | Symbol | Price | % 24h |
---|---|---|---|
Bitcoin | BTC | 19984.58 | 3.74 |
Ethereum | ETH | 1352.45 | 3.56 |
Tether | USDT | 1.0 | 0.01 |
BNB | BNB | 293.94 | 2.7 |
USD Coin | USDC | 1.0 | 0.0 |