Make requests
The Polygon PoS network supports API requests using HTTP, and supports all Ethereum JSON-RPCs. Infura also provides access to archive data for API calls that require access to data older than 128 blocks.
WebSocket calls are not supported when using the Polygon endpoints.
$ curl -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \
"https://polygon-mainnet.infura.io/v3/YOUR-API-KEY"
The result should look similar to the following:
$ {"jsonrpc":"2.0","id":1,"result":"0x17c3d14"}
Last modified 6mo ago