Skip to main content

Price API Reference

Complete reference for the Price API endpoints. Fetch token prices, currencies, currency exchange rates, and fiat quotes.

Base URL

https://api.orcarail.com/api/v1

Token Price

Get Token Price

Get the latest USD price for a token by token ID.

GET /price/token/:tokenId

Path Parameters

ParameterTypeRequiredDescription
tokenIdstringYesToken ID (UUID)

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"tokenId": "550e8400-e29b-41d4-a716-446655440001",
"priceUsd": "2500.00",
"source": "coingecko",
"createdAt": "2024-01-01T00:00:00.000Z"
}

Returns null if no price is available for the token.

Response Fields

FieldTypeDescription
idstringPrice record ID (UUID)
tokenIdstringToken ID (UUID)
priceUsdstringPrice in USD
sourcestringPrice source (e.g., coingecko, manual)
createdAtstringISO 8601 timestamp

Currencies

List Currencies

List supported fiat/display currencies.

GET /price/currencies

Query Parameters

ParameterTypeRequiredDescription
activestringNoSet to true to return only active currencies

Response

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "USD",
"name": "US Dollar",
"symbol": "$",
"decimals": 2,
"isActive": true,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
]

Currency Rate

Get Currency Rate

Get the latest exchange rate between two currencies (base and quote).

GET /price/currency-rate/:baseId/:quoteId

Path Parameters

ParameterTypeRequiredDescription
baseIdstringYesBase currency ID (UUID)
quoteIdstringYesQuote currency ID (UUID)

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"baseCurrencyId": "550e8400-e29b-41d4-a716-446655440001",
"quoteCurrencyId": "550e8400-e29b-41d4-a716-446655440002",
"rate": "590000.00",
"source": "manual",
"createdAt": "2024-01-01T00:00:00.000Z"
}

Returns null if no rate is available for the pair.

Response Fields

FieldTypeDescription
idstringRate record ID (UUID)
baseCurrencyIdstringBase currency ID (UUID)
quoteCurrencyIdstringQuote currency ID (UUID)
ratestringExchange rate (1 base = rate quote)
sourcestringRate source (e.g., manual)
createdAtstringISO 8601 timestamp

Fiat Quote

Get Fiat Quote

Get a fiat-to-USD/USDC quote. Optionally get the equivalent amount in a specific token.

GET /price/fiat-quote

Query Parameters

ParameterTypeRequiredDescription
amountstringYesAmount in source currency (e.g., 100000)
currencystringYesSource currency code (e.g., irr, usd)
tokenIdstringNoToken ID (UUID) to get amount in that token

Response

{
"amountUsd": "2.38",
"amountUsdc": "2.38",
"sourceAmount": "100000",
"sourceCurrency": "irr",
"currencyRateId": "550e8400-e29b-41d4-a716-446655440000",
"tokenAmount": "0.00052",
"tokenSymbol": "ETH"
}

When tokenId is not provided, tokenAmount and tokenSymbol are omitted. When the source currency is USD, currencyRateId may be null.

Response Fields

FieldTypeDescription
amountUsdstringAmount in USD
amountUsdcstringAmount in USDC (same as USD for stablecoin)
sourceAmountstringOriginal amount in source currency
sourceCurrencystringSource currency code
currencyRateIdstring | nullCurrency rate ID used for conversion (null when USD)
tokenAmountstringOptional. Amount in selected token (when tokenId given)
tokenSymbolstringOptional. Symbol of selected token (when tokenId given)

Status Codes

Status CodeDescription
200Success
404Not Found (e.g., no price or rate for the given IDs)
500Internal Server Error

See Also