Price one symbol, strictly

GET/prices/{asset_symbol}

A browser reads it with the environment's publishable key alone (the gateway, preview).

Return the USD price of one symbol, as the AssetPrice itself.

  • This read is strict where the batch is forgiving, and the difference is deliberate.

    The batch answers null for anything it cannot price, because a screen full of balances must survive one dead asset. A caller asking about a SINGLE symbol wants the opposite: it wants to know which of two different things happened, so the two are answered apart.

    • 404 resource_missing means the symbol is outside Stridge's asset registry. Nothing

    here will ever price it, and a client should stop asking.

    • 503 price_unavailable means the symbol IS in the registry and Stridge cannot price it

    right now. The upstream failed, and asking again later is reasonable.

    Collapsing those into one answer would leave a client unable to tell a typo from an outage.

Path parameters

  • asset_symbolstringrequired

    The symbol to price. Normalised to upper case, so btc and BTC reach the same asset.

Responses

The symbol and its price.

  • objectstringrequired

    The object's type, always asset_price.

  • asset_symbolstringrequired

    The asset's ticker, normalised to upper case. A price is per SYMBOL and not per chain: the same asset is worth the same wherever it is deployed, which is why this family is keyed differently from the network catalogue.

  • usd_pricestring | nullrequired

    The price in USD as an exact decimal string, never a JSON number, or null when Stridge cannot currently price the asset. A client renders the absence rather than a zero: 0 is a price, and showing one for an asset nobody could value would be a lie a person acts on.

Errors

The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.

Request
curl "https://api.stridge.com/v2/prices/string" \
  -H "Authorization: Bearer $STRIDGE_SECRET_KEY"

Set your secret key as STRIDGE_SECRET_KEY (sent as Authorization: Bearer).

Response200
"object": "asset_price",
"asset_symbol": "BTC",
"usd_price": "63085.06"
}