BTCMarkets / API

API
120 stars 30 forks source link

BTC Markets Trading data API #179

Closed AussieBloomin closed 4 years ago

AussieBloomin commented 4 years ago

I need help to create a GET address to receive all the bid and ask information from BTC Markets.

https://api.btcmarkets.net/v3/markets/?marketId=ETH-BTC&marketId=XRP-BTC/ticker

gives me all the assets but no bid and ask info. output is

[{"marketId":"BTC-AUD","baseAssetName":"BTC","quoteAssetName":"AUD","minOrderAmount":"0.0001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"LTC-AUD","baseAssetName":"LTC","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"LTC-BTC","baseAssetName":"LTC","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"ETH-BTC","baseAssetName":"ETH","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"ETH-AUD","baseAssetName":"ETH","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"ETC-AUD","baseAssetName":"ETC","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"ETC-BTC","baseAssetName":"ETC","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"XRP-AUD","baseAssetName":"XRP","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"4"},{"marketId":"XRP-BTC","baseAssetName":"XRP","quoteAssetName":"BTC","minOrderAmount":"0.01","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"POWR-AUD","baseAssetName":"POWR","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"4"},{"marketId":"POWR-BTC","baseAssetName":"POWR","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"OMG-AUD","baseAssetName":"OMG","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"4"},{"marketId":"OMG-BTC","baseAssetName":"OMG","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"BCHABC-AUD","baseAssetName":"BCHABC","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"BCHABC-BTC","baseAssetName":"BCHABC","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"BCHSV-AUD","baseAssetName":"BCHSV","quoteAssetName":"AUD","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"BCHSV-BTC","baseAssetName":"BCHSV","quoteAssetName":"BTC","minOrderAmount":"0.001","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"GNT-AUD","baseAssetName":"GNT","quoteAssetName":"AUD","minOrderAmount":"0.15","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"4"},{"marketId":"GNT-BTC","baseAssetName":"GNT","quoteAssetName":"BTC","minOrderAmount":"0.15","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"BAT-AUD","baseAssetName":"BAT","quoteAssetName":"AUD","minOrderAmount":"0.06","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"4"},{"marketId":"BAT-BTC","baseAssetName":"BAT","quoteAssetName":"BTC","minOrderAmount":"0.06","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"},{"marketId":"XLM-AUD","baseAssetName":"XLM","quoteAssetName":"AUD","minOrderAmount":"0.1","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"4"},{"marketId":"XLM-BTC","baseAssetName":"XLM","quoteAssetName":"BTC","minOrderAmount":"0.1","maxOrderAmount":"1000000","amountDecimals":"8","priceDecimals":"2"}]

thank you for your assistance

martin-nginio commented 4 years ago

Hi @AussieBloomin

You should be able to use the following API in order to retrieve ticker information for a given market.
/v3/markets/{marketId}/ticker

Also, if you want to get ticker inforamtion for multiple markets then the below API can be useful: /v3/markets/tickers (you can pass multiple marketIds as query params)

More inforamtion about those APIs can be found here: https://api.btcmarkets.net/doc/v3/#tag/Market-data-APIs/paths/~1v3~1markets~1tickers/get

Thanks.

Regards, Martin

AussieBloomin commented 4 years ago

I already use https://api.btcmarkets.net/market/BAT/AUD/tick

but I want multiple markets and the following API doesn't work https://api.btcmarkets.net/v3/markets/?marketId=ETH-BTC&marketId=XRP-BTC/ticker https://api.btcmarkets.net/v3/markets/?marketId=%22ETH-BTC%22&marketId=%22XRP-BTC%22/ticker

nor does /v3/markets/tickers

On Mon, Jan 6, 2020 at 12:48 PM martin-nginio notifications@github.com wrote:

Hi @AussieBloomin https://github.com/AussieBloomin

You should be able to use the following API in order to retrieve ticker information for a given market. /v3/markets/{marketId}/ticker

Also, if you want to get ticker inforamtion for multiple markets then the below API can be useful: /v3/markets/tickers (you can pass multiple marketIds as query params)

More inforamtion about those APIs can be found here:

https://api.btcmarkets.net/doc/v3/#tag/Market-data-APIs/paths/~1v3~1markets~1tickers/get

Thanks.

Regards, Martin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BTCMarkets/API/issues/179?email_source=notifications&email_token=AOF5COS5LLSSHUGLESYJY33Q4KLWTA5CNFSM4KCUEUEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIEIHMY#issuecomment-570983347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOF5COQTNVZSJRNE6OGMXC3Q4KLWTANCNFSM4KCUEUEA .

martin-nginio commented 4 years ago

The correct path would be: https://api.btcmarkets.net/v3/markets/tickers?marketId=ETH-BTC&marketId=XRP-BTC

AussieBloomin commented 4 years ago

Thank you very much.

That works perfectly.

On Mon, Jan 6, 2020 at 1:05 PM martin-nginio notifications@github.com wrote:

The correct path would be:

https://api.btcmarkets.net/v3/markets/tickers?marketId=ETH-BTC&marketId=XRP-BTC

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BTCMarkets/API/issues/179?email_source=notifications&email_token=AOF5COTDYDG6I3DNXC5S2HDQ4KNV7A5CNFSM4KCUEUEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIEI32Y#issuecomment-570985963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOF5COXWD3WIQPYRZD3FWXTQ4KNV7ANCNFSM4KCUEUEA .

martin-nginio commented 4 years ago

closing the issue. Thanks @AussieBloomin