8 min read
Overview
In this guide, we'll walk you through how to leverage the QuickNode Console API to manage your QuickNode endpoints programmatically. We'll cover how to create and update endpoints, set method-based and global rate limits, and control your spending by monitoring usage.
What You Will Do
- Manage your QuickNode endpoints programmatically using the Console API
- Monitor and control your spend and API usage efficiently
What You Will Need
- A paid QuickNode account
- An understanding of REST APIs and how to interact with them
The Console API is available for all paid accounts. Check pricing for details.
Introduction to the QuickNode Console API
The QuickNode Console API offers powerful programmatic access to all actions available within the User Dashboard, enabling you to manage your infrastructure, monitor performance, and control your costs more effectively. This API allows for full endpoint management, usage monitoring, and security configuration.
Why Use the Console API?
- Complete Control: Manage all aspects of your QuickNode setup without manually interacting with the User Dashboard.
- Automation: Automate endpoint creation, security configurations, and rate limit adjustments.
- Cost Management: Monitor your usage and spending in real-time, enabling you to set up alerts or even programmatically disable endpoints if you approach a usage threshold.
- Enhanced Monitoring: Utilize Prometheus to build a customized Grafana dashboard for better visibility.
QuickNode Console API Resources Overview
Below is a summary of all REST API resources available for interacting with the QuickNode User Dashboard:
- Billing: Retrieve billing information, including invoices and payments.
- Chains: Fetch a list of all QuickNode-supported chains.
- Endpoints: Create, retrieve, update, and archive QuickNode endpoints to manage your infrastructure programmatically.
- Endpoint Metrics: Access detailed metrics for specific QuickNode endpoints over a designated time period, including method calls, response status, breakdowns, and maximum response times.
- Endpoint Rate Limits: Update rate limits for a specific QuickNode endpoint.
- Endpoint Security: Manage security settings, including referrer, token, IP, domain mask, and JWT configurations.
- Usage: Retrieve usage data, including total usage for a specified time range, and view usage data grouped by endpoint, method, or chain.
For detailed documentation, please refer to our Console API documentation.
Prerequisites
QuickNode Account and API Key
Creating your API key is straightforward. If you haven't signed up already and created any endpoint, you can create an account here.
To create your keys, log in to your QuickNode Account, click on the avatar icon on the top left, and select API Keys. It will bring you to the API Keys page.
Generate an API key with appropriate permissions (you'll need CONSOLE_REST
to use the Console API) and keep your API key handy as you'll use it.
Managing Endpoints with the Console API
To use the Console API, you must authenticate your requests by including your API key in the HTTP headers like the one below:
curl -X GET 'https://api.quicknode.com/v0/usage/rpc' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE'
Don't forget to update YOUR_API_KEY_HERE
section with your own API Key in all cURL commands that will be shared in this guide.
Before creating or managing endpoints, it's important to retrieve the list of available blockchain networks using the /chains
endpoint, as you'll need this information for various actions.
You can explore all endpoint details and parameters using our Swagger documentation for more customization options.
Retrieving Supported Chains and Networks
To get a list of all supported chains and their networks, use the following cURL command:
curl -X GET 'https://api.quicknode.com/v0/chains' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE'
The response will provide you with slug values for each chain and network, which you’ll use when creating or managing endpoints. For example:
{
"data": [
{
"slug": "linea",
"networks": [
{
"slug": "linea-mainnet",
"name": "Linea Mainnet"
}
]
},
{
"slug": "avax",
"networks": [
{
"slug": "avalanche-mainnet",
"name": "Avalanche Mainnet"
}
]
}
]
}
Creating an Endpoint
To create a new endpoint, use the POST
method. You’ll need to specify the chain
and network
values retrieved from the /chains
endpoint.
curl -X POST 'https://api.quicknode.com/v0/endpoints' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE'
--data '{
"chain": "avax",
"network": "avalanche-mainnet",
}'
The response will include details of the newly created endpoint, including its id
, which you’ll use for further management.
Retrieving Your Endpoint ID
If you already have an endpoint and need to find its id, you can do so in two ways:
Using the Console API
You can list all your endpoints associated with your account using the following command:
curl -X GET 'https://api.quicknode.com/v0/endpoints' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE'
The response will include all your endpoints, along with their respective id values.
Using the QuickNode Dashboard
- Log in to your QuickNode dashboard.
- Navigate to the page of your desired endpoint.
- The
id
will be visible in the URL, formatted as:https://dashboard.quicknode.com/endpoints/{id}
.
Retrieving Endpoint Details
To get detailed information about a specific endpoint, use its id
:
curl -X GET 'https://api.quicknode.com/v0/endpoints/{id}' \
-H 'accept: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE'
Don't forget to replace {id}
with your endpoint ID.
The response will provide details about your endpoint, including:
id
: The unique identifier for your endpoint.chain
andnetwork
: The blockchain network your endpoint is connected to.http_url
andwss_url
: The HTTP and WebSocket URLs for accessing the endpoint.security
: Information about the endpoint's security settings, such as whether tokens, referrers, JWTs, IPs, domain masks, and other security measures are enabled.rate_limits
: The rate limits set for the endpoint, includingrps
(requests per second),rpm
(requests per minute),rpd
(requests per day), and whether the rate limit is applied by IP.