Synpath – One API for prediction markets 
Build on prediction markets without building against each one.
One open-source API across Kalshi, Polymarket, Polymarket US and Opinion: market data, order entry, live streams, and an execution engine that remembers what it sent. In-process from Python, over REST and WebSocket from anywhere.
🆕 New: free tick-level Kalshi order book history.
Every public Kalshi market, full depth, every change and every trade, straight from Kalshi's live feed. Sign up from your terminal and query it in one line of Python. Get it in 60 seconds ↓
⭐ Star Synpath on GitHub if the data saves you money. Stars are how we decide what to open up next.
Free Kalshi tick data in 60 seconds
1. Install
pip install synpath
2. Sign up: opens Google sign-in in your browser, then returns to the terminal. Free, no card.
synpath login
3. Create your API key: it's saved on your machine and Python picks it up automatically.
synpath keys create my-laptop
4. Query any moment
import synpath
t = 1790776800000 # any moment, in Unix milliseconds
# The full book exactly as it stood at that millisecond
snap = synpath.fetch_order_book_at("kalshi:KXQUANTUM-30", as_of_ms=t)
print(snap.book.bids[0].price, snap.book.asks[0].price, len(snap.book.bids), "bid levels")
# Every change over an hour: a starting book, then each update in arrival order
changes = synpath.fetch_order_book_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
# Every trade: price, size and taker side
trades = synpath.fetch_trades_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
No silent gaps: if we weren't recording at a moment, you get the reason instead of an empty book. Up to an hour per request; plain HTTP works too (Authorization: Bearer <key>). More: synpath.dev/tick-data · API reference
⭐ Free data stays free as long as people use it. If this saves you a data bill, star the repo. It takes one click and it's how other traders find it.
Also new: smart order routing across Kalshi and Polymarket. One order, both order books combined, filled from the cheapest price after fees. See how it works →
Supported Exchanges
| Exchange | id | Market data | Order entry | Streams | Order books | |
|---|---|---|---|---|---|---|
| Kalshi | kalshi |
✓ | ✓ | WebSocket | one book per market, both sides read it | |
| Polymarket | polymarket |
✓ | ✓ | WebSocket | one book per outcome token | |
| Polymarket US | polymarket_us |
✓ | ✓ retail and exchange APIs | WebSocket and gRPC | one book per market, both sides read it | |
| Opinion | opinion |
✓ | ✓ | WebSocket (API key) | one book per outcome token | |
| Hyperliquid | hyperliquid |
✓ outcome markets (HIP-4) | ✓ | WebSocket (no key) | one book per market, both sides read it | |
| predict.fun | predict_fun |
✓ (API key) | ✓ | WebSocket (API key) | one book per market, both sides read it | |
| Limitless | limitless |
✓ | ✓ | WebSocket | one book per market, both sides read it | |
| SX Bet | sx_bet |
✓ sports | ✓ | WebSocket | one book per market, both sides read it |
Why Synpath
-
Liquidity is fragmented. Your time shouldn't be. The same market trades on Kalshi, Polymarket, Polymarket US and Opinion, each with its own API, units and quirks. Synpath gives you one interface for all of them, and smart order routing buys from whichever book is cheapest. Spend your time on alpha, not plumbing.
-
Traders deserve advanced order types. Stops, trailing stops, icebergs, OCO, brackets, TWAP and pegs, on every venue, even where the exchange has none. Orders are journaled before they're sent, so a crash never places one twice.
-
A home after Dome and pmxt. Dome's API shut down in April 2026, and pmxt hasn't shipped since July 2026. Synpath is MIT-licensed, actively maintained, and follows ccxt conventions.
Installation
pip install synpath # market data, order entry, streams, the engine and the server
pip install "synpath[grpc]" # + Polymarket US exchange gRPC streams
Python 3.10 or newer. The hot paths (order books, reading the venues' book streams, order signing and the order router) run on a Rust core that ships prebuilt inside the wheel for Linux, macOS and Windows; nothing else to install.
Hosted API. Run synpath login, then synpath keys create (step by step ↑). It serves tick-level Kalshi order book and trade history, and cross-venue market matching. Trading stays on your machine: Synpath never holds your keys or funds.
Quick Start
Markets and quotes
import synpath
kalshi = synpath.Kalshi()
market = kalshi.fetch_markets(limit=1)[0]
print(market.title) # Will Elon Musk visit Mars before Aug 1, 2099?
print(market.yes.quote.bid, market.yes.quote.ask) # 0.1 0.12
Order books and search
book = kalshi.fetch_order_book(market.id, depth=5)
book.best_bid, book.best_ask # best first on both sides
kalshi.fetch_order_book(market.id, side="no") # what NO costs
markets = kalshi.fetch_markets(query="trump", limit=10)
fee = kalshi.fetch_fee_schedule(markets[0].id)
fee.estimate(price=0.50, contracts=100) # 1.75
Same code, every venue
for venue_id in synpath.exchanges: # ['kalshi', 'polymarket', 'polymarket_us', 'opinion', 'hyperliquid', 'predict_fun', 'limitless', 'sx_bet']
with synpath.exchange(venue_id) as venue:
page = venue.fetch_markets(limit=5)
client = synpath.Client() # or one client, routed by the id
client.fetch_market("polymarket:2252244") # every id starts with its venue
Order entry
from decimal import Decimal
from synpath import KalshiTrading, OrderRequest, Side, load_credentials, require
async with KalshiTrading(require("kalshi", load_credentials())) as kalshi:
order = await kalshi.create_order(OrderRequest(
market_id=market.id, side=Side.BUY, # buy takes YES, sell takes NO
amount=Decimal("10"), price=Decimal("0.42"), # always the YES price
))
Live streams
from synpath import PolymarketMarketStream, BookEvent
async with PolymarketMarketStream() as stream:
await stream.watch_order_book(["polymarket:2252244"]) # both sides of the market
async for event in stream:
if isinstance(event, BookEvent):
print(event.market_id, event.side, event.best_bid, event.best_ask)
Cross-venue matching: the same market on other venues
synpath.match_market("kalshi:KXHIGHTATL-26SEP23-B80") # .matched: the same question on another venue, or None
synpath.match_event("kalshi:KXHIGHTATL-26SEP23") # each venue's events on the same event
Matching is hosted at api.synpath.dev and needs a Synpath API key (synpath login, then synpath keys create). A match is a deterministic parse both listings land on, not a similarity score, and side_map says when one venue asks the question the other way round. Crypto up-or-down markets are never matched, since each venue sets its own price to beat. Browse matched events at synpath.dev; API: match a market, match an event.
Smart order routing: one order across Kalshi and Polymarket
from synpath import Bucket, BucketMember, OrderType, PolymarketTrading
from synpath.engine import Engine, EngineConfig
creds = load_credentials()
async with KalshiTrading(require("kalshi", creds)) as kalshi, \
PolymarketTrading(require("polymarket", creds)) as poly, \
Engine({"kalshi": kalshi, "polymarket": poly}, EngineConfig(journal_path="trading.db")) as engine:
# The same market on both venues; flip=True where a venue asks the question the other way round
bucket = await engine.save_bucket(Bucket(book="alpha", name="Fed cut in December", members=[
BucketMember(market_id="kalshi:KXFEDDECISION-26DEC-C25"),
BucketMember(market_id="polymarket:2252244", flip=True),
]))
# Both order books combined, each level net of fees, filled from the cheapest price outward
await engine.submit(OrderRequest(
market_id=bucket.market_id, side=Side.BUY, amount=Decimal("500"),
type=OrderType.MARKET, price=Decimal("0.45"), # the worst price you accept
book="alpha",
))
REST server
python -m synpath.server # http://127.0.0.1:8000/docs
curl "localhost:8000/venues/kalshi/markets?limit=1"
Trading has its own app, with per-account keys and an append-only audit log:
python -m synpath.server bootstrap --control control.db # the first key
python -m synpath.server schema --trading --out openapi.json
npx openapi-typescript openapi.json --default-non-nullable false -o src/synpath.d.ts
Documentation
See the API Reference for detailed documentation and more examples.
Development
git clone https://github.com/Synpath-ai/synpath
cd synpath
pip install -e ".[dev]" # builds the Rust core too: needs a Rust toolchain (rustup.rs)
pytest # offline, against recorded venue payloads
pytest -m live # market data against the real venues
pytest -m demo # order entry on a venue's demo environment
SYNPATH_PURE_PYTHON=1 pytest # the same tests on the pure-Python fallback
cargo test -p synpath-core # the Rust core on its own
The Rust core lives in crates/synpath-core (pure Rust) and
bindings/python (its PyO3 wrapper, built as synpath._core). Every class
it provides has a pure-Python twin with the same interface, and the library
uses the twin when the extension is not built. Venue adapters are plain
Python: adding a venue needs no Rust.
The demo tests place and cancel real orders on a demo exchange with the
credentials in your environment, and leave the account flat. python -m synpath.trading doctor says which venues are configured without printing a
secret.
Prior Art
ccxt set the conventions this library follows.
License
MIT
Metadata
Release files for synpath 0.7.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 | |
|---|---|---|---|
| synpath-0.7.0.tar.gz | 477.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| synpath-0.7.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| synpath-0.7.0-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| synpath-0.7.0-cp310-abi3-musllinux_1_2_aarch64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ ARM64 | Details |
| synpath-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| synpath-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| synpath-0.7.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| synpath-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 7.9 MB
Release files / synpath-0.7.0.tar.gz
| Download URL | synpath-0.7.0.tar.gz |
|---|---|
| Size | 477.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfccf256e83cfd8890a8dc441a88774714f06c0941b89453ce51d69deb23dfd1
|
|
BLAKE2b-256 checksum How to use checksums |
3e93aa00a05878f5d1f2a500b2f77fbe154984ec4c5c790db9c5108fcd795983
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-win_amd64.whl
| Download URL | synpath-0.7.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 920.1 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1458e365df0e4c29e26e479d1e314e9d9b4cd1f2c7c7e386121bc741447893fe
|
|
BLAKE2b-256 checksum How to use checksums |
d3b85cea9fe61c469c256091d4efc89c9c3d012545b41feee8712795e147152e
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | synpath-0.7.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1d7abbcfa9d544375d4e39e7688f78c4aa0aabfacb490b72c9a91d82d7bd8634
|
|
BLAKE2b-256 checksum How to use checksums |
11bcae97854050a67f37e59a62c7505af63dd977334adf3803a8e76e8d48d6c0
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | synpath-0.7.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
de0743c331fab6e61362b5769479352de97cb2fa69e3b77d15529f8d66b7968e
|
|
BLAKE2b-256 checksum How to use checksums |
8032baca115a54ffd3e6f399a942b430e172ca0cbfbf5b5a1725fe7728c02350
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | synpath-0.7.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
23600dc8ff04484f12c093e9a7ce1277906cf8b65d400f6648c6112a7b587ebd
|
|
BLAKE2b-256 checksum How to use checksums |
5e10809f762bb71ade7e3925627e126286daa3027fdcea388c3b6e04dac8cb15
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | synpath-0.7.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
26fbc63a8619381180f6027f0a517a8fd6c6b83164aeaaa23cb8a2af4f9a037c
|
|
BLAKE2b-256 checksum How to use checksums |
8e96a09c3af6563e24bb25319400d9dbfc776eff4e1b4d39906ef3ecfd91a8c8
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | synpath-0.7.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 979.8 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
cf6d1330d684a253170c6aac6c1b286823852c80754b6cfa2a1f8d1815317d9e
|
|
BLAKE2b-256 checksum How to use checksums |
f87dd4e3038461baa859f822cecfbe9c9480d9217f51b6116c3e41b8717392b1
|
| 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 13, 2026.
Transparency logRelease files / synpath-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | synpath-0.7.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
05e9e9ae12089c7653c8c7ca1bb65667982ed217f61447220ab798b772e7cd46
|
|
BLAKE2b-256 checksum How to use checksums |
b21e36364211aa5d1645a4933ffa0ce32877f1193260679e3a179d58fd24066c
|
| 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 13, 2026.
Transparency log