Module: Binance::Client::REST::PublicAPI
- Included in:
- Binance::Client::REST
- Defined in:
- lib/binance/client/rest/public_api.rb
Overview
Public: A Module containing all of the Public API endpoints
Instance Method Summary collapse
-
#agg_trades(options) ⇒ Object
Public: Retrieve aggregate trade data for the specified symbol.
-
#all_book_tickers ⇒ Object
Public: Retrieve all book ticker data for all symbols.
-
#all_prices ⇒ Object
Public: Retrieve all price ticker data.
-
#book_ticker(options) ⇒ Object
Public: Retrieve best price per quantity on the order book.
-
#depth(options) ⇒ Object
Public: Retrieve depth information for the specified symbol.
-
#exchange_info ⇒ Object
Public: Retrieve current exchange trading rules and symbol information.
-
#historical_trades(options) ⇒ Object
Public: Retrieve old trade data for the specified symbol.
-
#klines(options) ⇒ Object
Public: Retrieve kline data for the specified symbol.
-
#ping ⇒ Object
Public: Ping the server to test connectivity.
-
#price(options) ⇒ Object
Public: Retrieve price ticker data for the specified symbol.
-
#products ⇒ Object
Public: Retrieve current exchange asset information.
-
#time ⇒ Object
Public: Retrieve the server time in milliseconds.
-
#trades(options) ⇒ Object
Public: Retrieve recent trades for the specified symbol.
-
#twenty_four_hour(options) ⇒ Object
Public: Retrieve 24 hour ticker price data.
Instance Method Details
#agg_trades(options) ⇒ Object
Public: Retrieve aggregate trade data for the specified symbol
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve.
:fromId - The String of which trade ID to fetch from (optional).
:startTime - The Timestamp of when to get trades from in
milliseconds (optional).
:endTime - The Timestamp of when to get trades until in
milliseconds (optional).
:limit - The Number of how many trades to request (optional).
Returns a Hash with the request response
82 83 84 |
# File 'lib/binance/client/rest/public_api.rb', line 82 def agg_trades() request :public, :get, :aggTrades, end |
#all_book_tickers ⇒ Object
Public: Retrieve all book ticker data for all symbols
Returns a Hash with the request response
143 144 145 |
# File 'lib/binance/client/rest/public_api.rb', line 143 def all_book_tickers request :public, :get, :bookTicker end |
#all_prices ⇒ Object
Public: Retrieve all price ticker data
Returns a Hash with the request response
126 127 128 |
# File 'lib/binance/client/rest/public_api.rb', line 126 def all_prices request :public, :get, :price end |
#book_ticker(options) ⇒ Object
Public: Retrieve best price per quantity on the order book
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve (optional).
Returns a Hash with the request response
136 137 138 |
# File 'lib/binance/client/rest/public_api.rb', line 136 def book_ticker() request :public, :get, :bookTicker, end |
#depth(options) ⇒ Object
Public: Retrieve depth information for the specified symbol
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve.
:limit - The Number of how many updates to request (optional).
Returns a Hash with the request response
43 44 45 |
# File 'lib/binance/client/rest/public_api.rb', line 43 def depth() request :public, :get, :depth, end |
#exchange_info ⇒ Object
Public: Retrieve current exchange trading rules and symbol information
Returns a Hash with the request response
24 25 26 |
# File 'lib/binance/client/rest/public_api.rb', line 24 def exchange_info request :public, :get, :exchangeInfo end |
#historical_trades(options) ⇒ Object
Public: Retrieve old trade data for the specified symbol
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve.
:limit - The Number of how many trades to request (optional).
:fromId - The String of which trade ID to fetch from (optional).
Returns a Hash with the request response
66 67 68 |
# File 'lib/binance/client/rest/public_api.rb', line 66 def historical_trades() request :verified, :get, :historicalTrades, end |
#klines(options) ⇒ Object
Public: Retrieve kline data for the specified symbol
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve.
:interval - The String of which interval to retrieve (optional).
:fromId - The String of which trade ID to fetch from (optional).
:startTime - The Timestamp of when to get trades from in
milliseconds (optional).
:endTime - The Timestamp of when to get trades until in
milliseconds (optional).
:limit - The Number of how many trades to request (optional).
Returns a Hash with the request response
99 100 101 |
# File 'lib/binance/client/rest/public_api.rb', line 99 def klines() request :public, :get, :klines, end |
#ping ⇒ Object
Public: Ping the server to test connectivity
Returns a Hash with the request response
10 11 12 |
# File 'lib/binance/client/rest/public_api.rb', line 10 def ping request :public, :get, :ping end |
#price(options) ⇒ Object
Public: Retrieve price ticker data for the specified symbol
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve (optional).
Returns a Hash with the request response
119 120 121 |
# File 'lib/binance/client/rest/public_api.rb', line 119 def price() request :public, :get, :price, end |
#products ⇒ Object
Public: Retrieve current exchange asset information. This is an undocumented endpoint.
Returns a Hash with the request response
32 33 34 |
# File 'lib/binance/client/rest/public_api.rb', line 32 def products request :public, :get, :products end |
#time ⇒ Object
Public: Retrieve the server time in milliseconds
Returns a Hash with the request response
17 18 19 |
# File 'lib/binance/client/rest/public_api.rb', line 17 def time request :public, :get, :time end |
#trades(options) ⇒ Object
Public: Retrieve recent trades for the specified symbol
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve.
:limit - The Number of how many trades to request (optional).
Returns a Hash with the request response
54 55 56 |
# File 'lib/binance/client/rest/public_api.rb', line 54 def trades() request :public, :get, :trades, end |
#twenty_four_hour(options) ⇒ Object
Public: Retrieve 24 hour ticker price data
options - The Hash which hosts various REST query params.
:symbol - The String of which trading pair to retrieve (optional).
Returns a Hash with the request response
109 110 111 |
# File 'lib/binance/client/rest/public_api.rb', line 109 def twenty_four_hour() request :public, :get, :twenty_four_hour, end |