Polygon JSON-RPC API
The Polygon JSON-RPC API is the standard interface developers use to communicate with the Polygon blockchain. It allows decentralized applications (dApps) to read on-chain data, query smart contracts, and submit transactions without the need to run a local copy of a full blockchain node
API Method Categories
Account Methods
Methods for retrieving account-related information:
eth_accounts- Returns accounts managed by the nodeeth_getBalance- Returns account balanceeth_getTransactionCount- Returns transaction count (nonce)eth_getCode- Returns contract bytecodeeth_getStorageAt- Returns storage value at positioneth_getProof- Returns Merkle proof for account state
Block Methods
Methods for retrieving block information:
eth_blockNumber- Returns latest block numbereth_getBlockByHash- Returns block by hasheth_getBlockByNumber- Returns block by numbereth_getBlockTransactionCountByHash- Returns transaction count in block by hasheth_getBlockTransactionCountByNumber- Returns transaction count in block by number
Transaction Methods
Methods for transaction operations:
eth_getTransactionByHash- Returns transaction by hasheth_getTransactionByBlockHashAndIndex- Returns transaction by block hash and indexeth_getTransactionByBlockNumberAndIndex- Returns transaction by block number and indexeth_getTransactionReceipt- Returns transaction receipteth_sendRawTransaction- Submits signed transactioneth_sendTransaction- Creates and sends transactioneth_sign- Signs data with accounteth_pendingTransactions- Returns pending transactions
Smart Contract Methods
Methods for smart contract interaction:
eth_call- Executes contract call without transactioneth_estimateGas- Estimates gas for transaction
Filter Methods
Methods for event filtering and subscription:
eth_newFilter- Creates log filtereth_newBlockFilter- Creates block filtereth_newPendingTransactionFilter- Creates pending transaction filtereth_getFilterChanges- Returns filter changeseth_getFilterLogs- Returns filter logseth_getLogs- Returns logs matching criteriaeth_uninstallFilter- Removes filtereth_subscribe- Creates subscription (WebSocket)eth_unsubscribe- Removes subscription (WebSocket)
Gas Methods
Methods for gas price information:
eth_gasPrice- Returns current gas priceeth_feeHistory- Returns historical gas feeseth_maxPriorityFeePerGas- Returns max priority fee suggestion
Network Methods
Methods for network information:
eth_chainId- Returns chain IDeth_syncing- Returns sync statuseth_protocolVersion- Returns protocol versionnet_version- Returns network IDnet_listening- Returns listening statusnet_peerCount- Returns peer count
Node Methods
Methods for node information:
eth_coinbase- Returns coinbase addresseth_mining- Returns mining statuseth_hashrate- Returns hashraterpc_modules- Returns enabled RPC modulesweb3_clientVersion- Returns client versionweb3_sha3- Returns Keccak-256 hash
Uncle Methods
Methods for uncle block information:
eth_getUncleByBlockHashAndIndex- Returns uncle by block hash and indexeth_getUncleByBlockNumberAndIndex- Returns uncle by block number and indexeth_getUncleCountByBlockHash- Returns uncle count by block hasheth_getUncleCountByBlockNumber- Returns uncle count by block number