Documentation Index
Fetch the complete documentation index at: https://docs.vectrade.io/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Optional extras:
pip install vectrade[telemetry] # OpenTelemetry integration
pip install vectrade[pandas] # DataFrame helpers
Quick Start
from vectrade import VecTrade
client = VecTrade() # reads VECTRADE_API_KEY env var
quote = client.quotes.get("AAPL")
print(f"{quote.symbol}: ${quote.price}")
Async Client
from vectrade import AsyncVecTrade
async def main():
client = AsyncVecTrade()
quote = await client.quotes.get("AAPL")
print(f"{quote.symbol}: ${quote.price}")
Configuration
client = VecTrade(
api_key="vq_live_...", # or VECTRADE_API_KEY env var
base_url="https://...", # custom endpoint
timeout=30, # request timeout (seconds)
max_retries=2, # automatic retries on 429/5xx
sandbox=True, # use sandbox environment
)
Resources
All 11 API resource groups are available:
| Resource | Methods |
|---|
client.quotes | get(symbol), batch(symbols) |
client.fundamentals | get(symbol), income_statement(symbol), balance_sheet(symbol) |
client.technicals | get(symbol, indicators, interval) |
client.news | list(symbols, limit), get(id) |
client.screener | screen(filters, limit) |
client.ai | analyze(prompt) — supports streaming |
client.options | chain(symbol, expiration), expirations(symbol) |
client.analyst | consensus(symbol), price_targets(symbol), ratings(symbol) |
client.earnings | history(symbol), calendar() |
client.insider | transactions(symbol), summary(symbol) |
client.webhooks | create(url, events), list(), delete(id) |
Streaming
for chunk in client.ai.analyze("Analyze AAPL", stream=True):
print(chunk.content, end="")
for article in client.news.list(limit=100):
print(article.title)
# Automatically fetches next pages
Middleware
from vectrade.telemetry import OpenTelemetryMiddleware
client = VecTrade(middleware=[OpenTelemetryMiddleware()])
Webhooks
from vectrade import Webhooks
event = Webhooks.verify(payload, headers, secret)
Error Handling
from vectrade import RateLimitError, NotFoundError
try:
quote = client.quotes.get("INVALID")
except NotFoundError as e:
print(f"Not found: {e} (request_id: {e.request_id})")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
Requirements
- Python 3.9+
- Dependencies:
httpx, pydantic
GitHub
Source code, issues, and contributions