Get Orderbook
curl --request GET \
--url https://api.pro.daya.co/public/v1/orderbook/{symbol}import requests
url = "https://api.pro.daya.co/public/v1/orderbook/{symbol}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pro.daya.co/public/v1/orderbook/{symbol}', 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://api.pro.daya.co/public/v1/orderbook/{symbol}",
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://api.pro.daya.co/public/v1/orderbook/{symbol}"
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://api.pro.daya.co/public/v1/orderbook/{symbol}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/orderbook/{symbol}")
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{
"success": true,
"message": "Orderbook retrieved successfully",
"data": {
"symbol": "USD-NGN",
"market_id": "550e8400-e29b-41d4-a716-446655440000",
"base_asset": "USD",
"quote_asset": "NGN",
"bids": [
{"price": "1545.00", "quantity": "500.00"},
{"price": "1544.50", "quantity": "1200.00"},
{"price": "1544.00", "quantity": "800.00"}
],
"asks": [
{"price": "1546.00", "quantity": "800.00"},
{"price": "1546.50", "quantity": "350.00"},
{"price": "1547.00", "quantity": "1500.00"}
],
"stats": {
"best_bid": "1545.00",
"best_ask": "1546.00",
"spread": "1.00",
"spread_percent": "0.065",
"mid_price": "1545.50"
},
"depth": 10,
"timestamp": "2024-01-15T10:30:00Z"
}
}
Markets
Get Orderbook
Retrieve the current orderbook for a trading pair
GET
/
public
/
v1
/
orderbook
/
{symbol}
Get Orderbook
curl --request GET \
--url https://api.pro.daya.co/public/v1/orderbook/{symbol}import requests
url = "https://api.pro.daya.co/public/v1/orderbook/{symbol}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pro.daya.co/public/v1/orderbook/{symbol}', 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://api.pro.daya.co/public/v1/orderbook/{symbol}",
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://api.pro.daya.co/public/v1/orderbook/{symbol}"
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://api.pro.daya.co/public/v1/orderbook/{symbol}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/orderbook/{symbol}")
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{
"success": true,
"message": "Orderbook retrieved successfully",
"data": {
"symbol": "USD-NGN",
"market_id": "550e8400-e29b-41d4-a716-446655440000",
"base_asset": "USD",
"quote_asset": "NGN",
"bids": [
{"price": "1545.00", "quantity": "500.00"},
{"price": "1544.50", "quantity": "1200.00"},
{"price": "1544.00", "quantity": "800.00"}
],
"asks": [
{"price": "1546.00", "quantity": "800.00"},
{"price": "1546.50", "quantity": "350.00"},
{"price": "1547.00", "quantity": "1500.00"}
],
"stats": {
"best_bid": "1545.00",
"best_ask": "1546.00",
"spread": "1.00",
"spread_percent": "0.065",
"mid_price": "1545.50"
},
"depth": 10,
"timestamp": "2024-01-15T10:30:00Z"
}
}
Overview
Get the current orderbook (market depth) for a specific trading pair. This endpoint does not require authentication.Path Parameters
Trading pair symbolExample:
USDT-NGNAllowed values: USDT-NGN, USDC-NGN, USD-NGNQuery Parameters
Number of price levels to returnDefault:
20Range: 1 to 100Request Examples
curl --request GET \
--url 'https://api.pro.daya.co/public/v1/orderbook/USDT-NGN?depth=10'
const response = await fetch(
'https://api.pro.daya.co/public/v1/orderbook/USDT-NGN?depth=10'
);
const orderbook = await response.json();
console.log('Best bid:', orderbook.data.stats.best_bid);
console.log('Best ask:', orderbook.data.stats.best_ask);
import requests
response = requests.get(
'https://api.pro.daya.co/public/v1/orderbook/USDT-NGN',
params={'depth': 10}
)
orderbook = response.json()
print(f"Best bid: {orderbook['data']['stats']['best_bid']}")
print(f"Best ask: {orderbook['data']['stats']['best_ask']}")
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://api.pro.daya.co/public/v1/orderbook/USDT-NGN?depth=10")
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
data := result["data"].(map[string]interface{})
stats := data["stats"].(map[string]interface{})
fmt.Println("Best bid:", stats["best_bid"])
fmt.Println("Best ask:", stats["best_ask"])
}
Response
Indicates if the request was successful
Human-readable response message
Orderbook data
Show data properties
Show data properties
Trading pair symbol
Market ID (UUID)
Base asset of the pair
Quote asset of the pair
Orderbook depth returned
ISO 8601 timestamp of the snapshot
Success Response
{
"success": true,
"message": "Orderbook retrieved successfully",
"data": {
"symbol": "USD-NGN",
"market_id": "550e8400-e29b-41d4-a716-446655440000",
"base_asset": "USD",
"quote_asset": "NGN",
"bids": [
{"price": "1545.00", "quantity": "500.00"},
{"price": "1544.50", "quantity": "1200.00"},
{"price": "1544.00", "quantity": "800.00"}
],
"asks": [
{"price": "1546.00", "quantity": "800.00"},
{"price": "1546.50", "quantity": "350.00"},
{"price": "1547.00", "quantity": "1500.00"}
],
"stats": {
"best_bid": "1545.00",
"best_ask": "1546.00",
"spread": "1.00",
"spread_percent": "0.065",
"mid_price": "1545.50"
},
"depth": 10,
"timestamp": "2024-01-15T10:30:00Z"
}
}
Error Responses
{
"success": false,
"message": "Market not found",
"error": {
"code": "SYMBOL_NOT_FOUND",
"message": "Market not found",
"symbol": "INVALID-PAIR"
}
}
{
"success": false,
"message": "Validation error",
"error": {
"code": "VALIDATION_ERROR",
"message": "Depth must be between 1 and 100"
}
}
Understanding the Orderbook
Bids vs Asks
| Type | Description | Sort Order |
|---|---|---|
| Bids | Buy orders - users willing to purchase at this price | Highest price first |
| Asks | Sell orders - users willing to sell at this price | Lowest price first |
Reading the Spread
The spread is the difference between the best ask and best bid:Spread = Best Ask - Best Bid
Spread % = (Spread / Mid Price) × 100
Rate Limits
- 100 requests per minute per IP address
- No authentication required
Next Steps
Place Order
Execute a trade at current market prices
List Markets
View all available markets
⌘I