Swap Rate
This endpoint allows you to fetch real-time swap rates for cryptocurrency pairs supported by OxaPay. It’s ideal for applications that need the latest cryptocurrency prices to ensure accurate and timely calculations.
POST
https://api.oxapay.com/v1/general/swap/rate
Authentication
You must include the General API Key in the request header to authenticate your access to the API.
general_api_key*
string
Your General API Key for authentication and authorization.
Request Body
from_currency*
string
to_currency*
string
{
"data": {
"rate": "decimal", // The swap rate between the "from_currency" and "to_currency" at the time of the request (e.g., 1 BTC = 94763.06000000 USDT).
},
"message": string, // A message containing additional information about the result of the request.
"error": {
"type": string,
"key": string,
"message": string
} || {}, // An object that provides details about any errors that occurred.
"status": integer, // The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors).
"version": string // The version of the API being used.
}
Please note that a successful request will return status 200. In case of any issues or validation problems, refer to the corresponding error for further details.
API Request Sample Codes
curl -X POST https://api.oxapay.com/v1/general/swap/rate \
-H "general_api_key: YOUR_GENERAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from_currency": "USDT",
"to_currency": "TRX"
}'
These example code snippets demonstrate how to request the "Swap Rate" endpoint using different programming languages. You can customize the data parameters according to your specific requirements.
API Response Example
{
"data": {
"rate": 94763.06000000
},
"message": "Operation completed successfully!",
"error": {},
"status": 200,
"version": "1.0.0"
}
The response example above is provided to help you understand the format and structure of the response. If you have any further questions or need assistance, please feel free to contact to your account manager.
Last updated