> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daya.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Trade

> Get details of a specific trade

## 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

<ParamField header="X-Api-Key" type="string" required>
  Your API key with Read or Trade scope

  ```
  X-Api-Key: daya_sk_YOUR_API_KEY
  ```
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique trade identifier (UUID)

  **Example:** `660e8400-e29b-41d4-a716-446655440000`
</ParamField>

## Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  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'
  ```

  ```javascript JavaScript theme={null}
  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);
  ```

  ```python Python theme={null}
  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']}")
  ```

  ```go Go theme={null}
  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"])
  }
  ```
</CodeGroup>

## Response

<ResponseField name="success" type="boolean" required>
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string" required>
  Human-readable response message
</ResponseField>

<ResponseField name="data" type="object" required>
  Trade details

  <Expandable title="trade properties">
    <ResponseField name="id" type="string">
      Unique trade identifier (UUID)
    </ResponseField>

    <ResponseField name="symbol" type="string">
      Trading pair symbol

      **Example:** `USD-NGN`
    </ResponseField>

    <ResponseField name="side" type="string">
      Trade side relative to the authenticated user (`"buy"` or `"sell"`)
    </ResponseField>

    <ResponseField name="order_id" type="string">
      The authenticated user's order identifier (UUID)
    </ResponseField>

    <ResponseField name="price" type="string">
      Execution price
    </ResponseField>

    <ResponseField name="quantity" type="string">
      Trade quantity in base asset
    </ResponseField>

    <ResponseField name="total_value" type="string">
      Trade value in quote asset (price x quantity)
    </ResponseField>

    <ResponseField name="fee" type="string">
      Fee charged to the authenticated user for this trade
    </ResponseField>

    <ResponseField name="is_maker" type="boolean">
      Whether the authenticated user was the maker (resting order) in this trade
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 trade execution timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp of the response
</ResponseField>

### Success Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "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"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "message": "Unauthorized",
    "error": {
      "code": "API_KEY_INVALID",
      "message": "The provided API key is invalid"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "message": "Trade not found",
    "error": {
      "code": "TRADE_NOT_FOUND",
      "message": "The specified trade does not exist"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>

## 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 `side` and `order_id` fields are relative to your user. If you were the buyer, `side` is `"buy"` and `order_id` is your buy order's ID.

## Rate Limits

* **100 requests per minute** per API key

## Next Steps

<CardGroup cols={2}>
  <Card title="List Trades" icon="clock-rotate-left" href="/pro/api-reference/list-trades">
    View all your trades
  </Card>

  <Card title="List Order Trades" icon="list" href="/pro/api-reference/list-order-trades">
    View trades for a specific order
  </Card>
</CardGroup>
