Links

Make requests

StarkNet supports API requests using HTTP and a subset of Ethereum JSON-RPC methods.
WebSocket calls are not supported.

Call a JSON-RPC method

Use HTTPS to call a JSON-RPC method. In this example we use curl to make the HTTPS request.
Replace <YOUR-API-KEY> with an API key from your Infura dashboard.
curl https://starknet-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"starknet_blockNumber","params":[],"id":1}'
Example output:
{"jsonrpc":"2.0","result":2508,"id":1}