Skip to main content

Enable API request forwarding

For Avalanche (C-Chain) JSON-RPC methods, you can request failover protection by adding the failover header to your API request using cURL, Web3.js, Ethers.js, or any other language of your choice.

For more information about this feature, including our partner and their privacy information, see Failover protection.

info

Avalanche (C-Chain) failover support is available on Mainnet only.

Request

In the code tabs, the eth_blockNumber method is used as an example.

curl https://avalanche-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Enable-Failover: true" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params": [],"id":1}'