Skip to main content
Version: v2

Exchange Rates

The Rates endpoints provide real-time exchange rates and pricing information for all supported trading pairs. Use these endpoints to get accurate pricing before creating orders.

Get Exchange Rates

Get current exchange rates and trading information for currency pairs. This is the v2 version of the former bulk rates endpoint with simplified response format.

Request

curl -X GET "https://api.n.exchange/en/api/v2/rate/" \
-H "Accept: application/json" \
-H "Authorization: ApiKey api_key"

Query Parameters:

ParameterTypeRequiredDescription
pairsstringNoComma-separated trading pairs (e.g., "BTCUSDC,ETHBTC"). Returns all pairs if omitted
fiat_onlybooleanNoFilter to only include fiat pairs
crypto_onlybooleanNoFilter to only include crypto pairs

Response

Returns an array of rate objects with simplified v2 format.

Response Fields:

FieldTypeDescription
pairstringTrading pair name (e.g., "BTCUSDC")
fromstringSource currency (what you send)
tostringDestination currency (what you receive)
withdrawal_feestringFee for withdrawing the destination currency
ratestringCurrent exchange rate
rate_idstringUnique identifier for this rate quote
max_withdraw_amountstringMaximum amount that can be withdrawn
min_withdraw_amountstringMinimum amount that can be withdrawn
max_deposit_amountstringMaximum amount that can be deposited
min_deposit_amountstringMinimum amount that can be deposited
expiration_time_unixstringUnix timestamp when this rate expires

Example Response:

[
{
"pair": "BTCUSDC",
"from": "USDC",
"to": "BTC",
"withdrawal_fee": "0.00050000",
"rate": "45000.00",
"rate_id": "abc123-000000",
"max_withdraw_amount": "10.00000000",
"min_withdraw_amount": "0.00100000",
"max_deposit_amount": "500000.00",
"min_deposit_amount": "50.00",
"expiration_time_unix": "1697365800"
},
{
"pair": "ETHBTC",
"from": "BTC",
"to": "ETH",
"withdrawal_fee": "0.00500000",
"rate": "0.06500000",
"rate_id": "def456-000001",
"max_withdraw_amount": "100.00000000",
"min_withdraw_amount": "0.10000000",
"max_deposit_amount": "2.00000000",
"min_deposit_amount": "0.00200000",
"expiration_time_unix": "1697365800"
}
]

Filtered Requests

Get rates for specific pairs:

curl -X GET "https://api.n.exchange/en/api/v2/rate/?pairs=BTCUSDC,ETHBTC" \
-H "Accept: application/json" \
-H "Authorization: ApiKey api_key"

Get only fiat pairs:

curl -X GET "https://api.n.exchange/en/api/v2/rate/?fiat_only=true" \
-H "Accept: application/json" \
-H "Authorization: ApiKey api_key"

Get only crypto pairs:

curl -X GET "https://api.n.exchange/en/api/v2/rate/?crypto_only=true" \
-H "Accept: application/json" \
-H "Authorization: ApiKey api_key"

Key Changes from v1

Simplified Endpoint

  • v1: /info/bulk/ endpoint
  • v2: /rate/ endpoint

Field Name Changes

  • max_receive_amountmax_withdraw_amount
  • min_receive_amountmin_withdraw_amount
  • Removed deprecated fields: allowed_historic_price_variance, allowed_historic_price_age, max_amount, min_amount

Enhanced Filtering

v2 adds filtering options:

  • fiat_only=true - Only fiat currency pairs
  • crypto_only=true - Only cryptocurrency pairs

Rate Best Practices

Rate Validity

  • Rate IDs: Use rate IDs when creating orders for guaranteed rates
  • Freshness: Rates update frequently; fetch new rates before each transaction
  • Expiration: Check expiration_time_unix to ensure rate is still valid

Integration Tips

  1. Cache for Display: Cache rates for UI display to reduce API calls
  2. Fresh for Orders: Always fetch fresh rates before creating orders
  3. Validate Limits: Check min/max amounts before allowing trades
  4. Include Fees: Factor withdrawal fees into total cost calculations
  5. Handle Errors: Gracefully handle rate unavailability

Error Responses

400 Bad Request

Returned for invalid request parameters.

Example:

{
"detail": "Invalid input"
}

404 Not Found

Returned when no pairs match the specified filters or no pairs are available.

Example:

{
"detail": "No trading pairs found"
}

Next Steps