GET /api/orderbook
curl --request GET \
--url https://public-api.binibit.com/api/orderbookimport requests
url = "https://public-api.binibit.com/api/orderbook"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://public-api.binibit.com/api/orderbook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.binibit.com/api/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.binibit.com/api/orderbook"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://public-api.binibit.com/api/orderbook")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.binibit.com/api/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"isBid": true,
"price": 123,
"amount": 123,
"quoteAmount": 123,
"currencyTo": 123,
"currencyFrom": 123
}Market Data
GET /api/orderbook
Order book depth (40 bids + 40 asks) for a single trading pair.
GET
/
api
/
orderbook
GET /api/orderbook
curl --request GET \
--url https://public-api.binibit.com/api/orderbookimport requests
url = "https://public-api.binibit.com/api/orderbook"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://public-api.binibit.com/api/orderbook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.binibit.com/api/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://public-api.binibit.com/api/orderbook"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://public-api.binibit.com/api/orderbook")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.binibit.com/api/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"isBid": true,
"price": 123,
"amount": 123,
"quoteAmount": 123,
"currencyTo": 123,
"currencyFrom": 123
}Description
Returns up to 40 bid levels and 40 ask levels for one trading pair, as a flat array of order-book levels. Each level has anisBid flag indicating whether it is a bid (true) or ask (false).
Parameters
string
required
Pair code in
{base}_{target} format, e.g. TRX_USDT.Response
Array of order-book levels. Each level:boolean
required
true for a bid, false for an ask.decimal
required
Price level in target (quote) currency.
decimal
required
Available quantity at this level, denominated in base currency.
decimal
required
Equivalent value at this level in target (quote) currency. Equals
price * amount.decimal
deprecated
Deprecated alias of
amount. Will be removed in a future release.decimal
deprecated
Deprecated alias of
quoteAmount. Will be removed in a future release.Example request
curl "https://public-api.binibit.com/api/orderbook?currencyPairCode=TRX_USDT"
Example response
[
{
"isBid": true,
"price": 0.31964356,
"amount": 479.16033232,
"quoteAmount": 153.16051443,
"currencyTo": 479.16033232,
"currencyFrom": 153.16051443
},
{
"isBid": true,
"price": 0.31963366,
"amount": 211.93028363,
"quoteAmount": 67.74005222,
"currencyTo": 211.93028363,
"currencyFrom": 67.74005222
},
{
"isBid": false,
"price": 0.32621694,
"amount": 123.38,
"quoteAmount": 40.241386
}
]
Splitting bids and asks
const levels = await fetch(
`https://public-api.binibit.com/api/orderbook?currencyPairCode=TRX_USDT`
).then(r => r.json());
const bids = levels.filter(l => l.isBid).sort((a, b) => b.price - a.price);
const asks = levels.filter(l => !l.isBid).sort((a, b) => a.price - b.price);
const bestBid = bids[0]?.price;
const bestAsk = asks[0]?.price;
const spread = bestAsk - bestBid;
Notes
- Returns up to 40 levels per side. Less if the book is thin.
- For deeper books or aggregator-spec format, see Aggregator Compatibility / orderbook.
currencyToandcurrencyFromare deprecated — preferamountandquoteAmount.
