Acquire an API Key
Request and manage API keys for Pyth Pro
This guide explains how to acquire an API key for Pyth Pro, which is required to authenticate websocket connections and subscribe to price updates.
Request API Key
Sign up for a free Pyth Terminal account.Once you have logged in, click on the 🔑 View your API key button to obtain your API key.
API keys are required for all Pyth Pro websocket connections. Make sure to keep your key secure and do not share it publicly.
Using the API Key
Once you receive your API key, use it to authenticate the websocket connection by passing it as an Authorization header with the value Bearer {key}.
Example Usage
import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk";
const client = await PythLazerClient.create(
[
"wss://pyth-lazer-0.dourolabs.app/v1/stream",
"wss://pyth-lazer-1.dourolabs.app/v1/stream",
"wss://pyth-lazer-2.dourolabs.app/v1/stream",
],
"YOUR_API_KEY",
);Next Steps
After acquiring your API key, you can proceed to subscribe to price feeds using the Pyth Pro websocket API.