Skip to content

Hyperliquid API trading bot without writing exchange code

Build a Hyperliquid grid bot from a script: read the market, get a live example, check it and save a draft with Prow's REST API. Curl and Python included.

By the Prow teamPublished Updated 8 min read

On this page

You can build a Hyperliquid trading bot from a script without writing any exchange code: no order signing, no nonce handling, no order book bookkeeping. You send the bot's settings to Prow's REST API. Prow checks them against the live market, saves them as a draft and returns a link. You open the link in Prow, read the limits and start the bot with your own signature. The API builds and manages bots. It does not place orders and it cannot start a bot, so the script stays short and the key cannot trade.

This guide shows the whole path with curl and a short Python script. All prices are made-up examples, not advice and not a forecast.

What does a Hyperliquid API trading bot normally need?

Most tutorials start from Hyperliquid's own API and its official Python SDK. That route gives you full control, and it also hands you a list of jobs: create an API wallet and keep its private key safe, sign every action, manage order sizes and tick sizes, keep a grid's open orders in sync with its fills, reconnect after a dropped feed, and decide what happens to the position when your script crashes. An API wallet cannot withdraw, but it can still trade, so the key in your script needs the same care as the account.

That is the right route if you want to write your own strategy engine. It is more than you need if you want a grid, DCA or Ladder bot with your own numbers and no engine of your own.

What does Prow's API do instead?

Prow already runs the bot engine, so the API works one level higher. Every call is plain JSON over HTTPS, with the key in an x-api-key header.

You doProw does
Read markets, funding and feesReturns Hyperliquid, Aster and Lighter data, cached up to a minute
Ask for a live example of a bot typeReturns settings priced at the market's current price
Send settings to checkApplies the same rules as the create form and explains every error
Save a draftStores it unstarted and returns confirm_url
Pause, stop or tighten a running botApplies it within seconds

Starting is the step the key never does. You open confirm_url, review the limits you sign and press Start in Prow. The bot then runs on Prow's own limited trading key, described in The Prow Bots key, and your script holds nothing that can place an order. The full list of what a key can and cannot do is on the concepts page.

How do I get an API key?

  1. Open Prow, then Settings, then AI assistants and API, and tap Create key.
  2. Choose Build, pause and stop your bots. The other choice, See your account and bots, reads markets and your account but cannot build.
  3. Choose how long it lasts, confirm, and copy the key. Prow shows it once.
  4. Connect a Hyperliquid account in Prow if you have not. A check and a draft need an account on the venue, and without one the API answers no_account.

Then keep the key out of your code:

bash
export PROW_KEY="paste your key here"
export API="https://app.prowdex.com/api/v1"

Create a key when you are ready.

Step 1: read the market with curl

Funding for one coin on every venue:

bash
curl -sS "$API/funding?coin=BTC" -H "x-api-key: $PROW_KEY"

The answer has a data list with one row per venue. Each row carries venue, market, funding_hourly, funding_apr and open_interest_usd, all as decimal strings. funding_hourly is a fraction: 0.0000125 is 0.00125 percent an hour. When it is positive, longs pay shorts.

One market with its price, maximum leverage and fees:

bash
curl -sS "$API/markets/hyperliquid/BTC" -H "x-api-key: $PROW_KEY"

The price sits in market.price. The read cookbook lists the other reads, including your bots, orders and fills.

Step 2: ask for a live example, then check it

A grid has to sit around today's price, so do not copy a range from a tutorial. Ask Prow for settings at that price and save them to a file:

bash
curl -sS "$API/bot-types/grid?venue=hyperliquid&market=BTC&direction=long" -H "x-api-key: $PROW_KEY" \
  | jq '{venue:"hyperliquid", market:"BTC", draft:.example}' > grid.json

The answer has example, a grid that already passes the check, plus notes about the rules and min_investment, the least investment those settings accept, as a string in the market's own currency. grid.json now holds a request body made from the example (this needs jq). Change only what you mean to change. This is the shape of an example. The prices here are made up and yours are today's:

json
{
  "venue": "hyperliquid",
  "market": "BTC",
  "draft": {
    "type": "grid", "direction": "long", "investment": 200, "leverage": 2,
    "lower": 90000, "upper": 100000, "count": 20, "spacing": "geometric",
    "slLow": 87000, "takeProfitPct": 15
  }
}

Check settings without saving anything:

bash
curl -sS -X POST "$API/bot-config/validate" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d @grid.json

You get valid, params (the settings Prow would use), errors and warnings in plain words (each has a field and a message), min_investment, summary.liquidation_price as an estimate and limits_you_sign_in_prow. Saving the draft is the same body sent to /bots/drafts:

bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: btc-grid-hl-0001" \
  -d @grid.json

The answer has bot_id, started: false and confirm_url, plus the same check fields as above. The Idempotency-Key header makes a retry safe: for 10 minutes, the same key and the same body return the first answer instead of a second draft. A key is 8 to 80 letters, digits, - and _.

