Infura API
Reliable Ethereum and IPFS node access via a hosted API.
What it does
Infura (now part of MetaMask/Consensys) provides hosted JSON-RPC endpoints for Ethereum and many other networks — Polygon, Arbitrum, Optimism, Base, Linea, Avalanche and more — so your app can read chain state and broadcast transactions without running a node.
Base URL
Authentication
Create a free API key (project) and put it in the URL path. Optionally enable an API key secret and send it via HTTP Basic auth for extra protection. The network is the subdomain (polygon-mainnet.infura.io, arbitrum-mainnet.infura.io…).
Code examples
curl -s -X POST "https://mainnet.infura.io/v3/$INFURA_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance",
"params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","latest"]}'from web3 import Web3
w3 = Web3(Web3.HTTPProvider(f"https://mainnet.infura.io/v3/{KEY}"))
print(w3.eth.block_number)
bal = w3.eth.get_balance("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
print(w3.from_wei(bal, "ether"))Rate limits & quotas
Free plan: on the order of 3 million credits/day (method calls cost different credit amounts) with a per-second rate cap. Over the daily limit returns HTTP 429; over the rate limit returns JSON-RPC error -32005. Archive-node requests and some add-on APIs need a paid plan.
Key response fields
| result | JSON-RPC result — hex strings for quantities (wei, block numbers) |
| error.code | -32005 rate limit, -32000 execution error, -32601 method not found |
| id / jsonrpc | Echoed request id and protocol version |
Common errors
| 401 | Key missing/invalid, or secret required but not supplied. |
| 429 | Daily credit allowance exhausted. |
| -32005 | Per-second request rate exceeded — back off. |
| -32000 'missing trie node' / 'header not found' | You asked for historical state without archive access. |
When to use it (and alternatives)
The long-standing default for ‘just give me an Ethereum RPC URL’. If you also want data conveniences (transfer history, NFT and token endpoints, webhooks), Alchemy bundles more; Ankr offers public no-key endpoints for quick tests.
FAQ
Is there a free Ethereum RPC without signing up?
Infura requires a key. For a quick, keyless test use a public endpoint like https://rpc.ankr.com/eth or a public Cloudflare/LlamaNodes RPC — but those are rate-limited and not for production.
Why do historical queries fail?
The free tier uses full nodes that keep only recent state. Requests for old balances or eth_call at an old block return ‘missing trie node’. You need archive access (paid).
What happened to Infura's IPFS API?
It was discontinued. Infura is now focused on RPC and network endpoints; use a dedicated IPFS pinning service instead.
New to APIs?
Short guides for working with this API — and any other.