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
eth_blockNumber - Polygon
eth_getBlockByHash - Polygon
eth_getBlockByNumber - Polygon
eth_getTransactionByHash - Polygon
eth_getTransactionCount - Polygon
eth_getTransactionReceipt - Polygon
eth_getBlockTransactionCountByHash - Polygon
eth_getBlockTransactionCountByNumber - Polygon
eth_getTransactionByBlockNumberAndIndex - Polygon
bor_getAuthor - Polygon
bor_getCurrentValidators - Polygon
bor_getCurrentProposer - Polygon
bor_getRootHash - Polygon
eth_getRootHash - Polygon
eth_getSignersAtHash - Polygon
eth_getTransactionReceiptsByBlock - Polygon
eth_getTransactionByBlockHashAndIndex - Polygon
eth_sendRawTransaction - Polygon
eth_getBalance - Polygon
eth_getCode - Polygon
eth_getStorageAt - Polygon
eth_accounts - Polygon
eth_getProof - Polygon
eth_call - Polygon
eth_getLogs - Polygon
eth_gasPrice - Polygon
eth_estimateGas - Polygon
eth_chainId - Polygon
net_version - Polygon
eth_getUncleByBlockNumberAndIndex - Polygon
eth_getUncleByBlockHashAndIndex - Polygon
eth_getUncleCountByBlockHash - Polygon
eth_getUncleCountByBlockNumber - Polygon
eth_getFilterChanges - Polygon
eth_getFilterLogs - Polygon
eth_newBlockFilter - Polygon
eth_newFilter - Polygon
eth_newPendingTransactionFilter - Polygon
net_listening - Polygon
eth_uninstallFilter - Polygon
web3_clientVersion - Polygon
web3_sha3 - Polygon
eth_subscribe - Polygon
eth_unsubscribe - Polygon
debug_traceTransaction (Unsupported) - Polygon
Arbitrum API
Optimism API
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_getCode - Polygon
Polygon API - Returns code at a given address. This method can be used to distinguish between contract addresses and wallet addresses.
Parameters
DATA
, 20 Bytes - address.
QUANTITY|TAG
- integer block number, or the string "latest", "earliest" or "pending", see the
default block parameter
.
1
params
:
[
2
'0x0ef2e86a73c7be7f767d7abe53b1d4cbfbccbf3a'
,
3
'latest'
4
]
Copied!
Returns
DATA
- the code from the given address.
Example
Alchemy Composer
The Alchemy Composer allows you to make a no-code example request via your browser. Try it out above!
Request
Curl
Postman
1
curl
https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key
\
2
-X POST
\
3
-H
"Content-Type: application/json"
\
4
-d
'{"jsonrpc":"2.0","method":"eth_getCode","params":["0x0ef2e86a73c7be7f767d7abe53b1d4cbfbccbf3a", "latest"],"id":0}'
Copied!
1
URL
:
https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType
:
POST
3
Body
:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getCode",
7
"params":["0x0ef2e86a73c7be7f767d7abe53b1d4cbfbccbf3a", "latest"],
8
"id":0
9
}
Copied!
Result
1
{
2
"jsonrpc"
:
"2.0"
,
3
"id"
:
0
,
4
"result"
:
"0x"
5
}
Copied!
Polygon API
Alchemy Documentation
Previous
eth_getBalance - Polygon
Next
eth_getStorageAt - Polygon
Last modified
11d ago
Copy link
Contents
Parameters
Returns
Example
Alchemy Composer
Request
Result