---
name: hyperdash-build
description: Build Hyperdash Data into an app, bot, dashboard, script or scheduled job. Use when the user asks to integrate the Hyperdash Data API into a codebase or product, to write code against data.hyperdash.com, to subscribe to its WebSocket streams, or to wire a full integration with market data, wallet data, streams and account status. For answering a question in chat use the hyperdash-data skill instead.
license: Proprietary
compatibility: Needs network access to data.hyperdash.com, a Hyperdash Data workspace with an active plan and an API key in the HYPERDASH_API_KEY environment variable.
metadata:
  version: "1.0"
  homepage: https://docs.hyperdash.com/data-api/skills
---

# Hyperdash Build

How to build on the Hyperdash Data API: REST for requests, WebSocket streams for anything live.

**Read the Data skill first:** `https://docs.hyperdash.com/skills/data`. Its rules for finding endpoints, time, numbers, coins, addresses, pagination, credits and errors all apply here. This file adds the build method only.

## Before you write code

1. The key is in the `HYPERDASH_API_KEY` environment variable. Never ask for it in chat, never print it, never commit it. If it is not set, ask the user to set it.
2. Call `GET /v1/me` (free) to confirm the key, its scopes and the plan.
3. Look up each endpoint you will call before you call it. The spec is about 1.4 MB, so read one path at a time:

   ```bash
   curl -s https://data.hyperdash.com/openapi.json | jq '.paths["/v1/markets/{coin}/candles"]'
   ```
4. Read the streams protocol at `https://docs.hyperdash.com/data-api/streams.md` before you open a WebSocket.

## What a full integration includes

A full integration has four levels. Wire all four unless the user says otherwise. Market prices alone are a demo, not an integration. Wallet-level data is the core of this API.

| Level | What it adds | Main routes | Scope |
|---|---|---|---|
| **Market data** | Markets, candles, books, funding, open interest, liquidations | `/v1/markets/...`, `/v1/liquidations` | `markets:read`, `liquidations:read` |
| **Wallet intelligence** | Any wallet's positions, history and performance, plus cohorts, leaderboards and wallet lists | `/v1/accounts/...`, `/v1/cohorts/...`, `/v1/leaderboards/...`, `/v1/positions/...` | `accounts:read`, `analytics:read` |
| **Streams** | Live trades, liquidations, fills, orders and books over WebSocket | `wss://data.hyperdash.com/v1/stream` | `streams:read` |
| **Account status** | Plan and balance, data health, clear handling of plan and credit limits | `/v1/me`, `/v1/status` | `usage:read` for the balance in `/v1/me`; `/v1/status` needs no key |

The scopes shown are the main ones. `https://data.hyperdash.com/llms.txt` lists the scope of each endpoint, and some liquidation and level endpoints need `markets:read` or `analytics:read`. A key with the default **All** preset has every scope.

## Build rules

- **Keep the key on the server.** Never ship it in a browser bundle, mobile app or repository. Browser code calls the user's backend, and the backend calls Hyperdash. Add `HYPERDASH_API_KEY` to `.env.example` with an empty value.
- **One client module.** It sets the `Authorization: Bearer` header, follows `next_cursor` until `has_more` is false, and retries `429 rate_limited`, `502`, `503` and `504` after `Retry-After` with backoff and jitter up to 30 seconds (never `extraction_limit` or `jobs_limit`). For bulk history, keep 2 to 3 large pages in flight within the plan's concurrent-request slots (one slot per 1,000 rows; on Starter, one 5,000-row page at a time), and use a smaller `limit` if `429`s keep coming.
- **Decimals, not floats.** Prices, sizes and money arrive as decimal strings. Keep them as decimals in anything that stores or sums them.
- **Streams for anything live.** For prices, liquidations, or a wallet's fills, orders and positions, subscribe to a stream instead of polling REST.
- **Stream handling.** One connection carries up to 20 subscriptions. Acknowledge each `data` batch within 10 seconds, after you have processed it. Save the `cursor` and resubscribe with it after a reconnect. On a `gap` message, backfill the missing range over REST. Reply to `ping`, and reconnect with jitter after a close.
- **Ranges.** Each endpoint states its maximum range and whether `end_time` is included. For a longer period, loop over back-to-back windows as the Data skill describes.
- **Plan limits.** Handle `403 history_limit`, `403 feature_not_in_plan`, `403 plan_required`, `403 insufficient_scope`, `403 credits_exhausted`, `403 max_credits_exceeded` and `429 extraction_limit` with a clear message that points the user to the console, instead of a crash. Leave out `start_time` for the endpoint's default recent window; it always stays inside the plan's history.
- **Async jobs.** The one job kind, `account_fills_summary` (one wallet, up to 90 days, Growth and up), runs off the request path: `POST /v1/jobs` with an `Idempotency-Key`, poll `GET /v1/jobs/{id}`, then page the result.
- **Errors.** Branch on the `code` field of the problem response, never on the text. Log `request_id`.

## When you finish

Report which levels you wired and which you left out and why. If a call returned `feature_not_in_plan`, name the plan that includes it. Give the user the command that runs the integration and the one that checks it works.
