Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console

Issue data API key

Developer Platform, Sandbox & Key Management

POST

/api-keys/data-key

Issue data API key

Sandbox unsupportedcreateDataKey

Issues a new read-only data API key. Only one data key can be active at a time — calling this again rotates the existing key. ⚠️ Prefer server-side use. An embedded pk_data_ key can be extracted from any client bundle, shares the parent full key's rate-limit bucket, and rotating it (or calling this endpoint again) breaks every shipped install (only one is active per partner). For production apps, proxy market data through your backend or use short-lived tokens from POST /oauth/token; reserve embedded data keys for low-stakes surfaces such as public widgets.

Parameters

This endpoint has no path or query parameters.

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Idempotency-KeystringheaderRequired

Unique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.

Example: dep_user42_1743152580

Response fields

dataKeystring

Example: "pk_data_a1b2c3d4e5f6"

notestring

One-time display and client-embedding security guidance.

Response codes

201Data key issued.