Skip to content

A Go-based command-line tool for querying Bitcoin data from a cryptocurrency API.

License

Notifications You must be signed in to change notification settings

lucianoayres/btcq-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

btcq logo

btcq: Query Bitcoin data and get real-time price quotes from your CLI.

btcq is a command-line tool for querying Bitcoin data from a cryptocurrency API. This tool allows you to fetch various pieces of information about Bitcoin, including the current price, trading volume, market capitalization, all-time high price, and percentage changes over different time windows.

btcq_demo

Installation

To build the btcq CLI tool, run the following command in the root directory of the project:

make

This will generate an executable named btcq in your directory. After building the project, you can run the executable with:

./btcq

Alternatively, you can move the binary to a directory that's included in your PATH to run it directly. Example:

mv btcq ~/.local/bin
btcq

This will allow you to execute the tool from anywhere in your terminal.

Run Tests

To run the all the unit tests in the project:

make test

Usage

You can use btcq with various command-line flags to retrieve specific information about Bitcoin. The available flags are:

Flags

  • -all-data : Get all available Bitcoin data.
  • -price : Get the current Bitcoin price.
  • -volume : Get the 24-hour Bitcoin trading volume.
  • -market-cap : Get the Bitcoin market capitalization.
  • -ath-price : Get the all-time high (ATH) price of Bitcoin.

Percent Change Flags

You can use either the long or short flags to get percentage changes:

  • -pc-15m : Get the 15-minute percent change in Bitcoin price.
  • -pc-30m : Get the 30-minute percent change in Bitcoin price.
  • -pc-1h : Get the 1-hour percent change in Bitcoin price.
  • -pc-6h : Get the 6-hour percent change in Bitcoin price.
  • -pc-12h : Get the 12-hour percent change in Bitcoin price.
  • -pc-24h : Get the 24-hour percent change in Bitcoin price.
  • -pc-7d : Get the 7-day percent change in Bitcoin price.
  • -pc-30d : Get the 30-day percent change in Bitcoin price.
  • -pc-1y : Get the 1-year percent change in Bitcoin price.

Examples

  • Get the current Bitcoin price:

    btcq
  • Get all available Bitcoin data:

    btcq -all-data
  • Get the 1-hour percent change in Bitcoin price:

    btcq -pc-1h
  • Get the 7-day percent change in Bitcoin price:

    btcq -pc-7d

API Reference

The data is fetched from the CoinPaprika API. For more information about the API, refer to their documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Go-based command-line tool for querying Bitcoin data from a cryptocurrency API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published