Skip to main content

Quickstart

1. Get an API key​

Ask your administrator for an API key. The key looks like vmk_<id>_<secret>; the secret is shown only once, when the key is issued.

  • Treat it as a password: put it in an environment variable or a password manager, never in code, notebooks, Git or chat.
  • Use a separate key for an AI agent or automation so it can be revoked on its own.
  • Keys expire; see Limits for the default and maximum lifetime.
export VEINMESH_API_KEY='vmk_...'

The key also needs permission for what you read: history, live, export and book depth. Say what you need when you request it; API keys explains the permissions.

2. Check the key​

curl -s -H "Authorization: Bearer $VEINMESH_API_KEY" \
"https://data.cyberun.cloud/v2/catalog/venues"

Any valid key can read the catalog. "code":"unauthenticated" (401) means the key is wrong, expired or revoked; "code":"forbidden" (403) says which permission is missing. Other errors are in Errors.

3. Install the Python SDK​

The SDK needs Python 3.10 or newer.

pip install "veinmesh[all] @ https://data.cyberun.cloud/docs/sdk/veinmesh-0.2.0-py3-none-any.whl"
import veinmesh

client = veinmesh.Client() # reads VEINMESH_API_KEY

See Python SDK for installing only the extras you need.

4. Find an instrument​

rb = client.instruments(product="SHFE.rb", kind="future", status="active")
for instrument in rb[:5]:
print(instrument["symbol"], instrument["last_trading_day"])

If you already know the symbol, fetch it directly:

instrument = client.instrument("SHFE.rb2701")
print(instrument["instrument"]["symbol"], instrument["datasets"])

An empty datasets list means no data is published for that instrument yet.

5. Read your first data​

# 18-minute bars, starting at each trading session
k18 = client.bars("SHFE.rb2701", 1080, from_day="2026-10-01", to_day="2026-10-20").to_pandas()

# Daily bars of the main continuous rebar contract, price-difference adjusted
main = client.bars("SHFE.rb.main", "1d", from_day="2025-01-02", to_day="2026-10-20",
adjust="diff").to_pandas()

# Book snapshots for one trading day
snap = client.data("book.snapshot", "SHFE.rb2701", trading_day="2026-10-20",
fields=["last", "volume", "bid_px", "ask_px"]).to_pandas()

to_pandas() converts decimals to floats. Pass exact=True to keep Decimal values.

6. Go further​