Skip to main content

Official Python SDK for Vanda Analytics Data API

Project description

Vanda Analytics Data API SDK

Official Python SDK for the Vanda Analytics Data API.

Installation

pip install vanda-api

For pandas support:

pip install vanda-api[pandas]

Quick Start

Synchronous Client

from datetime import date
from vanda import VandaClient

with VandaClient(token="YOUR_TOKEN_HERE") as client:
    data = client.series.get_timeseries(
        symbol="TSLA",
        start_date=date(2025, 12, 1),
        end_date=date(2025, 12, 31),
        fields=["retail_net_turnover", "retail_buy_turnover"],
    )
    print(f"Retrieved {len(data)} records")
from vanda import VandaClient

# Pass credentials directly
with VandaClient(email="your_email@example.com", password="your_password") as client:
    data = client.series.get_timeseries(
        symbol="TSLA",
        start_date="2025-12-01",
        end_date="2025-12-31",
        fields=["retail_net_turnover"],
    )

Recommended to use environment variables

export VANDA_LOGIN_EMAIL="your_email@example.com"
export VANDA_PASSWORD="your_password"

Asynchronous Client

import asyncio
from datetime import date
from vanda import AsyncVandaClient

async def main():
    async with AsyncVandaClient(token="YOUR_TOKEN_HERE") as client:
        data = await client.series.get_timeseries(
            symbol="TSLA",
            start_date=date(2025, 12, 1),
            end_date=date(2025, 12, 31),
            fields=["retail_net_turnover"],
        )
        print(f"Retrieved {len(data)} records")

asyncio.run(main())
import asyncio
from vanda import AsyncVandaClient

async def main():
    async with AsyncVandaClient(email="your_email@example.com", password="your_password") as client:
        data = await client.series.get_timeseries(
            symbol="TSLA",
            start_date="2025-12-01",
            end_date="2025-12-31",
            fields=["retail_net_turnover"],
        )

asyncio.run(main())

Recommended to use environment variables

export VANDA_LOGIN_EMAIL="your_email@example.com"
export VANDA_PASSWORD="your_password"

Authentication

Set your API token via environment variable:

export VANDA_API_TOKEN="your_token_here"

or

export VANDA_LOGIN_EMAIL="your_email@example.com"
export VANDA_PASSWORD="your_password"

Or pass directly:

client = VandaClient(token="your_token_here")

or

client = VandaClient(email="your_email@example.com", password="your_password")

Features

  • Sync and async clients with consistent interfaces
  • Automatic retry with exponential backoff
  • Comprehensive error handling
  • Job polling for async operations
  • Export utilities (CSV, JSONL)
  • Optional pandas support
  • Type hints throughout

API Methods

Timeseries Data

  • get_timeseries() - Get timeseries for a single symbol
  • get_timeseries_many() - Get timeseries for multiple symbols
  • get_leaderboard() - Get ranked leaderboard data

Bulk Operations

  • bulk_securities() - Bulk fetch securities data
  • get_daily_snapshot() - Get daily snapshot for many securities

Job Management

  • create_bulk_securities_job() - Create async job
  • poll_job() - Poll job until completion
  • get_job_status() - Get job status
  • export_job_result() - Export job result to file
  • stream_job_result() - Stream job result to file

Export Operations

  • export_timeseries() - Export timeseries to file

Metadata

  • list_fields() - List available fields
  • list_intervals() - List available intervals
  • list_securities() - List available securities

Aggregates Timeseries Data

  • get_timeseries() - Get timeseries for multiple aggregate id's
  • get_constituents() - Get constituents using Vanda identifier

Examples

See examples/ directory for complete usage examples.

Requirements

  • Python 3.9+
  • httpx

Development

git clone https://gitlab.com/yourusername/vanda-api.git
cd vanda-api
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pre-commit install
pytest

Migration Guide (From v0.1.2 to v1.0.0)

Old: client.get_timeseries() client.get_timeseries_many() client.get_leaderboard() client.create_bulk_securities_job() client.bulk_securities() client.get_daily_snapshot() client.get_job() client.get_job_status() client.poll_job() client.wait_for_job() client.export_job_result() client.stream_job_result() client.export_timeseries() client.list_fields() client.list_intervals() client.list_securities()

New: client.series.get_timeseries() client.series.get_timeseries_many() client.series.get_leaderboard() client.series.create_bulk_securities_job() client.series.bulk_securities() client.series.get_daily_snapshot() client.series.get_job() client.series.get_job_status() client.series.poll_job() client.series.wait_for_job() client.series.export_job_result() client.series.stream_job_result() client.series.export_timeseries() client.series.list_fields() client.series.list_intervals() client.series.list_securities()

License

MIT License - see LICENSE file for details.

Support

For issues and questions, please open an issue on GitLab.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vanda_api-1.0.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vanda_api-1.0.0-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file vanda_api-1.0.0.tar.gz.

File metadata

  • Download URL: vanda_api-1.0.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for vanda_api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1837c796c98828db86d65d7c0e355192acfb9c5d0981de4f54fde804226478c4
MD5 78d72b32dd035b262af8761f92c120d4
BLAKE2b-256 ce0a642d45f54008d9049d385af95810cdec5c1e3b4a0b43ee0161f92acbee5f

See more details on using hashes here.

File details

Details for the file vanda_api-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vanda_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for vanda_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2066e46bf89dc8ee886041e1dd1c0f2b3ac8d14e2c74f3e92dcae0bcaa138c9e
MD5 8f593ff36ac674c0cfd03c961b7c9b71
BLAKE2b-256 1737b0250502ecb59817db2e14546008595db8b7a043ab5b17e6f9d4ba48f8ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page