API

Documentation for the Variational public API

Read-only Quickstart (Testnet)

1. Create API credentials

Navigate to the API settings page at https://pro.testnet.variational.io/app/settings

Add a descriptive label, create your key, and make sure to save the secret as it's only displayed once.

2. Install the Python SDK

pip install variational

3. Make some requests!

from variational import Client, TESTNET
from pprint import pprint

# FIXME: load from environment variables
API_KEY = "your-api-key"
API_SECRET = "your-api-secret"

client = Client(API_KEY, API_SECRET, base_url=TESTNET)
summary = client.get_portfolio_summary().result
pprint(summary)

Note: if you have a lot of trades in the account, it might make multiple requests and significant amount of time to fetch all of them. See Pagination for potential debugging steps.

Client parameters:

  • key: str (required) — your API key

  • secret: str (required) — your API secret

  • base_url: str (optional) — prefix of Variational API endpoints

  • request_timeout: float (default=None) — timeout for individual HTTP requests

  • retry_rate_limits: bool (default=True) — enables automatic retry on HTTP 429 errors

You can choose one of the two base URLs:

MAINNET = "https://api.variational.io/v1"
TESTNET = "https://api.testnet.variational.io/v1"

4. Explore

Visit the Endpoint Reference to learn which API calls are supported.

Read about the Pagination mechanism used by the Variational API.

Learn how Rate Limits and Authentication are applied to your calls.

Last updated