Get Trade
curl --request GET \
--url https://api.pro.daya.co/public/v1/trades/{id} \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.pro.daya.co/public/v1/trades/{id}"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.pro.daya.co/public/v1/trades/{id}', 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/trades/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>"
],
]);
$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/trades/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
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/trades/{id}")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/trades/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Trade retrieved successfully",
"data": {
"id": "660e8400-e29b-41d4-a716-446655440000",
"symbol": "USD-NGN",
"side": "buy",
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"price": "1545.50",
"quantity": "100.00000000",
"total_value": "154550.00",
"fee": "0.15455000",
"is_maker": false,
"created_at": "2024-01-15T10:35:01Z"
},
"timestamp": "2024-01-15T10:35:01Z"
}
Trades
Get Trade
Get details of a specific trade
GET
/
public
/
v1
/
trades
/
{id}
Get Trade
curl --request GET \
--url https://api.pro.daya.co/public/v1/trades/{id} \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.pro.daya.co/public/v1/trades/{id}"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.pro.daya.co/public/v1/trades/{id}', 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/trades/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>"
],
]);
$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/trades/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
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/trades/{id}")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/trades/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Trade retrieved successfully",
"data": {
"id": "660e8400-e29b-41d4-a716-446655440000",
"symbol": "USD-NGN",
"side": "buy",
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"price": "1545.50",
"quantity": "100.00000000",
"total_value": "154550.00",
"fee": "0.15455000",
"is_maker": false,
"created_at": "2024-01-15T10:35:01Z"
},
"timestamp": "2024-01-15T10:35:01Z"
}
Overview
Retrieve details for a specific trade by its ID. Only trades where you are the buyer or seller are accessible. This endpoint requires authentication with an API key that has Read scope.Authentication
string
required
Your API key with Read or Trade scope
X-Api-Key: daya_sk_YOUR_API_KEY
Path Parameters
string
required
The unique trade identifier (UUID)Example:
660e8400-e29b-41d4-a716-446655440000Request Examples
curl --request GET \
--url https://api.pro.daya.co/public/v1/trades/660e8400-e29b-41d4-a716-446655440000 \
--header 'X-Api-Key: daya_sk_YOUR_API_KEY'
const tradeId = '660e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.pro.daya.co/public/v1/trades/${tradeId}`,
{
headers: { 'X-Api-Key': 'daya_sk_YOUR_API_KEY' }
}
);
const trade = await response.json();
console.log('Trade details:', trade.data);
import requests
trade_id = '660e8400-e29b-41d4-a716-446655440000'
headers = {'X-Api-Key': 'daya_sk_YOUR_API_KEY'}
response = requests.get(
f'https://api.pro.daya.co/public/v1/trades/{trade_id}',
headers=headers
)
trade = response.json()
print(f"Trade details: {trade['data']}")
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
tradeID := "660e8400-e29b-41d4-a716-446655440000"
url := fmt.Sprintf("https://api.pro.daya.co/public/v1/trades/%s", tradeID)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println("Trade details:", result["data"])
}
Response
boolean
required
Indicates if the request was successful
string
required
Human-readable response message
object
required
Trade details
Show trade properties
Show trade properties
string
Unique trade identifier (UUID)
string
Trading pair symbolExample:
USD-NGNstring
Trade side relative to the authenticated user (
"buy" or "sell")string
The authenticated user’s order identifier (UUID)
string
Execution price
string
Trade quantity in base asset
string
Trade value in quote asset (price x quantity)
string
Fee charged to the authenticated user for this trade
boolean
Whether the authenticated user was the maker (resting order) in this trade
string
ISO 8601 trade execution timestamp
string
ISO 8601 timestamp of the response
Success Response
{
"success": true,
"message": "Trade retrieved successfully",
"data": {
"id": "660e8400-e29b-41d4-a716-446655440000",
"symbol": "USD-NGN",
"side": "buy",
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"price": "1545.50",
"quantity": "100.00000000",
"total_value": "154550.00",
"fee": "0.15455000",
"is_maker": false,
"created_at": "2024-01-15T10:35:01Z"
},
"timestamp": "2024-01-15T10:35:01Z"
}
Error Responses
{
"success": false,
"message": "Unauthorized",
"error": {
"code": "API_KEY_INVALID",
"message": "The provided API key is invalid"
},
"timestamp": "2024-01-15T10:35:00Z"
}
{
"success": false,
"message": "Trade not found",
"error": {
"code": "TRADE_NOT_FOUND",
"message": "The specified trade does not exist"
},
"timestamp": "2024-01-15T10:35:00Z"
}
Notes
- You can only access trades where you are either the buyer or the seller. Attempting to access a trade you are not party to will return a 404 response.
- The
sideandorder_idfields are relative to your user. If you were the buyer,sideis"buy"andorder_idis your buy order’s ID.
Rate Limits
- 100 requests per minute per API key
Next Steps
List Trades
View all your trades
List Order Trades
View trades for a specific order
⌘I