Polaris SDKs
Rust, Python, and TypeScript clients for the Polaris API. Rust and Python share the Rust core; TypeScript supports Node.js and browsers. All three packages are named polaris-data, and the Python import is polaris_data.
Install
pip install polaris-data
cargo add polaris-data
npm install polaris-data
For Python Arrow batches or Pandas DataFrames, install polaris-data[arrow] or polaris-data[dataframe].
Quickstart
from polaris_data import PolarisClient
with PolarisClient(api_key="polaris_key_your_key") as client:
for trade in client.trades(source="binance", market="BTC-USDT"):
print(trade["price"], trade["quantity"])
import { PolarisClient } from "polaris-data";
const client = new PolarisClient({ apiKey: "polaris_key_your_key" });
const trades = await client.trades({ source: "binance", market: "BTC-USDT" });
console.log(trades[0]?.price);
client.close();
use futures_util::StreamExt;
use polaris_data::{HistoricalRowsQuery, PolarisClient};
# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let client = PolarisClient::builder().build()?;
let mut trades = client.trades(HistoricalRowsQuery {
source: Some("binance".into()),
market: Some("BTC-USDT".into()),
..Default::default()
}).await?;
while let Some(row) = trades.next().await {
println!("{}", row?.price);
}
# Ok(())
# }
Historical methods
All direct historical methods fetch every cursor page. Their start and end filters are inclusive Unix milliseconds; omitted bounds use the API default window where the route permits it. Older ranges may require an API key.
| Rust / Python | TypeScript | API route | Result |
|---|---|---|---|
trades |
trades |
/trades |
Flat trade rows; optional exact instrument |
events |
events |
/events |
Authenticated mixed {type, data} flat rows in collector-time order |
option_tickers |
optionTickers |
/options-ticker |
Flat option observations; optional exact instrument |
funding_rates |
fundingRates |
/funding-rates |
Flat partial funding observations with nullable fields |
perpetual_tickers |
perpetualTickers |
/perpetual-ticker |
Funding-bearing observations; not a complete ticker stream |
intents |
intents |
/intents |
Single input/output asset observations |
l2_updates |
l2Updates |
/l2-updates |
Flat source snapshots and sparse deltas |
l2_snapshots |
l2Snapshots |
/l2-orderbooks |
Reconstructed, sorted top-25 books after each update |
ohlcv |
ohlcv |
/ohlcv |
Every venue-published candle update as a flat row |
raw |
raw |
/raw |
Paged raw captures for a source; optional exact market and channel |
raw_channel |
rawChannel |
/raw with channel |
Exact captures from one native channel; optional market |
Python returns iterators by default and supports Arrow batches or Pandas DataFrames on methods with an output option. Rust uses async streams and also offers a blocking facade. TypeScript returns arrays. catalog, count, instruments, health, meta, and realtime stream remain available. meta returns public documentation, OpenAPI, skill, health, and stream links. All three SDKs offer raw for a source with optional market and channel filters, plus raw_channel / rawChannel as a channel-specific convenience. Both use the paged JSON /raw route. Rust and Python infer a recent seven-day window when raw bounds are omitted, leaving a one-minute margin inside the public cutoff for anonymous requests; TypeScript requires inclusive millisecond start and end. The SDKs send RFC 3339 time query parameters. The market filter matches the capture's recorded additional_context.market exactly; it does not search original_json. Raw responses include raw_table. Recent raw history is public, while older ranges may require an API key.
For Rust trades, use TradeRowsQuery to select an instrument; existing HistoricalRowsQuery calls remain supported.
ohlcv uses optional source, market, instrument, interval, start, and end filters. Its inclusive bounds refer to candle open time. It preserves every published revision, so multiple rows can share an open_timestamp. TypeScript's ohlcvTradingView remains a derived latest-revision view.
l2_snapshots refers to reconstructed L2 books, not the removed /snapshots API. Its source, market, start, and end inputs are required. The book rows contain at most 25 levels per side. OrderbookBuilder still accepts realtime event envelopes.
Breaking changes
The SDKs no longer expose replay, list_snapshots / listSnapshots, or the snapshot-backed propamm_quote_ladders / propammQuoteLadders. TypeScript also removes getSnapshotDownloadUrls. Rust and Python remove their cross-channel raw_replay variants; Python's replay(standard=False) disappears with replay. The channel-specific raw_channel / rawChannel method remains.
Use the matching direct data method for flat rows and raw or raw_channel / rawChannel for exact raw captures. The new events method requires an API key and inclusive start and end collector timestamps in Unix milliseconds. It returns mixed flat rows with typed data, not the former snapshot event envelopes. The API also has /quotes, which these SDKs do not yet wrap. These SDKs no longer call /snapshots or /download.
The API moved data routes from /historical/* to top-level paths. The old routes no longer work. It also replaced /raw/{exchange}/{event} with /raw?source=...&channel=...; raw responses now include raw_table, and the server supports paged JSON rather than file export.
Rust RawQuery.market is now optional and RawQuery.channel is new; RawChannelQuery.market is also optional. Python raw(market=...) is optional and accepts channel=.... TypeScript adds raw() with required inclusive millisecond bounds. Existing channel-specific methods also accept an optional exact market filter.
The clients also remove bbo, Rust bbo_changes, depth_metrics / depthMetrics, intent_rows / intentRows, ohlcv_rows / ohlcvRows, quote_rows / quoteRows, volume, vwap, volatility, and mark_prices / markPrices. These methods may return in a later release.
The snapshot-backed methods' allow_gaps and local replay cache options are removed. All three SDKs no longer create a local snapshot directory. Rust removes dataset_root from both builders, the dataset_root, cache_dir, and daily_dir accessors, the old aggregate query/result types, and decode_ndjson_file. Python removes dataset_root, replay_cache_enabled, and replay_cache_dir constructor options. TypeScript removes datasetRoot, storage, and snapshotDownloadConcurrency constructor options. The unused Python native decode_file helper and TypeScript snapshot-era query/aggregate types are also removed.
ohlcv now returns flat OhlcvRow values, with inclusive Unix-millisecond start and end inputs. Rust's former OhlcvQuery and Python's from_, to, format, and allow_gaps inputs no longer apply to the method. Python uses output="iterator", "batches", or "dataframe"; TypeScript accepts the direct row filters. Existing code expecting collapsed bars must handle candle revisions explicitly.
Tests
cargo test -p polaris-data
uv run --with maturin maturin develop --manifest-path crates/polaris-python/Cargo.toml
uv run pytest
cd typescript && npm test
Metadata
Release files for polaris-data 0.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polaris_data-0.17.0.tar.gz | 64.6 kB | With provenance | Details for polaris_data-0.17.0.tar.gz |
Built distributions (wheels)
Total release size: 24.8 MB
Release files / polaris_data-0.17.0.tar.gz
| Download URL | polaris_data-0.17.0.tar.gz |
|---|---|
| Size | 64.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3846a070899f102c3cd00c5be33ecce6bc232bc4157c6a45c13308bf1a03a9e3
|
|
BLAKE2b-256 checksum How to use checksums |
1afc3306af8f7df191e5aad4921e6020b92cdc29c4181953c93579a85877ce46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-win_arm64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ce75cf3698703a5076fed6305f724b26c1afb0d8c0d50b2daa90409c8b78b64c
|
|
BLAKE2b-256 checksum How to use checksums |
d547825a1cabcc6ac416488ed8a69add3c5111704bf8b37923355925959bf227
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-win_amd64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e97311f7d6fbe76ca6da6819b29cf38959136be5e829dbf9f6f601cfad78367f
|
|
BLAKE2b-256 checksum How to use checksums |
4b2d47070f4d40ecd1fcfd12357cca8b3f4cdb81f001678408fd527381ec4a24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0d2a2537bb0d051125c5d24ae5fbc4f20ea391928da7e342578864d6d485c5ad
|
|
BLAKE2b-256 checksum How to use checksums |
be294553b268cb8749aec4a39e0bb704d10912885e778919c3ab11e7901b6906
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c609237bad4e2e6411b15e8537cc92b1a28b773f3cba2c37295bce92a6fffc1b
|
|
BLAKE2b-256 checksum How to use checksums |
9a268ebc5ea5baa4af8293356bb66fabcad572abaa154bec739c22b9a350e25f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
83c81795e3ddddec7fca0679f870c46f08f007d8f183dd124f791b7dcb7c93dd
|
|
BLAKE2b-256 checksum How to use checksums |
55af19fd4106472b0eaf033584b36d5c5db194bb466e176caadd25ed62032187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
9382c2fb8631d5dc6d5ec2571811670650fc4a51517398de3d4a5da8a3986e93
|
|
BLAKE2b-256 checksum How to use checksums |
d7c40bc76a88e23064920b75fda00f03e49dd3bc65671aa9752c7bba4dd10d24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b176ec5b0bb757342e848a107c028edf2f78a0fdddfe35abbe99e5e3dd59492d
|
|
BLAKE2b-256 checksum How to use checksums |
301488ea973447093b03083ce9a10d0c9724225cbaea83dd99c556cd1e4fa4ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / polaris_data-0.17.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | polaris_data-0.17.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c35b4c87810c9e2ec1eb2b48326c231a3c242752170a45e60d56c16f9e1451e7
|
|
BLAKE2b-256 checksum How to use checksums |
52c1c4ace381f77b3c1c167da22062a65c53a001847850c13be1da25202c6388
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logSecurity for polaris-data 0.17.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for polaris_data-0.17.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.