@codesmithtech I've actually been wondering if people would be interested in stellar-price as an API. You're free to consume the websocket api as-is. Does the format as it is now work for you?
You can test the websocket api with the wsta
commandline tool like this: (I've added pygmentize
for syntax coloring, you can leave that out)
echo '{"topic":"info:sell:xlm:eur","event":"phx_join","payload":{},"ref":"1"}' | wsta ws://stellar-price.com/socket/websocket | pygmentize -s -l json
This returns colored json:
{
"topic": "info:sell:xlm:eur",
"ref": null,
"payload": {
"route": [
{
"trade_direction": "sell",
"quote_currency": "btc",
"market_url": "https://www.kraken.com/",
"exchange_name": "Kraken",
"bid": 0.0000363,
"base_currency": "xlm",
"ask": 0.0000364
},
{
"trade_direction": "sell",
"quote_currency": "eur",
"market_url": "https://www.gdax.com/trade/BTC-EUR",
"exchange_name": "Gdax",
"bid": 8463.74,
"base_currency": "btc",
"ask": 8463.75
}
]
},
"join_ref": null,
"event": "tick"
}
Let me know if you want to run the app locally. It's a "standard" Elixir Phoenix app.