Skip to Content
Supported ChainBase

Base API

Access Base via the Spectrum unified API. Base is Coinbase’s OP Stack L2, designed for low-cost and high-speed transactions with the security of Ethereum.

Properties

PropertyValue
Slugbase
TypeEVM L2
Native TokenETH
Chain ID8453

Available Methods

MethodDescription
getBlockHeightLatest Base block number
getBalanceETH balance for a wallet
getTokenBalanceERC-20 token balance
getTokenMetadataERC-20 token info
getTokenAllowanceToken spending allowance
getPortfolioFull portfolio with USD values
getNftCollectionNFT holdings for a wallet
getBlockTransactionsTransactions in a block
estimateGasGas estimation for a transaction
traceTransactionInternal call trace
getHistoricalBalanceBalance at a historical block
getCodeContract bytecode check
simulateCallSimulate a contract call
rpcProxyRaw JSON-RPC passthrough
getChainHealthBase RPC health check

Quick Start

Get the latest Base block height:

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
{
  "jsonrpc": "2.0",
  "method": "getBlockHeight",
  "params": {
    "chain": "base"
  },
  "id": 1
}

Get Balance

Retrieve the ETH balance for a wallet address on Base:

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
{
  "jsonrpc": "2.0",
  "method": "getBalance",
  "params": {
    "chain": "base",
    "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
  },
  "id": 1
}

Get Gas

Compare current gas prices across chains:

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
{
  "jsonrpc": "2.0",
  "method": "compareGas",
  "params": {},
  "id": 1
}

SDK

import { Spectrum } from '@spectrum-nodes/sdk'; const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' }); // Get latest block height const block = await spectrum.core.getBlockHeight('base'); console.log(block.height); // Get ETH balance on Base const balance = await spectrum.tokens.getBalance('base', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'); console.log(balance.balance);

DeFi

Base is supported by the following DeFi protocols on Spectrum:

  • Aave V3 — lending and borrowing markets
  • Compound V3 — lending and borrowing protocol
  • Morpho — lending optimizer
  • Avantis — avUSDC vault (deposit and redemption prices)
// Get Aave V3 lending yields on Base const yields = await spectrum.yields.getLending({ chain: 'base', protocol: 'aave-v3' }); // Get Compound V3 yields on Base const compound = await spectrum.yields.getLending({ chain: 'base', protocol: 'compound-v3' }); // Get Morpho yields on Base const morpho = await spectrum.yields.getLending({ chain: 'base', protocol: 'morpho' }); // Get Avantis avUSDC deposit & redemption prices const avantis = await spectrum.defi.getAvantisPrice('base', { vault: 'avUSDC' }); console.log('Deposit:', avantis.depositPrice.USD); console.log('Redemption:', avantis.redemptionPrice.USD);