Get currency rate
Method POST
https://fast-pay.top/api/currency-rate
Headers
Accept | application/json |
Content-Type | application/json |
Request parameters
api_id | int | API ID |
api_key | string | API key |
coin | string | TRX or USDT or USDC |
PHP EXAMPLE
include('FastPayApi.php');
$apiId = 583;
$apiKey = 'nSqjryEhvZMy8DlgCaYdVPoHyRJxgxWN';
$coin = 'TRX';
$fastPayApi = new FastPayApi();
$fastPayApi->setApiId($apiId);
$fastPayApi->setApiKey($apiKey);
$response = $fastPayApi->getCurrencyRate($coin);
$data = json_decode ($response, true);
if ($data['status'] === 'success') {
$rate_usd = $data['data']['usd']; // USD
$rate_uah = $data['data']['uah']; // UAH
$rate_rub = $data['data']['rub']; // RUB
}
$apiId = 583;
$apiKey = 'nSqjryEhvZMy8DlgCaYdVPoHyRJxgxWN';
$coin = 'TRX';
$fastPayApi = new FastPayApi();
$fastPayApi->setApiId($apiId);
$fastPayApi->setApiKey($apiKey);
$response = $fastPayApi->getCurrencyRate($coin);
$data = json_decode ($response, true);
if ($data['status'] === 'success') {
$rate_usd = $data['data']['usd']; // USD
$rate_uah = $data['data']['uah']; // UAH
$rate_rub = $data['data']['rub']; // RUB
}
Success JSON Response:
{
"status": "success",
"data": {
"usd": "0.0871",
"uah": "3.2000",
"rub": "7.8800"
}
}
Error JSON Response:
{
"status": "error",
"errors": {
"error": "User not found!"
}
}