curl --request POST \
--url https://api.onswitch.xyz/offramp/rate \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"asset": "base:usdc",
"country": "NG",
"currency": "NGN"
}
'{
"success": true,
"message": "Offramp rate fetched successfully",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"rate": 1500.5
}
}Get the current exchange rate for an offramp transaction.
curl --request POST \
--url https://api.onswitch.xyz/offramp/rate \
--header 'Content-Type: application/json' \
--header 'x-service-key: <api-key>' \
--data '
{
"asset": "base:usdc",
"country": "NG",
"currency": "NGN"
}
'{
"success": true,
"message": "Offramp rate fetched successfully",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"rate": 1500.5
}
}Service key for API authentication
ISO 3166-1 alpha-2 country code
Optional asset code. If not specified, defaults to base:usdc.
base:usdc, solana:usdc, solana:usdt, ethereum:usdc, ethereum:usdt, polygon:usdc, polygon:usdt, bsc:usdc, bsc:usdt, arbitrum:usdc, optimism:usdc, gnosis:usdc, gnosis:usdt, arbitrum:usdt, avalanche:usdc, monad:usdc, optimism:usdt, monad:usdt, plasma:usdt, avalanche:usdt, tron:usdt, linea:usdt, mantle:usdt, hyperevm:usdt, berachain:usdt, linea:usdc, berachain:usdc, sonic:usdc, base:cngn, bsc:cngn Optional currency code. If not specified, defaults to the country's local currency.
Optional transfer channel
BANK, BLOCKCHAIN, SWIFT, SEPA, SEPA_EUR, WIRE, ACH, DOMESTIC_GBP, MOBILEMONEY, ALIPAY, WECHATPAY