跳转至主要内容

Quicknode SDK QuickStart

更新于
Jul 13, 2026

概述

This QuickStart shows how to install the Quicknode SDK, configure an API key, and make your first product API request.

Create one configured SDK instance, then use the product clients attached to that instance. Your API key, timeouts, and optional base URL overrides are shared across every client, so scripts, services, and agents can move between Quicknode products without rebuilding authentication or HTTP configuration.


  • qn.admin: Manage endpoints, teams, usage, billing, logs, metrics, security, rate limits, and tags.
  • qn.rpc: Send JSON-RPC requests to the account's Tooling Access endpoint; session JWTs are minted and refreshed per call.
  • qn.streams: Create, list, update, pause, activate, test, and delete Streams.
  • qn.webhooks: Manage webhook templates, destinations, lifecycle actions, and enabled counts.
  • qn.kvstore: Store and retrieve sets and lists for cursors, watchlists, filters, and lightweight agent state.
  • qn.sql: Run SQL queries against indexed blockchain data and retrieve table schemas.

先决条件

Before you begin, create a Quicknode API key from the Quicknode dashboard. Agents can also create their own API keys, to learn more check out Agent Subscriptions.

Then set it in your environment:

导出 QN_SDK__API_KEY="您的API密钥"

安装

The SDK ships precompiled binaries for Linux (glibc and musl, x86_64 and aarch64) and macOS Apple Silicon. Browsers, Windows (use WSL2), and Intel macOS are not supported. See Platform support for the full matrix.


npm 安装 @quicknode/sdk

The Node.js package supports TypeScript, CommonJS, ES modules, and Bun.

Make your first request


List the endpoints available to your account with the Admin API client.

import { QuicknodeSdk } from "@quicknode/sdk";

const qn = QuicknodeSdk.fromEnv();
const response = await qn.admin.getEndpoints({ limit: 20 });

console.log(response.data);

Configure directly

You can also pass in a configuration directly instead of using default environment variables.

import { QuicknodeSdk } from "@quicknode/sdk";

const qn = new QuicknodeSdk({
apiKey: "YOUR_API_KEY",
http: {
timeoutSecs: 30,
},
});

Environment variables

Variable必填默认描述
QN_SDK__API_KEYYour Quicknode API key
QN_SDK__HTTP__TIMEOUT_SECS30HTTP request timeout in seconds
QN_SDK__HTTP__POOL_MAX_IDLE_PER_HOSTMax idle HTTP connections per host
QN_SDK__ADMIN__BASE_URLhttps://api.quicknode.com/v0/Override the Admin API base URL
QN_SDK__STREAMS__BASE_URLhttps://api.quicknode.com/streams/rest/v1/Override the Streams API base URL
QN_SDK__WEBHOOKS__BASE_URLhttps://api.quicknode.com/webhooks/rest/v1/Override the Webhooks API base URL
QN_SDK__KVSTORE__BASE_URLhttps://api.quicknode.com/kv/rest/v1/Override the Key-Value Store API base URL
QN_SDK__SQL__BASE_URLhttps://api.quicknode.com/sql/rest/v1/Override the SQL Explorer API base URL

产品客户

Once initializated, a single client gives you access to all Quicknode product APIs:

const endpoints = await qn.admin.getEndpoints();
const blockNumber = await qn.rpc.call("eth_blockNumber");
const streams = await qn.streams.listStreams();
const webhooks = await qn.webhooks.listWebhooks();
const sets = await qn.kvstore.getSets();
const trades = await qn.sql.query("SELECT * FROM hyperliquid_trades LIMIT 5", "hyperliquid-core-mainnet");

Language conventions

语言Convention
Node.js / TypeScriptMethods are async and use camelCase names. Pass parameters as a single options object.
PythonMethods are async and use snake_case names. Pass parameters as keyword arguments.
RustMethods are async and return Result types. Request structs use builders where available.
RubyMethods are blocking and use snake_case names. Responses are returned as Ruby hashes; access keys directly.

For complete workflows, see Examples. To review the full behavior for each product API, see the REST API docs for Admin API, Streams, Webhooks, Key-Value Store, and SQL Explorer.

分享此文档