Polygon PoS API Quickstart
How to get started building on Polygon PoS and using the JSON-RPC API
Don't have an API key?
Build faster with production-ready APIs, smart wallets and rollup infrastructure across 70+ chains. Create your free Alchemy API key and get started today.
Send Your First Request on Alchemy
Let’s use the viem package to create an Ethereum client connected to Alchemy and fetch the latest block number!
Create Client Connected to Alchemy
Now that you’ve created a client connected to Alchemy, you can continue with some basics:
Get Latest Block Number
Get an Address Balance
Read Block Data
Fetch a Transaction by Hash
Fetch Transaction Receipt
Polygon Tutorials
Want to build your first Dapp on Polygon and use Polygon APIs?
Check out the following tutorials to learn how to build on Polygon:
For full documentation on Web3 libraries, check out the official documentation:
- Viem Documentation - Modern TypeScript interface for Ethereum
- Ethers.js Documentation - Complete Ethereum wallet implementation