Auth
What is an API Key?
An API Key is a unique value that controls access to API call permissions so that only authorized users can use the API for security purposes. When making an API call, the API Key is included in the header of the request and sent to the server, which then verifies that the requester is an authenticated user before processing the request. Users can use their API Key to prevent entities other than authorized users from accessing project resources.
If an API Key is leaked outside the project and used by another user, unintended deletion or modification of resources used in the project may occur, and plan usage may be deducted due to unauthorized use. Please ensure that the API Key is securely configured within the project code using a key store or encryption to prevent leakage.
How can I obtain an API Key?
When a user completes Nodit onboarding, a project and the API Key associated with that project are automatically created. Users can find their API Key on the project Overview page in the Nodit Console and use it to access the various APIs provided by Nodit.
How can I use the API Key?
There are two ways to call the API using an API Key: entering it in the header of the API request, or entering it in the API endpoint. Let's learn both methods through the examples below.
1. Entering the API Key in the API Request Header
Enter X-API-KEY as the key and your issued API Key as the value in the header of the API request. This is the most basic method for sending a request containing the API Key to the server. In the example code below, remove <Your_API_Key> and enter your issued API Key, then run it in the terminal!
curl --request POST \
--url https://ethereum-mainnet.nodit.io/ \
--header 'X-API-KEY: <Your_API_Key>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_blockNumber"
}
'
2. Entering the API Key in the API Request Path
Call the API by entering your issued API Key in the API Path. This method can be used when calling Nodit's Node API. In the example code below, remove <Your_API_Key> and enter your issued API Key, then run it in the terminal!
curl --request POST \
--url https://ethereum-mainnet.nodit.io/<Your_API_KEY> \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_blockNumber"
}
'
This method can be used not only when calling APIs but also when connecting custom networks to wallet services such as MetaMask. As shown in the image, you can add the network provided by Nodit to wallet services like MetaMask by entering the HTTPS endpoint containing the API Key in the RPC URL field.
I want to issue additional API Keys.
If you are using the Nodit starter (Free) plan, you are provided with 1 free API Key. If you need to create additional API Keys, you can do so by upgrading your plan. You can check what is supported by each plan by clicking the link below.

