# Metastreams API > Real-time and historical spot market data: tokens, OHLCV candles, trades, discovery boards and live streams. - [Introduction](https://docs.metastreams.io/index.md): Spot market data for Solana, BNB Smart Chain, Robinhood Chain and Elysium: tokens, candles, trades, discovery boards and live streams. - [Get an API key](https://docs.metastreams.io/get-started/api-keys.md): Request an API key, keep it secure, and rotate or revoke it. - [Quickstart](https://docs.metastreams.io/get-started/quickstart.md): Make your first REST request and open your first stream in a few minutes. - [Authentication](https://docs.metastreams.io/get-started/authentication.md): Authenticate REST requests and stream connections with an API key, or with a session token from a browser. - [Response format](https://docs.metastreams.io/concepts/reading-responses.md): Conventions for field names, timestamps, prices, decimals and percentages. - [Chains](https://docs.metastreams.io/concepts/chains.md): Supported chain slugs, address formats and native units. - [Errors and rate limits](https://docs.metastreams.io/concepts/errors.md): Error format, error codes, rate and connection limits, and retry guidance. - [WebSocket streams](https://docs.metastreams.io/streams/overview.md): Open a WebSocket connection, subscribe to channels, and reconnect after the connection closes. - [Filtering streams](https://docs.metastreams.io/streams/filters.md): How spot.tokens, spot.trades, spot.transfers and spot.candles filters combine keys, lists and ranges, and how filters count against address limits. - [Build a token page](https://docs.metastreams.io/recipes/token-page.md): Build a token page that shows price, stats, holders, security and live trades, and keep it current with streams. - [Render a live chart](https://docs.metastreams.io/recipes/live-chart.md): Load candle history, then keep the latest candle updated with the candles stream. - [Build a discovery board](https://docs.metastreams.io/recipes/discovery-board.md): Build a board that shows new, graduating and graduated launchpad tokens in three filtered, ranked columns. - [Rust SDK](https://docs.metastreams.io/sdks/rust.md): A typed Rust client for every REST endpoint and for the WebSocket stream. - [Glossary](https://docs.metastreams.io/resources/glossary.md): Definitions of wallet classifications, holder groups, launchpad terms and market terms. - [Changelog](https://docs.metastreams.io/resources/changelog.md): API changes, listed newest first. - [Support](https://docs.metastreams.io/resources/support.md): How to contact support and what details to include. - [Tokens](https://docs.metastreams.io/reference/rest/token-details.md): Returns the price, market cap, liquidity, trailing stats, holders, security and launch data of up to 100 tokens. - [OHLCV candles](https://docs.metastreams.io/reference/rest/token-ohlcv.md): Returns OHLCV candles for up to 10 tokens at any timeframe, by price or by market cap. - [Trades](https://docs.metastreams.io/reference/rest/trades.md): Returns recent trades, newest first, for a set of tokens, a set of wallets, or a feed of notable wallets. - [Holders](https://docs.metastreams.io/reference/rest/token-holders.md): Returns the current holders of up to 10 tokens, largest balance first, with each wallet's trading figures on the token. - [Discovery boards](https://docs.metastreams.io/reference/rest/discovery.md): Returns launchpad tokens ranked by launch stage, across one or more chains, in a single request. - [Balances](https://docs.metastreams.io/reference/rest/wallet-balances.md): Returns the latest balance of each wallet and asset, across one or more chains. - [Portfolio](https://docs.metastreams.io/reference/rest/portfolio.md): Returns the summed spot holdings of up to 100 wallets, per chain, with each wallet's share and optional PnL stats. - [Positions](https://docs.metastreams.io/reference/rest/positions.md): Returns the spot positions of one or more wallets, with cost basis and PnL. - [Native prices](https://docs.metastreams.io/reference/rest/native-prices.md): Returns the latest USD price of each chain's gas asset. - [Trending](https://docs.metastreams.io/reference/rest/trending.md): Returns tokens ranked by trending score across one or more chains. - [Session tokens](https://docs.metastreams.io/reference/rest/session-tokens.md): Creates a short-lived credential that a browser sends instead of an API key. - [Stream connect](https://docs.metastreams.io/reference/rest/stream-connect.md): Returns a direct WebSocket URL and a short-lived token that opens connections there. - [The latest balance of each named wallet, per chain and asset.](https://docs.metastreams.io/api-reference/wallets/the-latest-balance-of-each-named-wallet-per-chain-and-asset.md): `wallets` names 1 to 100 addresses. Each costs one credit. `chains` narrows the scope, and every spot chain is read when it is absent. Each row holds the balance after the last transaction that moved it. A few movements write no row, such as Solana rent, so a balance can lag until the next one. Each… - [The summed spot holdings of the named wallets, per chain, with each wallet's share.](https://docs.metastreams.io/api-reference/wallets/the-summed-spot-holdings-of-the-named-wallets-per-chain-with-each-wallets-share.md): `wallets` names 1 to 100 addresses. Each costs one credit. An EVM address counts on every EVM chain in scope, and a Solana address on Solana. `chains` narrows the scope, and without it the read covers every spot chain. A value is the gas and stablecoin balances plus the open positions at each token'… - [One page of the named wallets' spot positions.](https://docs.metastreams.io/api-reference/wallets/one-page-of-the-named-wallets-spot-positions.md): `wallets` names 1 to 100 addresses. Each costs one credit. `lifecycle` picks open or closed positions, and `chain` with `token` narrows the page to one token. Values and PnL use each token's latest price. The cost basis is the average cost of the tokens held. A token that arrives without a buy costs… - [The discovery boards.](https://docs.metastreams.io/api-reference/discovery/the-discovery-boards.md): One request names the chains and the columns it wants. Each column is ranked and filtered on its own, and answers with its whole ranked set. - [Each named token's current holders, largest balance first, optionally narrowed to wallet classifications.](https://docs.metastreams.io/api-reference/tokens/each-named-tokens-current-holders-largest-balance-first-optionally-narrowed-to-walletclassifications.md): `tokens` names 1 to 10 addresses, and each costs one credit. A token reads on every chain in scope of its address family. Each chain that holds it answers one series, and a token no chain in scope holds answers none. Pools and lockers rank here and carry their flag. `holderCount` stays the token's t… - [Token details for each named token.](https://docs.metastreams.io/api-reference/tokens/token-details-for-each-named-token.md): `tokens` names 1 to 100 addresses, and each costs one credit. A token reads on every chain in scope of its address family. Each chain that holds it answers one object, and a token no chain in scope holds answers none. One object holds the token's identity, launch, price, market cap and liquidity. It… - [The newest USD price of each chain's gas asset: SOL, ETH or BNB.](https://docs.metastreams.io/api-reference/prices/the-newest-usd-price-of-each-chains-gas-asset:-sol-eth-or-bnb.md): `chains` narrows the scope. Without it, the read covers every spot chain. `chain.nativePrices` streams each new price. - [OHLCV candles at one timeframe for each named token, oldest first.](https://docs.metastreams.io/api-reference/ohlcv/ohlcv-candles-at-one-timeframe-for-each-named-token-oldest-first.md): `tokens` names 1 to 10 addresses, and each costs one credit. A token reads on every chain in scope of its address family. Each chain where it has candles in the window answers one series, and a token with none answers no series. `countBack` asks for a bar count and supersedes `from`. `to` and `timef… - [Assets matching a text query.](https://docs.metastreams.io/api-reference/search/assets-matching-a-text-query.md): Token hits rank by relevance. A `sortBy` attribute orders the whole candidate set instead. A text finds a token by its symbol or name. It finds no token whose liquidity is under 1,000 USD or whose market cap is over 100 billion USD. A pasted token or pool address finds that token alone, at any size. - [Mint a session token for a browser or app user.](https://docs.metastreams.io/api-reference/sessiontokens/mint-a-session-token-for-a-browser-or-app-user.md): A backend calls this with its API key, once per signed-in user, and hands the token to the page. The page then calls the API directly, from the named origins, until the token expires. Nothing refreshes a token, so mint the next one before the current one expires. A token spends its key's credits wit… - [Issue a direct stream URL and a connect token.](https://docs.metastreams.io/api-reference/stream/issue-a-direct-stream-url-and-a-connect-token.md): Spec: `metastreams/docs/standards/api-conventions.md#the-direct-stream`. - [Recent trades, newest first: the named tokens', the named wallets', or a notable identity's.](https://docs.metastreams.io/api-reference/trades/recent-trades-newest-first:-the-named-tokens-the-named-wallets-or-a-notable-identitys.md): Name `tokens` (1 to 10), `wallets` (1 to 100) or both, or name `identity` alone. Each named token and wallet costs one credit, and an `identity` read costs one. An address reads on every chain in scope of its address family. `tokens` and `wallets` together keep the named wallets' trades on the named… - [Trade history under any `spot.trades` filter, newest first or ranked by a value.](https://docs.metastreams.io/api-reference/trades/trade-history-under-any-`spottrades`-filter-newest-first-or-ranked-by-a-value.md): `stream-protocol.md`, "The same filter over history", states each read's window. A page can be short, or empty, while `hasMore` is true. Page with `cursor` until `hasMore` is false. - [The trending board.](https://docs.metastreams.io/api-reference/trending/the-trending-board.md): One request names the chains, the window and the filters. The tokens rank by the trending score over every chain as one set, and the board answers whole. - [spot.trades](https://docs.metastreams.io/reference/streams/spot-trades.md): Streams every trade that matches a filter on token, wallet, pool, venue, trader or size. - [spot.transfers](https://docs.metastreams.io/reference/streams/spot-transfers.md): Streams every wallet-to-wallet transfer that matches a filter on token, wallet, sender, recipient or amount. - [spot.candles](https://docs.metastreams.io/reference/streams/spot-candles.md): Streams candle buckets that match a filter on chain, token, pool, timeframe, volume or price change. - [spot.tokens](https://docs.metastreams.io/reference/streams/spot-tokens.md): Streams every token that matches a filter each time it changes, plus an exit when it stops matching. - [wallet.balances](https://docs.metastreams.io/reference/streams/wallet-balances.md): Streams a wallet's new balance of an asset each time a transaction changes it. - [spot.positions](https://docs.metastreams.io/reference/streams/spot-positions.md): Streams a wallet's full position in a token each time a trade or transfer changes it. - [spot.holders](https://docs.metastreams.io/reference/streams/spot-holders.md): Streams a token's holder rows each time a trade or transfer changes them. - [chain.nativePrices](https://docs.metastreams.io/reference/streams/native-prices.md): Streams the USD price of each chain's gas asset. - [spot.trending](https://docs.metastreams.io/reference/streams/spot-trending.md): Streams a trending board: the full board after subscribing, then each change. ## OpenAPI Specs - [openapi](/specs/openapi.json) ## AsyncAPI Specs - [asyncapi](/specs/asyncapi.yaml) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.