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.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")

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.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())

Authentication

Set your API token via environment variable:

export VANDA_API_TOKEN="your_token_here"

Or pass directly:

client = VandaClient(token="your_token_here")

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

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

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-0.1.0.tar.gz (14.1 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-0.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vanda_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 81611d241d31842476e7f93cd1a71d33d0eeb41a7dd00a2476a58f0695a98709
MD5 0f91e3fef0d080ffe6e9675fa5006e2a
BLAKE2b-256 738ada54e9363f6d8efee3627a032d1f7235045b4d344ee317c380597e9861c0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vanda_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0789cefa6d45f9bcb85f7a72ad6c7e51164d50b8f794da155dda7df42c842ce
MD5 9fdb52001201c6e79246c64d83919080
BLAKE2b-256 d2be9e88ad884374a9c014766c6e35b3875e487fdec75afcb0d9113fa20c62bc

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