Skip to Content
Supported ChainLinea

Linea API

Access Linea via the Spectrum unified API. Linea is a ConsenSys zkEVM Layer 2 that provides low gas fees with the security of zero-knowledge proofs on Ethereum.

Properties

PropertyValue
Sluglinea
TypeEVM L2 (zkEVM)
Native TokenETH
Chain ID59144

Available Methods

MethodDescription
getBlockHeightLatest Linea 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
getChainHealthLinea RPC health check

Quick Start

Get the latest Linea 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": "linea"
  },
  "id": 1
}

Get Balance

Retrieve the ETH balance for a wallet address on Linea:

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": "linea",
    "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('linea'); console.log(block.height); // Get ETH balance on Linea const balance = await spectrum.tokens.getBalance('linea', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'); console.log(balance.balance);