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:
| Parameter | Type | Required | Description |
|---|---|---|---|
pairs | string | No | Comma-separated trading pairs (e.g., "BTCUSDC,ETHBTC"). Returns all pairs if omitted |
fiat_only | boolean | No | Filter to only include fiat pairs |
crypto_only | boolean | No | Filter to only include crypto pairs |
Response
Returns an array of rate objects with simplified v2 format.
Response Fields:
| Field | Type | Description |
|---|---|---|
pair | string | Trading pair name (e.g., "BTCUSDC") |
from | string | Source currency (what you send) |
to | string | Destination currency (what you receive) |
withdrawal_fee | string | Fee for withdrawing the destination currency |
rate | string | Current exchange rate |
rate_id | string | Unique identifier for this rate quote |
max_withdraw_amount | string | Maximum amount that can be withdrawn |
min_withdraw_amount | string | Minimum amount that can be withdrawn |
max_deposit_amount | string | Maximum amount that can be deposited |
min_deposit_amount | string | Minimum amount that can be deposited |
expiration_time_unix | string | Unix 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_amount→max_withdraw_amountmin_receive_amount→min_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 pairscrypto_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_unixto ensure rate is still valid
Integration Tips
- Cache for Display: Cache rates for UI display to reduce API calls
- Fresh for Orders: Always fetch fresh rates before creating orders
- Validate Limits: Check min/max amounts before allowing trades
- Include Fees: Factor withdrawal fees into total cost calculations
- 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
- Orders - Create orders using rate information
- Trading Pairs - Learn about available pairs
- Currencies - Understand individual currencies