Alchemy Documentation
Website
Roadmap
Dashboard
Search…
👋
Welcome to Alchemy
🚀
Introduction
Why Use Alchemy?
Getting Started
Core Products
Contributing to these Docs
Referral Program
Web3 University
✨
Enhanced APIs
NFT API
Transfers API (Tx History)
Transaction Receipts API
Token API
Parity API
Notify API
Debug API
Trace API
Subscription API (Websockets)
Unstoppable Domains APIs
⛓
Chain APIs
Ethereum API
Polygon API
Arbitrum API
Optimism API
eth_blockNumber - Optimism
eth_getBlockByHash - Optimism
eth_getBlockByNumber - Optimism
eth_getTransactionByHash - Optimism
eth_getTransactionCount - Optimism
eth_getTransactionReceipt - Optimism
eth_getBlockTransactionCountByHash - Optimism
eth_getBlockTransactionCountByNumber - Optimism
eth_getTransactionByBlockHashAndIndex - Optimism
eth_getTransactionByBlockNumberAndIndex - Optimism
eth_sendRawTransaction - Optimism
eth_getBalance - Optimism
eth_getCode - Optimism
eth_getStorageAt - Optimism
eth_accounts - Optimism
eth_getProof - Optimism
eth_call - Optimism
eth_getLogs - Optimism
eth_protocolVersion - Optimism
eth_gasPrice - Optimism
eth_estimateGas - Optimism
eth_chainId - Optimism
net_version - Optimism
net_listening - Optimism
eth_getUncleByBlockNumberAndIndex - Optimism
eth_getUncleByBlockHashAndIndex - Optimism
eth_getUncleCountByBlockHash - Optimism
eth_getUncleCountByBlockNumber - Optimism
eth_getFilterChanges - Optimism
eth_getFilterLogs - Optimism
eth_newBlockFilter - Optimism
eth_newFilter - Optimism
eth_newPendingTransactionFilter - Optimism
eth_uninstallFilter - Optimism
web3_clientVersion - Optimism
web3_sha3 - Optimism
eth_syncing - Optimism
eth_unsubscribe - Optimism
Flow Docs
Crypto.org Docs
Feature Support By Chain
📖
Documentation
Changelog
Alchemy Web3.js
Error Reference
Compute Units (CUs)
Throughput (Rate Limits)
Gas Limits for eth_call and eth_estimateGas
🎓
Road to Web3
🎉
Welcome
‼
Important Info
🛠
Weekly Hackathons
🧠
Weekly Learning Challenges
💻
Tutorials
Hello World Smart Contract
How to Code and Deploy a Polygon Smart Contract
How to Create an NFT Tutorial
NFT Minter Tutorial: How to Create a Full Stack DApp
How to Deploy Your Own ERC-20 Token
Integrating Historical Transaction Data into your dApp
Adding notifications for Pending Transactions and Mined Transactions to your dApp
Building a dApp with Real-Time Transaction Notifications
📜
Guides
EIP-1559 Resource and Tutorial Hub
Using WebSockets
Dashboard Walkthrough
Deep Dive into eth_getLogs
How to Speed Up MetaMask Transactions
Alchemy Set-up for Macs
Choosing a Web3 Network
Running an Eth2.0 Staking Node or Validator with Alchemy
Internal Playbook: Upgrading Ethereum Nodes
Debugging CORS problems for end-users
📚
Resources
FAQ
Support
Blockchain 101
Web3 Glossary
Powered By
GitBook
eth_getBalance - Optimism
Returns the balance of the account of a given address.
Parameters
1.
DATA
, 20 Bytes - address to check for balance.
2.
QUANTITY|TAG
- integer block number, or the string
"latest"
,
"earliest"
or
"pending"
, see the
default block parameter
.
1
params
:
[
2
'0xf69d0bbc95db6287ef02f19e5b2789972f776c2f'
,
3
'latest'
4
]
Copied!
Returns
QUANTITY
- integer of the current balance for the given address in wei.
Request
Curl
Postman
1
curl
https://opt-mainnet.g.alchemyapi.io/v2/your-api-key
\
2
-X POST
\
3
-H
"Content-Type: application/json"
\
4
-d
'{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xf69d0bbc95db6287ef02f19e5b2789972f776c2f", "latest"],"id":0}'
Copied!
1
URL
:
https://opt-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType
:
POST
3
Body
:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getBalance",
7
"params":["0xf69d0bbc95db6287ef02f19e5b2789972f776c2f", "latest"],
8
"id":0
9
}
Copied!
Result
1
{
2
"jsonrpc"
:
"2.0"
,
3
"id"
:
0
,
4
"result"
:
"0x206c36e81d47c480"
5
}
Copied!
Optimism API
Alchemy Documentation
Previous
eth_sendRawTransaction - Optimism
Next
eth_getCode - Optimism
Last modified
18d ago
Copy link
Contents