HeyQuant early preview/Explore current availability

HEYQUANT / DOCUMENTATION

Restricted queries

Request data with SQL without assuming an unpublished response schema.

Request

client.query(sql) sends POST /query with a JSON body of {"sql": "…"}. The client forwards the string; the server restricts the read-only query scope.

import os
from heyquant import HeyQuantClient

with HeyQuantClient(
    base_url=os.environ["HEYQUANT_BASE_URL"],
    api_key=os.environ["HEYQUANT_API_KEY"],
) as client:
    result = client.query(
        "select trade_date, close "
        "from bars_stock_daily "
        "where symbol = '600519.SH' "
        "order by trade_date desc limit 5"
    )
    print(result)

Return value

On success, the method returns response.json(), currently typed as Any. The example prints the whole response without assuming rows, data or other unconfirmed fields.

Boundaries

The public client does not define a SQL subset, maximum row count, quota or pagination mechanism. The example’s limit 5 is not a service limit. Refer to the formal public service contract for availability.

Based on the public Python clientView source ↗