Polygon

Polygon

cURL

curl is the fastest way to poke at the Polygon JSON-RPC API without pulling in an SDK — it is ideal for testing that your endpoint works, debugging a malformed request, or wiring quick checks into shell scripts and CI pipelines. Every Polygon RPC call is an HTTP POST carrying a JSON body, so each request needs the Content-Type: application/json header. Your API key lives in the URL path: https://polygon.therpc.io/YOUR_API_KEY. Because Polygon PoS (chain ID 137) speaks the standard Ethereum JSON-RPC dialect, the same method names you know from Ethereum — eth_blockNumber, eth_getBalance, and the rest — work here unchanged.

You can authenticate to Polygon in two ways: place the key directly in the URL path (https://polygon.therpc.io/YOUR_API_KEY), or send it as a Bearer token in the Authorization: Bearer YOUR_API_KEY header. Either way, every request to the Polygon endpoint must be a POST with Content-Type: application/json.

Basic Usage

curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://polygon.therpc.io/YOUR_API_KEY

Authentication

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://polygon.therpc.io/YOUR_API_KEY

Common Operations

curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x742d35Cc6634C0532925a3b844Bc454e4438f44e","latest"],"id":1}' \
https://polygon.therpc.io/YOUR_API_KEY
curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}' \
https://polygon.therpc.io/YOUR_API_KEY

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.