Can I build the bot from a Python script?

Yes. This script reads funding, asks for a live grid example, raises the investment to at least the minimum, checks it and saves the draft. It needs pip install requests and your key in PROW_KEY.

python
import os
import sys

import requests

API = "https://app.prowdex.com/api/v1"
HEADERS = {"x-api-key": os.environ["PROW_KEY"]}
VENUE, COIN = "hyperliquid", "BTC"


def call(method, path, headers=None, **kwargs):
    r = requests.request(method, API + path, headers={**HEADERS, **(headers or {})}, timeout=30, **kwargs)
    body = r.json()
    if not r.ok:
        e = body["error"]
        sys.exit(f"{r.status_code} {e['code']}: {e['message']}")
    return body


# 1. Read: funding for the coin on every venue
for row in call("GET", "/funding", params={"coin": COIN})["data"]:
    print(row["venue"], "hourly", row["funding_hourly"], "yearly", row["funding_apr"])

# 2. Ask for a live example at today's price
schema = call("GET", "/bot-types/grid", params={"venue": VENUE, "market": COIN, "direction": "long"})
draft = schema["example"]
draft["investment"] = max(100, float(schema.get("min_investment") or 0))

# 3. Check it. Nothing is saved yet.
args = {"venue": VENUE, "market": COIN, "draft": draft}
check = call("POST", "/bot-config/validate", json=args)
if not check["valid"]:
    sys.exit("Not valid: " + "; ".join(e["message"] for e in check["errors"]))
for w in check["warnings"]:
    print("Warning:", w["message"])

# 4. Save the draft and print the link
saved = call("POST", "/bots/drafts", json=args, headers={"Idempotency-Key": f"grid-{COIN}-{VENUE}-0001"})
print("Open this in Prow to review and start:", saved["confirm_url"])

Run it, open the printed link, and Prow shows the create form with your settings filled in. Nothing has started and no money has moved. Run it again within 10 minutes with the same idempotency key and you get the same answer. Change the number at the end of the key, or the market, to make another draft.

What if the API refuses the call?

Every refusal is one sentence plus a stable code, and the script above prints both. The ones you will meet first:

  • no_account. No Hyperliquid account is connected in Prow. details.fix_url points to where to do it.
  • invalid_settings. The settings broke a rule, such as an order below the venue's minimum. details.errors says which field and why, and for a too-small investment details.min_investment gives the minimum.
  • scope_missing. The key was made without the build tick. Make a new key.
  • rate_limited. Reads are limited to 120 a minute per key, and building draws on a budget of roughly 60 points an hour: a check costs 1 and a saved draft costs 2. Wait for the Retry-After header and carry on.

Errors, limits and retries has the whole list.

Why can't the API place orders for me?

Because an API that places orders needs a key that can lose money, and a leaked or misused key of that kind is the main risk of any trading script. Prow's key reads, builds drafts, pauses and stops, and tightens the take profit or trailing of a running bot. It cannot trade or withdraw, so a stolen key cannot empty your account. The price is that you start each bot yourself in Prow. For what that means when the caller is an AI assistant, see Is it safe to give an AI assistant a trading API key?.

You can still do a lot from code: build any bot type, copy a bot to another market or exchange, and read results, orders and fills. The tool list has every call.

What to do next

Put stops and take profits into your settings with Set a stop loss, take profit and trailing stop via API, run the same script on Aster by changing VENUE, or hand the same key to an assistant, as in Build a grid bot with an AI assistant. To understand the bot you are building, read Hyperliquid grid bot. The API quick start covers both doors, MCP and REST.

Prow's fee applies only to trades the bot makes in Prow and is 0% until Dec 31, 2026, then 0.025% per trade. The venue's own fees come on top. The key and the API cost nothing.

Frequently asked questions

Does Hyperliquid have an API for trading bots?

Yes. Hyperliquid has its own public API and an official Python SDK for reading data and sending signed orders. Prow's API is a different, higher-level one: it builds and manages bots on top of Hyperliquid and Aster instead of sending orders.

Do I need a Hyperliquid API wallet key in the script?

No. The script holds only a Prow key. Your wallet and the limited trading key the bot uses stay in your browser and in Prow, as described in Prow wallet.

Can the script start the bot?

No. A bot starts only when you press Start in Prow and sign. The API gives you a link to that screen.

Can I use the same script on Aster?

Yes. Set venue to aster, and use the market name that list_markets shows. An Aster account has to be connected in Prow. Aster allows fewer grid levels than Hyperliquid, and the check tells you if your count is too high.

Does it work for DCA and Ladder bots?

Yes. Ask /bot-types/dca or, while Prow has Ladder bots on, /bot-types/ladder for an example and send it the same way. The build cookbook has one for every type.

Sources

Checked December 6, 2026: