NodeRailsCRYPTO PAYMENT INFRASTRUCTURE
DocumentationAPI Reference
Dashboard

Prices

The Prices API provides real-time cryptocurrency price data and conversion between fiat and crypto amounts. Prices are sourced via the BPC service. This is a public API, no authentication required.


Get price or convert

GET/prices

Unified endpoint for spot prices and fiat↔token conversion. Pass asset as a tokenKey (preferred, e.g. SUI-202, USDC-137), a symbol (e.g. ETH), or contract-chain (e.g. 0xa0b8...-1).

Query parameters

ParameterTypeRequiredDescription
assetstringYesToken key, symbol, or contract-chain identifier
currencystringNoFiat currency code (default: "USD"). Supports USD and EUR.
amountFiatnumberNoFiat amount to convert to crypto
tokenAmountnumberNoToken amount to convert to fiat
💡

Conversion

Omit amountFiat and tokenAmount for a spot price only. Provide one of them for conversion in the corresponding direction.
Spot price by tokenKeytypescript
const result = await fetch(
  'https://api.noderails.com/prices?asset=SUI-202&currency=USD'
).then((r) => r.json());

console.log(result.data.priceFiat); // spot price in USD
Fiat to token (checkout)typescript
const result = await fetch(
  'https://api.noderails.com/prices?asset=USDC-137&currency=USD&amountFiat=100'
).then((r) => r.json());

console.log(result.data.tokenAmount); // crypto amount for $100
cURLbash
# Spot price
curl "https://api.noderails.com/prices?asset=SUI-202&currency=USD"

# Fiat → token
curl "https://api.noderails.com/prices?asset=USDC-137&currency=EUR&amountFiat=50"

Response

Convert response (fiat → crypto)json
{
  "success": true,
  "data": {
    "asset": "USDC-137",
    "symbol": "USDC",
    "currency": "USD",
    "priceFiat": 1,
    "cachedAt": "2025-01-15T10:30:00.000Z",
    "amountFiat": 100,
    "tokenAmount": "100.000000000000000000"
  }
}

Response fields

assetstringResolved asset identifier
symbolstringToken symbol (e.g. ETH, USDC)
currencystringFiat currency for the quote
priceFiatnumberCurrent token price in the selected fiat currency
cachedAtstringISO 8601 timestamp when the price was cached
amountFiatnumberFiat amount (when converting)
tokenAmountstringToken amount (when converting)

Wallet balance

GET/balance

Returns on-chain wallet balance for a token on a supported chain. Balances are fetched via BPC — no direct chain RPC from the browser is required.

Query parameters

ParameterTypeRequiredDescription
chainIdnumberYesNodeRails chain ID
addressstringYesWallet address (EVM hex, Solana base58, Sui address)
tokenstringNonative, contract/mint address, or Sui coin type
tokenKeystringNoResolve token from registry when token is omitted
includePricebooleanNoAttach fiat value (true / false)
currencystringNoFiat currency for value (default: USD)
cURLbash
# Sui testnet USDC balance
curl "https://api.noderails.com/balance?chainId=202&address=0x...&token=0x6246...::sui_usdc::SUI_USDC"

# EVM native ETH
curl "https://api.noderails.com/balance?chainId=1&address=0x...&token=native&includePrice=true&currency=USD"

Batch balances

POST/balance/batch

Fetch up to 50 wallet balances in one request.

Request bodyjson
{
  "includePrice": true,
  "currency": "USD",
  "items": [
    { "chainId": 1, "address": "0x...", "token": "native" },
    { "chainId": 137, "address": "0x...", "tokenKey": "USDC-137" }
  ]
}