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
Header parameters
general_api_keystringRequired
Your General API Key for authentication and authorization.
Content-TypestringRequiredDefault:
application/json
Body
from_currencystringRequiredExample:
Specify the currency symbol you want to swap from.
BTC
to_currencystringRequiredExample:
Specify the currency symbol you want to swap to.
USDT
Responses
200
Successful operation
application/json
400
Bad request
application/json
post
import requests
import json
url = 'https://api.oxapay.com/v1/general/swap/rate'
data = {
"from_currency": "USDT",
"to_currency": "TRX"
}
headers = {
'general_api_key': 'YOUR_GENERAL_API_KEY',
'Content-Type': 'application/json'
}
response = requests.post(url, data=json.dumps(data), headers=headers)
result = response.json()
print(result)
{
"data": {
"rate": 94763.06
},
"message": "Operation completed successfully!",
"error": {},
"status": 200,
"version": "1.0.0"
}
Last updated