A tiny CLI app that reaches CoinCap API to extract cryptocurrencies exchange data in real time, dumping the results into a CSV file.
Simply a learning exercise for myself to turn a DuckDB script from Joseph Machado's Data Engineering exercises from Python code into a Rust CLI tool.
Important
In order to use CoinCap API you need an API token. The free tier is more than enough to run the example in this repo and you can sign up for it and obtain a token by following the instructions in CoinCap API documentation.
Simply run the application from your terminal, passing the name of the file where you want to store the results.
You can pass the CoinCap API token in different ways. Choose the one that fits your needs:
- Pass it directly in the command line arguments:
coincap_exchange --file results.csv --api-key <COINCAP_API_KEY>
- Declare it as an environment variable and simply call the app. E.g. in Bash shell:
export COINCAP_API_KEY=<COINCAP_API_KEY>
coincap_exchange --file results.csv
- Store it in a
.envfile in the same directory where you run the CLI, which is automatically picked up by the app:COINCAP_API_KEY=<COINCAP_API_KEY>coincap_exchange --file results.csv
Check the CLI help menu to find the few options it offers to run:
coincap_exchange --help