Getting started overview

Nownodes provides access to blockchain node infrastructure for various networks, including Bitcoin, Ethereum, and Polygon, through a unified API. This guide details the process of initiating an integration, from account registration and API key acquisition to executing a basic query. The primary interaction method involves sending HTTP requests, typically formatted as HTTP/1.1 requests, to specified API endpoints, authenticated by a unique API key.

The standard workflow for starting with Nownodes involves:

  1. Account Creation: Registering on the Nownodes platform to establish a user profile.
  2. API Key Generation: Obtaining a unique API key from the user dashboard. This key serves as the authentication credential for all API calls.
  3. First API Request: Constructing and executing a basic API call, typically using cURL, to verify connectivity and authentication.
  4. Integration: Incorporating the API calls into an application or script for broader functionality.

Nownodes offers a free tier that includes 20,000 requests per day, allowing developers to test the service before committing to a paid plan. Paid plans begin at $9 per month for 500,000 requests daily.

Here's a quick reference for the initial setup:

Step What to Do Where
1. Sign Up Create a Nownodes account. Nownodes homepage
2. Get API Key Locate your unique API key in the dashboard. Nownodes user dashboard
3. Make Request Use cURL to send a test API call. Your local terminal or development environment
4. Explore Docs Review available endpoints and parameters. Nownodes API documentation

Create an account and get keys

Access to Nownodes's blockchain node infrastructure requires an authenticated API key. This credential is generated upon successful account registration and is essential for all API interactions.

Account Registration

  1. Navigate to the Nownodes website.
  2. Locate and select the "Sign Up" or "Get Started" option.
  3. Provide the required information, which typically includes an email address and a password.
  4. Complete any verification steps, such as email confirmation, as prompted by the Nownodes platform.

API Key Retrieval

Once your account is active, your unique API key will be available in your personal dashboard.

  1. Log in to your newly created Nownodes account.
  2. On the dashboard, locate the section designated for API keys or credentials. This is often labeled "API Key", "Settings", or "Developer".
  3. Your API key will be displayed. It is a long alphanumeric string. Copy this key securely, as it will be used in the authentication header of your API requests.

It is critical to keep your API key confidential. Unauthorized access to your API key could lead to misuse of your account and consumption of your request limits. For security best practices, consider storing API keys as environment variables rather than embedding them directly in your code, especially in production environments. This practice aligns with general API key security recommendations.

Your first request

After obtaining your API key, you can make your first request to verify connectivity and access to the Nownodes infrastructure. Nownodes utilizes JSON-RPC for interacting with blockchain nodes. This example demonstrates how to query the latest block number on the Ethereum mainnet using cURL.

Prerequisites

  • Your Nownodes API key.
  • A terminal or command-line interface with cURL installed.

Example: Get Latest Ethereum Block Number

To retrieve the latest block number, you will send a POST request to the Ethereum mainnet endpoint, including your API key in the x-api-key header and a JSON-RPC payload in the request body.

The Ethereum mainnet endpoint provided by Nownodes typically follows the format: https://eth.nownodes.io/[YOUR_API_KEY]. Replace [YOUR_API_KEY] with the actual key copied from your dashboard.

curl -X POST \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://eth.nownodes.io/YOUR_API_KEY

Replace YOUR_API_KEY with your actual Nownodes API key. For instance, if your API key is abcd1234efgh5678ijkl9012mnop3456, the request would look like this:

curl -X POST \
-H "Content-Type: application/json" \
-H "x-api-key: abcd1234efgh5678ijkl9012mnop3456" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://eth.nownodes.io/abcd1234efgh5678ijkl9012mnop3456

Expected Response

A successful response will typically return a JSON object containing the latest block number in hexadecimal format:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1234567" 
}

The "result" field will contain the block number. For example, "0x1234567" indicates a block number in hexadecimal. You would typically convert this value to decimal for display or further processing.

Common next steps

