Indexing / Data·EVM · Solana · Multi-chain
Moralis
Enterprise-grade Web3 data APIs with token, NFT, wallet, DeFi, and price endpoints across 30+ chains, plus Streams for real-time webhook indexing.
- 01wallet portfolios
- 02token and NFT metadata
- 03DeFi positions
- 04real-time webhooks via Streams
- 05EVM + Solana coverage from one provider
- pnpm add moralis @moralisweb3/common-evm-utils
| Variable | Scope | Description |
|---|---|---|
| MORALIS_API_KEY | Server | Moralis API key from the Moralis admin dashboard. Server-only. |
Use Moralis for indexed onchain data. Server-side, call `await Moralis.start({ apiKey: process.env.MORALIS_API_KEY })` once at boot, then use `Moralis.EvmApi.wallets.getWalletTokenBalances({ address, chain })`, `Moralis.EvmApi.nft.getWalletNFTs(...)`, and `Moralis.EvmApi.token.getTokenPrice(...)`. For raw REST, hit `https://deep-index.moralis.io/api/v2.2/{path}` with header `X-API-Key: $MORALIS_API_KEY`. For real-time monitoring, create a Stream against your contract/address and point its webhook at a route that verifies the `x-signature` header before processing.
- ⚑Never expose `MORALIS_API_KEY` in the browser bundle — proxy through a Next.js API route or server action.
- ⚑Streams free tier caps you at 20 streams; webhook success rate must stay above 70% or the stream is auto-disabled.
- ⚑Billing is in Compute Units (CUs), not flat req/sec — heavy endpoints like `getWalletNFTs` with metadata burn far more CUs than balance reads.
- ⚑Solana coverage uses a separate `Moralis.SolApi` namespace and supports a smaller endpoint set than EVM — don't assume parity.
- ⚑Always verify Stream webhooks with the provided signature; never trust the payload by IP allowlist alone.