# Balances · HyperCore API · Femtos

> Every token an address holds on HyperCore, with USD value and the block it is read at.

- Base URL: `https://api.femtos.xyz/v1` (REST) · `wss://api.femtos.xyz/v1/ws` (WebSocket) · MCP: `https://api.femtos.xyz/mcp`
- Auth: `Authorization: Bearer $FEMTOS_KEY`. Free key: https://femtos.xyz/accounts/ (browser), or with
  no browser: `GET https://femtos.xyz/accounts/agent/challenge`, solve its proof of work, then `POST https://femtos.xyz/accounts/agent/signup`
  (https://femtos.xyz/agents.md#agent-onboarding)
- Decimals are exact strings, times Unix milliseconds, addresses lowercase `0x`
- Whole API in one file: https://femtos.xyz/agents.md · OpenAPI: https://api.femtos.xyz/v1/openapi.json · Index: https://femtos.xyz/llms.txt
- Page with live calls: https://femtos.xyz/hypercore/balances

## Balances — GET `/v1/balances/{address}`

Every token an address holds on HyperCore, with USD value and the block it is read at.

| Param | In | Example or values | Meaning |
|---|---|---|---|
| `address` | path | `<address>` | 0x address, or a named wallet's handle `<entityId>.<hex>` |
| `layer` | query | `hypercore` | Layer(s) read |
| `minUsd` | query | (optional) | Leave out holdings worth less (and unpriced ones) |
| `sort` | query | `(empty)`, `usd`, `amount` | Order |
| `tokens` | query | (optional) | Comma list (at most 50; 20 with block / at): EVM token addresses (`native` = HYPE) and HyperCore coin names; every token asked is listed, held or not (0) |
| `includeSpam` | query | `(empty)`, `true` | List spam tokens (flagged spam / spamReason); never in the totals |
| `block` | query | (optional) | Past balances at this block (one layer; EVM: tokens= required; HyperCore: the snapshot at or before this height) |
| `at` | query | (optional) | Past balances at this time (Unix ms): the last block at or before it |

```bash
curl -H "Authorization: Bearer $FEMTOS_KEY" "https://api.femtos.xyz/v1/balances/<address>?layer=hypercore"
```

| Field | Type | Meaning |
|---|---|---|
| `address` | string | The address: 0x address, or a named wallet's handle |
| `layer` | hypercore \| hyperevm \| elysium \| all | Layer(s) read |
| `balances[]` | object | Holdings, largest USD first (sort=amount: largest amount); spam left out unless includeSpam: {layer, kind, asset, symbol, name, decimals, raw, amount, priceUsd, priceSource, usd, spam, …} |
| `count` | int | Rows listed |
| `total` | int | Rows matching before `limit` |
| `totalUsd` | decimal \| null | USD of every holding (spam never counts; tokens= narrows it, minUsd and limit do not) + HyperCore perp account values; Elysium testnet not valued; null on a past read |
| `totalUsdComplete` | boolean | Every holding had a price and every layer asked answered |
| `perp` | object \| null | HyperCore perp accounts (layer hypercore / all): kept apart from the token rows; null with tokens= or a past read: {dex, collateral, accountValue, withdrawable, totalMarginUsed, totalNtlPos, positions, usd, dexes, totalUsd, abstraction, inSpot} |
| `layers.<layer>` | object | Per layer asked: source, height, asOf (provenance), usd, count, verify: {source, height, asOf, network, chainId, testnet, syncing, dataUntil, requested, usd, usdComplete, count, …} |
| `includeSpam` | boolean | Spam tokens listed (the includeSpam asked) |
| `spamHidden` | int | Spam holdings left out |
| `entity` | object | Named wallet (labels), when known |

## Related (Balances)

- [Token balance](https://femtos.xyz/hypercore/token-balance.md): One token of one address on HyperCore: 0 when not held, now or at a past block.
- [Batch balances](https://femtos.xyz/hypercore/batch-balances.md): Up to 100 addresses on HyperCore in one call, the same answer for each.
- [Balances, all layers](https://femtos.xyz/hypercore/balances-all.md): One address on HyperCore, HyperEVM and Elysium in one list, with totals per layer.

All HyperCore endpoints: https://femtos.xyz/hypercore.md