After successfully making your first request, several common next steps can help you further integrate with Nownodes and leverage its capabilities:

  1. Explore Other Blockchains: Nownodes supports various blockchain networks beyond Ethereum, including Bitcoin, Polygon, and Binance Smart Chain. Consult the Nownodes documentation to find endpoints and available methods for other networks. For example, to interact with the Polygon network, you would use a similar JSON-RPC structure but target the Polygon-specific endpoint (e.g., https://matic.nownodes.io/YOUR_API_KEY) and relevant Polygon JSON-RPC methods.
  2. Implement in Your Application: Integrate the API calls into your preferred programming language and framework. Nownodes provides documentation with examples that can be adapted for various development environments. While Nownodes does not offer official SDKs, standard HTTP client libraries in languages like Python (e.g., requests), Node.js (e.g., axios or node-fetch), or Java (e.g., HttpClient) can be used to construct and send requests.
  3. Monitor Usage: Track your API request usage through the Nownodes dashboard. This helps manage your free tier limits or monitor consumption on paid plans. Understanding your usage patterns can inform decisions about scaling your plan if your application's demands increase.
  4. Error Handling: Implement robust error handling in your application. Common errors include invalid API keys, rate limits, or malformed requests. The Nownodes documentation outlines common error codes and their meanings.
  5. Security Best Practices: Beyond keeping your API key confidential, consider other security measures. If your application is client-side, proxying requests through your own backend can prevent exposing API keys. For server-side applications, ensure that API keys are loaded from secure environment variables or a secrets management system.
  6. Explore Advanced Features: Depending on your application's needs, investigate features like dedicated nodes for higher performance and reliability, or explore specific blockchain explorers if your use case involves detailed transaction analysis.

Troubleshooting the first call

If your first API call to Nownodes does not yield the expected result, consider the following common issues and troubleshooting steps:

  • Incorrect API Key:
    • Issue: The most frequent problem is an incorrect or expired API key.
    • Solution: Double-check that the API key in your request exactly matches the one displayed in your Nownodes dashboard. Ensure there are no leading or trailing spaces or incorrect characters.
  • Missing or Incorrect Header:
    • Issue: The x-api-key header might be missing or malformed, or the Content-Type: application/json header might be absent.
    • Solution: Verify that both -H "x-api-key: YOUR_API_KEY" and -H "Content-Type: application/json" are correctly included in your cURL command, as shown in the first request example.
  • Incorrect Endpoint URL:
    • Issue: The URL for the blockchain network you are trying to access might be wrong or include an incorrect protocol.
    • Solution: Confirm that the base URL (e.g., https://eth.nownodes.io/) is correct for the desired blockchain. Refer to the Nownodes documentation for the specific endpoint URLs for each supported network.
  • Malformed JSON-RPC Payload:
    • Issue: The JSON body of your request might have syntax errors, missing required fields (jsonrpc, method, params, id), or an invalid method call.
    • Solution: Carefully review the JSON payload for syntax errors, such as missing commas or incorrect quotation marks. Ensure the "method" field corresponds to a valid JSON-RPC method for the target blockchain (e.g., "eth_blockNumber" for Ethereum).
  • Firewall or Network Restrictions:
    • Issue: Your local network environment might be blocking outgoing HTTPS requests to the Nownodes API.
    • Solution: If you are working within a corporate network, check with your IT department about proxy settings or firewall rules that might restrict external API calls. Try making the request from a different network if possible.
  • Rate Limiting:
    • Issue: You might have exceeded the request limits for your current Nownodes plan (free tier or paid).
    • Solution: Check your Nownodes dashboard for current usage statistics. If you've hit your limit, wait for the reset period or consider upgrading your plan.
  • SSL/TLS Certificate Issues:
    • Issue: Rarely, issues with SSL/TLS certificates can prevent secure connections.
    • Solution: Ensure your cURL installation and operating system are up-to-date. In some environments, you might need to specify --cacert or -k (--insecure) for testing, though -k is not recommended for production.

If these steps do not resolve the issue, consult the Nownodes official documentation for specific error codes and further troubleshooting guides, or contact Nownodes support.