GET /api/assets/:id Get Asset
Returns a single asset by its MongoDB document ID or its ticker symbol. When the symbol matches an FX pair (e.g. EURUSD) and no Asset record exists, the endpoint falls back to a synthesised row from rate data — see Polymorphic FX fallback.
Request
# By symbol
curl https://api.bytetree.io/api/assets/AAPL
# By MongoDB ID
curl https://api.bytetree.io/api/assets/66f1a2b3c4d5e6f7a8b9c0d1
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | MongoDB document ID or ticker symbol (case-insensitive) |
Response
| Field | Type | Description |
|---|---|---|
data | object | The asset document |
The asset object has the same fields as entries in List Assets.
{
"data": {
"_id": "66f1a2b3c4d5e6f7a8b9c0d1",
"symbol": "AAPL",
"name": "Apple Inc.",
"isin": "US0378331005",
"type": "stock",
"status": "active",
"sector": "Technology",
"industry": "Consumer Electronics",
"country": "US",
"region": "North America",
"currency": "USD",
"mktCap": 3900000000000
}
}
Polymorphic FX fallback
If the lookup :id is a valid FX pair symbol (e.g. EURUSD, GBPJPY) and no Asset document exists for it, the endpoint returns a synthesised row built from rate data. The shape matches a standard asset record, with asset-only fields (isin, sector, industry, country, region, mktCap, mktCapUsd) null and name rendered in slash form (e.g. "EUR/USD"). MongoDB-ID lookups are not synthesised — only symbol lookups trigger fallback.
For FX-only consumers, GET /api/fx/:symbol is the canonical zero-ambiguity surface. This endpoint’s fallback exists for polymorphic callers that resolve mixed asset types through a single path.
Errors
| Status | Description |
|---|---|
404 | Asset not found and the symbol does not match a known FX pair |