Getting started
Create an Infura project and send requests to the Ethereum network.

1. Sign up to Infura

To sign up for an account on the Infura website, enter your email address and password, and click SIGN UP.
Infura sign up
To activate your account, verify your email address by clicking the link sent to your inbox.

2. Create an Ethereum project

Once verified, you’ll be taken to the Infura dashboard where you can create projects, view analytics, select add-ons, or raise support requests.
Click CREATE NEW PROJECT.
Create a new project
From the pop-up:
  • Select Ethereum in the PRODUCT dropdown list.
  • Provide a name, then click CREATE.
Create a new project
Your new project's settings page has all the information you need to connect to the network.
Use the available endpoints to send API requests.
Project settings
Never expose your project secret. It must never be human-readable in your application.

3. Create a project on another network

Ethereum, Palm, Polygon, Arbitrum, Optimism

To access Ethereum, Palm, Polygon, Arbitrum, and Optimism mainnets and testnets, follow step 2 above and select the new network from the ENDPOINTS dropdown list in project settings.
Available networks from the project settings

ETH2, IPFS, Filecoin

To create projects with ETH2, IPFS, or Filecoin, follow step 2 above and select the network at the CREATE NEW PROJECT step.
Create Ethereum, ETH2, IPFS, or Filecoin project

4. Security settings

Configure security settings in the SECURITY tab. This is optional.
Force API requests to include the project secret and/or JSON Web Tokens (JWTs).
Security settings
Use an allowlist to prevent unwanted access to your project.
Refer to the allowlist documentation for configuration instructions and best practices.
Allowlist settings

5. Send requests

Start interacting with Ethereum data by sending requests using HTTP or WebSockets.
All requests are POST requests.
Use a tool such as the Client Uniform Resource Locator (curl) or Postman to make requests.
The example HTTP requests use either curl or Postman.
Replace YOUR-PROJECT-ID with your own unique project ID.

Get the current block number

Retrieve the current block number.
curl
Postman
1
curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}'
Copied!
1
URL: https://mainnet.infura.io/v3/YOUR-PROJECT-ID
2
Request_Type: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_blockNumber",
7
"params":[],
8
"id":1
9
}
Copied!
You'll receive a response similar to:
1
{"jsonrpc":"2.0","id":1,"result":"0xde5fba"}
Copied!
The data returned is in hexadecimal, prefixed with 0x. If you convert de5fba to decimal, the resulting number is 14573498, representing the current block number at the time the query was made.

View the Ether balance of a specified contract

Check the balance of an Ethereum smart contract.
The example code checks the latest balance of the Ethereum Proof of Stake (PoS) contract.
curl
Postman
1
curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params": ["0x00000000219ab540356cBB839Cbe05303d7705Fa", "latest"],"id":1}'
Copied!
1
URL: https://mainnet.infura.io/v3/YOUR-PROJECT-ID
2
Request_Type: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getBalance",
7
"params": [
8
"0x00000000219ab540356cBB839Cbe05303d7705Fa",
9
"latest"
10
],
11
"id":1
12
}
Copied!
You'll receive a result similar to:
1
{"jsonrpc":"2.0","id":1,"result":"0x96c8e932f1e499c855045"}
Copied!
This result is the hexadecimal value of the contract in Wei (the smallest denomination of Ether).
The decimal conversion of the result is 11392978000069000000000069 Wei, which equals 11392978.000069000000000069 Ether.

6. Use the Infura dashboard

The Infura dashboard shows performance and API usage data such as methods called, bandwidth usage, and most active usage times.
Optimize your app and better understand your users by reviewing the dashboard regularly.
Project dashboard data