NodeRailsCRYPTO PAYMENT INFRASTRUCTURE
DocumentationAPI Reference
Dashboard

Prices

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


Convert currency

GET/prices/convert

Convert between fiat and a cryptocurrency token amount. Provide either amountFiat (fiat → crypto) or tokenAmount (crypto → fiat).

Query parameters

ParameterTypeRequiredDescription
symbolstringYesToken symbol (e.g. "ETH", "USDC")
currencystringNoFiat currency code (default: "USD")
amountFiatnumberOne ofFiat amount to convert to crypto
tokenAmountnumberOne ofToken amount to convert to USD
💡

One of two

Provide either amountFiat or tokenAmount, not both. The API will calculate the other direction. amountUsd is still accepted for backward compatibility.
Fiat to cryptotypescript
const result = await noderails.prices.convert({
  symbol: 'ETH',
      currency: 'USD',
      amountFiat: 100,
});

console.log(result.tokenAmount); // "0.0421"
    console.log(result.priceFiat);   // "2374.12"
    console.log(result.currency);    // "USD"
Crypto to USDtypescript
const result = await noderails.prices.convert({
  symbol: 'ETH',
  currency: 'USD',
  tokenAmount: 1,
});

console.log(result.amountFiat); // "2374.12"
console.log(result.priceFiat);  // "2374.12"
console.log(result.currency);   // "USD"
cURLbash
# USD to ETH
      curl "https://api.noderails.com/prices/convert?symbol=ETH&currency=USD&amountFiat=100"

# 1 ETH to USD
      curl "https://api.noderails.com/prices/convert?symbol=ETH&currency=USD&tokenAmount=1"

Response

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

Convert response fields

symbolstringToken symbol (e.g. ETH, USDC)
currencystringFiat currency for conversion (e.g. USD, EUR)
priceFiatstringCurrent token price in the selected fiat currency
cachedAtstringISO 8601 timestamp when the price was cached
amountFiatstringFiat amount (input or computed, 8-decimal string when computed)
tokenAmountstringToken amount (input or computed, 18-decimal string when computed)

Get token price

GET/prices/:symbol

Returns the current price of a token in the requested fiat currency (default: USD).

SDK exampletypescript
const price = await noderails.prices.getPrice('ETH', 'EUR');
console.log(price.priceFiat); // "2190.44"
console.log(price.currency);  // "EUR"
cURLbash
curl "https://api.noderails.com/prices/ETH?currency=EUR"

Response

Price responsejson
{
  "success": true,
  "data": {
    "symbol": "ETH",
    "currency": "EUR",
    "priceFiat": "2190.44",
    "cachedAt": "2025-01-15T10:30:00.000Z"
  }
}

Get price response fields

symbolstringToken symbol
currencystringFiat currency for the quote
priceFiatstringCurrent price in the selected fiat currency
cachedAtstringISO 8601 timestamp when the price was last fetched