Base

Base is a secure, low-cost, and developer-friendly Ethereum Layer 2 blockchain built by Coinbase using the OP Stack, the same technology powering Optimism. It leverages optimistic rollup technology to deliver fast transactions at a fraction of Ethereum mainnet costs while inheriting Ethereum's security through data availability on L1.

Key Features

  • Full EVM Compatibility: Deploy Ethereum smart contracts without modification
  • OP Stack Architecture: Built on Optimism's battle-tested Bedrock release
  • 2-Second Block Time: Fast block production for responsive applications
  • Low Transaction Fees: Significantly cheaper than Ethereum mainnet
  • Ethereum Security: Inherits security from Ethereum L1 through optimistic rollups
  • Coinbase Integration: Seamless access to Coinbase ecosystem and fiat on-ramps
  • EIP-1559 Support: Dynamic fee mechanism with base fee and priority fee
  • Fraud Proof Security: Invalid state transitions can be challenged during dispute window

TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.

GetBlock's RPC API reference documentation is provided exclusively for informational purposes and streamlined developer experience optimization. The canonical and normative specification for Ethereum Virtual Machine (EVM) JSON-RPC methods is solely maintained and published through the official Ethereum Foundation documentation portal at ethereum.org. This resource constitutes the sole authoritative reference implementation of the JSON-RPC 2.0 protocol interface across EVM-compatible execution clients.

Network Information

PropertyValue
Network NameBase Mainnet
Chain ID8453
Native CurrencyETH
Block Time~2 seconds
Gas Limit25,000,000 per transaction
EVM CompatibilityFull bytecode compatibility
ConsensusOptimistic Rollup (OP Stack)
Settlement LayerEthereum L1

Base URL

https://shared.eu-central-1.getblock.io
https://shared.us-east-1.getblock.io
https://shared.ap-southeast-1.getblock.io

Supported Networks

NetworkChain IDJSON RPCWSSMEV Protected (JSON RPC)MEV Protected (WSS)Graph QLNew York, USAFrankfurt, GermanySingapore, Singapore
Mainnet8453✅✅✅✅❌✅✅✅
Sepolia84532✅✅❌❌✅✅❌❌

Quickstart

In this section, you will learn how to make your first call with either:

  • Axios
  • Python

Quickstart with Axios

  1. Set up the project

    Create a new project folder and initialize npm:

    bashmkdir base-api-quickstart
    cd base-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create the script file

    Create a file named index.js. Also set the ES module type in your package.json:

    Add "type": "module" to package.json.

  4. Add the request code

    Put the following code into index.js (replace <ACCESS-TOKEN> with your GetBlock access token):

    javascriptimport axios from 'axios';
    
    const data = JSON.stringify({
        "jsonrpc": "2.0",
        "method": "eth_blockNumber",
        "params": [],
        "id": "getblock.io"
    });
    
    const config = {
        method: 'post',
        url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    };
    
    axios(config)
        .then(response => console.log(JSON.stringify(response.data)))
        .catch(error => console.log(error));
  5. Run the script

    bashnode index.js

    The block number will log in your console similar to:

    json{
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "result": "0x2640163"
    }

Quickstart with Python and Requests

  1. Set up the project folder

    bashmkdir base-api-quickstart
    cd base-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create the script

    Create a file called main.py with the following code (replace <ACCESS-TOKEN> with your GetBlock access token):

    pythonimport requests
    import json
    
    url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"
    
    payload = json.dumps({
        "jsonrpc": "2.0",
        "method": "eth_blockNumber",
        "params": [],
        "id": "getblock.io"
    })
    
    headers = {
        'Content-Type': 'application/json'
    }
    
    response = requests.post(url, headers=headers, data=payload)
    print(response.text)
  5. Run the script

    bashpython main.py

Available API Methods

GetBlock provides access to standard Ethereum JSON-RPC methods for the Base network.

Reading Data (State Methods)

MethodDescription
eth_blockNumberReturns the current block number
eth_getBalanceReturns the balance of an address
eth_getStorageAtReturns the value at a storage position
eth_getTransactionCountReturns the transaction count (nonce)
eth_getCodeReturns the code at an address
eth_callExecutes a call without creating a transaction

Block Information

MethodDescription
eth_getBlockByHashReturns block information by hash
eth_getBlockByNumberReturns block information by number
eth_getBlockReceiptsReturns all receipts for a block
eth_getBlockTransactionCountByHashReturns transaction count by block hash
eth_getBlockTransactionCountByNumberReturns transaction count by block number

Transaction Methods

MethodDescription
eth_getTransactionByHashReturns transaction by hash
eth_getTransactionByBlockHashAndIndexReturns transaction by block hash and index
eth_getTransactionByBlockNumberAndIndexReturns transaction by block number and index
eth_getTransactionReceiptReturns the receipt of a transaction
eth_sendRawTransactionSubmits a signed transaction

Gas and Fee Estimation

MethodDescription
eth_gasPriceReturns the current gas price
eth_maxPriorityFeePerGasReturns suggested priority fee
eth_feeHistoryReturns fee history for blocks
eth_estimateGasEstimates gas for a transaction

Logs and Events

MethodDescription
eth_getLogsReturns logs matching filter criteria

Chain Information

MethodDescription
eth_chainIdReturns the chain ID
eth_syncingReturns sync status
net_versionReturns the network ID
web3_clientVersionReturns client version

Debug Methods

MethodDescription
debug_traceTransactionReturns transaction trace
debug_traceBlockByHashTraces all transactions in a block by hash
debug_traceBlockByNumberTraces block by number

Support

For technical support and questions:

See Also