Skip to main content
POST
/
onramp
/
rate
Get rate
curl --request POST \
  --url https://api.onswitch.xyz/onramp/rate \
  --header 'Content-Type: application/json' \
  --header 'x-service-key: <api-key>' \
  --data '
{
  "asset": "base:usdc",
  "country": "NG",
  "currency": "NGN"
}
'
{
  "success": true,
  "message": "Onramp rate fetched successfully",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "data": {
    "rate": 1500.5
  }
}

Authorizations

x-service-key
string
header
required

Service key for API authentication

Body

application/json
country
string
required

ISO 3166-1 alpha-2 country code

asset
enum<string>

Optional asset code. If not specified, defaults to base:usdc.

Available options:
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
currency
string

Optional currency code. If not specified, defaults to the country's local currency.

channel
enum<string>

Optional transfer channel

Available options:
BANK,
BLOCKCHAIN,
SWIFT,
SEPA,
SEPA_EUR,
WIRE,
ACH,
DOMESTIC_GBP,
MOBILEMONEY,
ALIPAY,
WECHATPAY

Response

Successfully retrieved onramp rate

success
boolean
required
message
string
required
timestamp
string<date-time>
required
data
any | null
required

Response data