Skip to content
Hedgelytics

Documentation

Build with Hedgelytics

A JSON-over-HTTPS market-data API with Bearer-token auth, plus an MCP server that exposes the same data to AI assistants. Provenance ships with every row — each snapshot is pinned to a date, attributed to its upstream source, and hashed against the archived raw payload. We serve real data or an honest 404, never fabricated values.

Base URL

All Data API requests go to a single host. Every path is versioned under /v1.

https://api.hedgelytics.com

Authentication

Authenticate every request with a secret API key in the Authorization header as a Bearer token. Keys are prefixed hk_live_ for production and hk_test_ for the sandbox; the prefix determines the livemode flag on every object you get back.

Authorization: Bearer hk_live_…

Create and rotate keys from your account. The full secret is shown exactly once, at creation — store it securely; it can't be recovered. Rotation is zero-downtime: mint the new key, deploy it, then revoke the old one.

Your first call

The Hong Kong HKD yield curve is live today. Fetch the latest honia_ois curve (omit as_of for the most recent snapshot; pass type=efbn_zero|hibor for the other curves):

Request

curl https://api.hedgelytics.com/v1/market/hk/yield-curve \
  -H "Authorization: Bearer hk_live_…"

Response (200)

{
  "object": "yield_curve",
  "id": "crv_honia_ois_20260529",
  "as_of": "2026-05-29",
  "curve_type": "honia_ois",
  "source": "HKMA",
  "raw_sha256": "3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b",
  "points": [
    { "tenor_days": 1,   "rate": 4.05 },
    { "tenor_days": 7,   "rate": 4.08 },
    { "tenor_days": 30,  "rate": 4.21 },
    { "tenor_days": 90,  "rate": 4.33 },
    { "tenor_days": 180, "rate": 4.41 },
    { "tenor_days": 365, "rate": 4.52 }
  ],
  "meta": {
    "units": "percent_annualized",
    "as_of_resolved": "2026-05-29",
    "count": 6,
    "requested_type": "honia_ois",
    "fallback_applied": false
  },
  "livemode": true
}

The provenance triple — as_of, source, and raw_sha256 — is what makes a snapshot reproducible: raw_sha256 is the SHA-256 of the archived upstream payload this curve was derived from. To discover which dates are queryable for a curve, call GET /v1/market/hk/yield-curve/available-dates. A date or curve we don't hold returns a 404 — never a synthesized curve.

Dataset catalog

GET /v1/datasets is the machine-readable source of truth for what is callable. Each dataset carries a status of live or planned, its provenance source, and the endpoints + MCP tools that serve it.

DatasetSourceStatus
HK HKD yield curveHKMAlive
Macro / rates (FRED)FREDplanned
Equity factor returnsKENNETH_FRENCHplanned
US equity prices (OHLCV)STOOQplanned
Fundamentals (PIT)SEC_EDGARplanned

Calling a single-resource endpoint for a planned dataset returns a 404 with code dataset_not_released — distinct from a normal not-found so you can tell "no data for your query" apart from "this dataset isn't live yet."

GET https://api.hedgelytics.com/v1/macro/fred/DGS10
→ 404
{
  "error": {
    "type": "not_found_error",
    "code": "dataset_not_released",
    "message": "The macro (FRED) dataset is planned (P1) and not yet live. See GET /v1/datasets.",
    "request_id": "req_8sK2mZqaV1d0"
  }
}

Errors

Every error returns the same envelope. The broad type (invalid_request_error, authentication_error, not_found_error, rate_limit_error, api_error) is paired with a stable, machine-readable code. The request_id is echoed in both the body and the Hedgelytics-Request-Id response header — quote it in support requests.

{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_parameter",
    "message": "Invalid type. Use one of: honia_ois, efbn_zero, hibor.",
    "param": "type",
    "request_id": "req_8sK2mZqaV1d0"
  }
}

Versioning

The API is dated. Every response carries the version it was served with in the Hedgelytics-Version response header (e.g. 2026-05-31). Backwards-incompatible changes ship under a new dated version; pin to one for reproducible behavior.

Hedgelytics-Version: 2026-05-31

Rate limits

Responses carry the IETF RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset (seconds until the window resets) headers. Authenticated calls are limited per API key; unauthenticated traffic per IP, with a tighter budget. Over the limit returns 429 with type rate_limit_error and a Retry-After header.

HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 600
RateLimit-Remaining: 0
RateLimit-Reset: 42
Retry-After: 42

{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Retry after 42s.",
    "request_id": "req_8sK2mZqaV1d0"
  }
}

Pagination

List endpoints use cursor pagination. Pass limit (1–1000, default 100) and starting_after (the id of the last item from the previous page). When has_more is true, fetch the next page from the last id.

curl "https://api.hedgelytics.com/v1/datasets?limit=2&starting_after=ds_hk_yield_curve" \
  -H "Authorization: Bearer hk_live_…"

# → { "object": "list", "data": [ … ], "has_more": true, "livemode": true }

MCP server

The same data is exposed over the Model Context Protocol so Claude, Cursor, or any MCP-aware client can call it directly. The streamable-HTTP endpoint lives at https://hedgelytics.com/api/mcp/mcp. Live tools today: hk_yield_curve and hk_yield_curve_available_dates — returning the same data, with provenance, as the REST routes above.

hk_yield_curve(type="honia_ois")
// → curve points + provenance (as_of, source, raw_sha256)

Full machine-readable contract: OpenAPI spec + client SDKs on GitHub →