This is a Sinatra app that expose a REST API for bitcoin prices (https://bitcoinaverage.com/).
You need to have Redis installed if you want to enable cache. Results are kept in cache for 60 seconds by default.
Sample configuration is in .env.example
file.
Please create your own .env
file.
By default endpoints are secured by Basic access authentication.
Example request:
GET :host/api/price/usd
Example response:
{
"price": 234.23,
"currency": "USD"
}
App supports almost every currency in the ISO 4217 standard.
- Redis
$ bundle install
$ ruby app.rb
/api/price/:currency
- Fork it ( https://github.com/tradziej/bitcoin_avg_api/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request