Skip to main content

Add your description here

Project description

BullInv API Client (WebSocket + REST SDK)

Python SDK for streaming aggregate market data and indicators from BullInv WebSocket service, plus a simple REST client for QuestDB queries producing pandas DataFrames.

Defaults

  • Default WebSocket URL: wss://quote-ws.bullinv.tech
  • Subscriptions format: "<timespan>.<ticker>" (e.g., "15m.*", "1m.AAPL")

Install

pip install bullinv-api-client
# or with uv for local dev
uv venv && uv pip install -e .

WebSocket Authentication

  • Provide your API key to the client; the SDK sends the first auth frame automatically.
  • If the server responds with {"type":"error","message":"unauthorized"}, the SDK logs an error and closes the connection.

Sync client (polygon-style wrapper)

from bullinv_api_client import WebSocketClient, DataType

client = WebSocketClient(api_key="live_pk_9f3a2e1c4b7d")
client.subscribe("1m.AAPL", datatype=DataType.Aggregates)
client.run(lambda batch: print(batch))

Logging (to see auth failures)

import logging
logging.basicConfig(level=logging.INFO)

REST (QuestDB) Client

  • Base URL: https://questdb-api.bullinv.tech
  • Endpoint: /questdb/exe
  • Headers required (Cloudflare Access):
    • CF-Access-Client-Id
    • CF-Access-Client-Secret

Set credentials in a .env file in your working directory:

CF_ACCESS_CLIENT_ID=xxxxx
CF_ACCESS_CLIENT_SECRET=yyyyy

Usage to fetch daily candles as a pandas DataFrame:

from dotenv import load_dotenv
from bullinv_api_client import QuestDBClient

load_dotenv()
client = QuestDBClient()
df = client.get_daily_candles("AAPL", start_date="2024-01-01", end_date="2024-06-01")
print(df.head())

Example script:

python examples/pandas_daily_candles.py

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

bullinv_api_client-0.1.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

bullinv_api_client-0.1.2-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file bullinv_api_client-0.1.2.tar.gz.

File metadata

  • Download URL: bullinv_api_client-0.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for bullinv_api_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e36053d438c512ec1551933b7f34339cbcf3931e9150735ccee1e348af5d7b95
MD5 925d774d311e9d59a033edc8ade6ffad
BLAKE2b-256 aa8f1d78ed15c735941bffa5d5d168c9c4e6e79b4b25194bdf91d083b797142c

See more details on using hashes here.

File details

Details for the file bullinv_api_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bullinv_api_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c9fe6695c88b4567d806c39f1610255ac5ee6016a6291c565eae1d9af943a73c
MD5 42d8862092646dfb3fec97a1095c8ede
BLAKE2b-256 fa26edd05edec0d2848c31f556b5a257a40558eb6d4c2a5b618d48cbf7c3dd3f

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