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 symbolget_timeseries_many()- Get timeseries for multiple symbolsget_leaderboard()- Get ranked leaderboard data
Bulk Operations
bulk_securities()- Bulk fetch securities dataget_daily_snapshot()- Get daily snapshot for many securities
Job Management
create_bulk_securities_job()- Create async jobpoll_job()- Poll job until completionget_job_status()- Get job statusexport_job_result()- Export job result to filestream_job_result()- Stream job result to file
Export Operations
export_timeseries()- Export timeseries to file
Metadata
list_fields()- List available fieldslist_intervals()- List available intervalslist_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
275c80ea6a1dfffb54095e40a09665e6cda0edb35d8508ea65d99d9b3e8d8432
|
|
| MD5 |
362315dcb85120997b32113ad4e77899
|
|
| BLAKE2b-256 |
44b17df62539bc687b9e623f8a6e16979f6a0b9b79f3a6de207f358cc79a4ee2
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33da624755cdf46697363dce0daa9ea19ab61d834096df84bb3b55a1f4667631
|
|
| MD5 |
e13b290031f5d0617dd31790571d2caa
|
|
| BLAKE2b-256 |
716b748e7499171f2f819b4042d1164e1c8d3676bd11f0bdd1d05ae7eacdccdc
|