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")
from vanda import VandaClient

# Pass credentials directly
with VandaClient(email="your_email@example.com", password="your_password") as client:
    data = client.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.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.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

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.1.tar.gz (20.2 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.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vanda_api-0.1.1.tar.gz
  • Upload date:
  • Size: 20.2 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.1.tar.gz
Algorithm Hash digest
SHA256 275c80ea6a1dfffb54095e40a09665e6cda0edb35d8508ea65d99d9b3e8d8432
MD5 362315dcb85120997b32113ad4e77899
BLAKE2b-256 44b17df62539bc687b9e623f8a6e16979f6a0b9b79f3a6de207f358cc79a4ee2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vanda_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33da624755cdf46697363dce0daa9ea19ab61d834096df84bb3b55a1f4667631
MD5 e13b290031f5d0617dd31790571d2caa
BLAKE2b-256 716b748e7499171f2f819b4042d1164e1c8d3676bd11f0bdd1d05ae7eacdccdc

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