Build on Halisi

The Halisi Developer API gives you:

  • real-price data for tokenized U.S. stocks (consensus prices, per-chain listings, gaps, market hours);
  • verifiable receipts;
  • order proposals that a Halisi user approves with their own passkey.

Public data endpoints need no key. User data and proposals need an API key the user creates. No API key can ever move funds. Every trade is approved on the user’s device.

Get started · API reference → · For AI agents →

What you can build

  • A price-gap tracker or newsletter: pull weekly gap data and real-price badges.
  • A budgeting or savings app that proposes “invest $10 in the S&P 500 on payday”. The user approves in Halisi with one tap.
  • A WhatsApp or Telegram bot that answers “Is Apple’s price normal right now?” and links to a proposal.
  • A personal dashboard that reads your own portfolio and receipts.
  • A blog widget showing a live Real-Price badge for any stock.

Base URL and versioning

https://halisi.codewitheugene.top/api/v1

Versioned in the path. Breaking changes come only with /v2, and are announced in the changelog at least 30 days ahead. Machine-readable spec: /api/v1/openapi.json (OpenAPI 3.1).

Quickstart (2 minutes, no key)

curl https://halisi.codewitheugene.top/api/v1/real-price/AAPL
{
  "ticker": "AAPL",
  "name": "Apple",
  "consensus_price": "351.18",
  "badge": "real_price",
  "max_deviation_pct": "0.41",
  "market": { "status": "closed", "next_open": "2026-11-24T14:30:00Z" },
  "listings": [
    { "symbol": "AAPLC", "chain": "base", "price": "351.11", "deviation_pct": "-0.02", "chosen": true, "reason": "closest to consensus" },
    { "symbol": "AAPLX", "chain": "solana", "price": "352.55", "deviation_pct": "0.39", "chosen": false }
  ],
  "as_of": "2026-11-23T12:00:00Z"
}

All prices are decimal strings: never parse them into floating point for money maths.

Endpoints

Public: no key, 60 requests/min per IP

Method Path Returns
GET /v1/markets Every supported company with its consensus price, 24 h change and badge
GET /v1/markets/{ticker} Listings per chain, deviations, the chosen listing and why, candles
GET /v1/real-price/{ticker} A compact badge payload (above): perfect for widgets and bots
GET /v1/price-gaps?window=7d&format=json|csv The weekly price-gap dataset (method in the report)
GET /v1/market-hours U.S. market status, next open and close in UTC and EAT, holidays
GET /v1/receipts/{id} A public receipt, with a verification block recomputed from the order and the on-chain transaction

With a user API key

Scope Method Path What it does
read:portfolio GET /v1/me/portfolio Holdings, value, P&L (live and practice separated)
read:portfolio GET /v1/me/activity Orders, deposits and receipts, cursor-paginated
propose:orders POST /v1/proposals Creates an order proposal (ticker, side, amount). Returns an approval_url; nothing happens until the user approves with their passkey in Halisi
propose:orders GET /v1/proposals/{id} Proposal status: pending → approved → filled (+ receipt id) / declined / expired (15 min)
webhooks POST/GET/DELETE /v1/webhooks Manage webhook endpoints

There is no execute endpoint, and there never will be one in this API.

Creating an API key

  1. Open Halisi → Account → Developer → Create API key.
  2. Name it, pick scopes (read:portfolio, propose:orders, webhooks) and an optional expiry.
  3. Approve with your passkey. The key (hk_live_…) is shown once; store it in your secrets manager.
  4. Revoke at any time from the same screen; revocation is immediate.

Keys are stored hashed. Practice-mode accounts get hk_test_… keys that only see practice data.

curl -X POST https://halisi.codewitheugene.top/api/v1/proposals \
  -H "Authorization: Bearer $HALISI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7f1c9e2a-payday-2026-11-28" \
  -d '{"ticker":"SPY","side":"buy","amount_usd":"10.00","note":"Payday auto-invest"}'
{ "id": "prp_8Hq2…", "status": "pending", "approval_url": "https://halisi.codewitheugene.top/app/approve/prp_8Hq2…", "expires_at": "2026-11-28T09:15:00Z" }

The user gets a notification, sees the normal preview (Real-Price Check, fee), and approves with their fingerprint. Webhooks tell you the outcome.

Code samples

TypeScript (Node 18+ / Bun / Deno):

const res = await fetch("https://halisi.codewitheugene.top/api/v1/real-price/NVDA");
if (!res.ok) throw new Error(`Halisi ${res.status}: ${(await res.json()).error.code}`);
const { badge, consensus_price } = await res.json();
console.log(`NVIDIA ${consensus_price} (${badge})`);

Python:

import requests
r = requests.get("https://halisi.codewitheugene.top/api/v1/price-gaps", params={"window": "7d"}, timeout=10)
r.raise_for_status()
for row in r.json()["data"]:
    print(row["name"], row["max_gap_pct"])

Webhooks

Events:

  • proposal.approved, proposal.declined, proposal.expired;
  • receipt.created;
  • deposit.received.

Each delivery is a JSON POST signed with Halisi-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "t.body"> using your endpoint’s secret. Reject requests older than 5 minutes. Failed deliveries are retried with backoff for 24 h.

Errors

The same shape everywhere:

{ "error": { "code": "rate_limited", "message": "Too many requests", "request_id": "req_01J…" } }
Status Codes
400 invalid_argument
401 unauthenticated
403 forbidden_scope, country_restricted
404 not_found
409 idempotency_conflict
422 amount_out_of_range, market_unavailable
429 rate_limited (see Retry-After)
5xx internal, upstream_unavailable

Include request_id when you contact us.

Limits

Limit
Public endpoints 60/min per IP
Keyed endpoints 120/min per key
Proposals 20/day per user, $25 max each (prototype limits)
Webhook endpoints 5 per key

Embeddable Real-Price badge

<script src="https://halisi.codewitheugene.top/widget.js" defer></script>
<halisi-price ticker="AAPL"></halisi-price>

It is a tiny web component (< 4 KB, no cookies) showing the consensus price and badge, and it links to the stock on Halisi.

Rules for builders

  • Never ask users for their passkey, seed phrase or Halisi session. You only ever need an API key they created.
  • Show users what you’ll propose before you propose it; respect declines.
  • Don’t present Halisi data as investment advice, and include “tokenized stocks are not shares” where you show prices to the public.
  • Respect rate limits and cache public data for at least 15 s.

Status and support

Availability (prototype): public endpoints ship first, with the app. API keys, proposals, webhooks and the widget are in beta; check the changelog in this section.

Ask Halisi

Habari! I answer questions about Halisi, tokenized stocks and getting started, in English or Kiswahili. I can't give financial advice.

AI answers can be wrong. Not financial advice.

Accessibility

Text size