← Protocols
Moralis
Indexing / Data·EVM · Solana · Multi-chain

Moralis

01Description

Enterprise-grade Web3 data APIs with token, NFT, wallet, DeFi, and price endpoints across 30+ chains, plus Streams for real-time webhook indexing.

02Best for
  • 01wallet portfolios
  • 02token and NFT metadata
  • 03DeFi positions
  • 04real-time webhooks via Streams
  • 05EVM + Solana coverage from one provider
03Install
  • pnpm add moralis @moralisweb3/common-evm-utils
04Environment variables
VariableScopeDescription
MORALIS_API_KEYServerMoralis API key from the Moralis admin dashboard. Server-only.
05Prompt snippet
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.
06Gotchas
  • 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.
07Alternatives