Skip to main content

Typed Coinbase

A fully typed, validated async client for the Coinbase API.

PyPI version Python versions Docs License



from typed_coinbase import Coinbase

async with Coinbase.new(public=True) as client:
  product = await client.app.advanced_trade.http.products.public.get('BTC-USD')
  print(product['price'])

Typed Coinbase covers two independent Coinbase product families under one client: Coinbase App (client.app, above — Consumer/Business v2 and Advanced Trade v3) and Coinbase Exchange (client.exchange, the institutional API formerly known as Pro/GDAX):

from typed_coinbase import Coinbase

async with Coinbase.new() as client:
  products = await client.exchange.http.products.list()
  print(products[0]['id'])

Each family has its own credentials, host, and setup guide — see API Keys Setup for App and Exchange API Keys Setup for Exchange.

The separate client.international namespace provides credential-free INTX instrument details, current quotes and funding history. It does not grant private INTX access. Native INTX symbols such as BTC-PERP differ from Advanced Trade's BTC-PERP-INTX product IDs.

from typed_coinbase import Coinbase

async with Coinbase.new(public=True) as client:
  instrument = await client.international.instruments.get('BTC-PERP')
  print(instrument['quote']['mark_price'], instrument['open_interest'])
  page = await client.international.instruments.funding('BTC-PERP', result_limit=100)
  print(page['results'][0]['event_time'])

funding_paged walks retained history using retryable offset pages. New funding events can move offsets during a walk; the API does not provide an atomic snapshot. Instrument prices and quantities are Decimal; native JSON-number margin ratios remain float. funding_interval is an integer duration in nanoseconds, not a timestamp, and the nested quote's timestamp is an aware datetime.

Why Typed Coinbase?

  • 🎯 Precise Types: every endpoint's inputs and responses are typed, from Coinbase App's v2 wallets and Advanced Trade's v3 order configurations to Exchange's order book and order-lifecycle shapes, not dict/Any.
  • ✅ Runtime Validation: every response is validated against its declared schema by default, across App and Exchange alike.
  • ⚡ Async First: async HTTP and WebSocket streaming, built for concurrent workflows across app's two WebSocket connections and Exchange's single WebSocket Feed.
  • 📚 Full Surface: every documented Coinbase App, Advanced Trade, and Coinbase Exchange endpoint, not just the popular ones.

Installation

pip install typed-coinbase

How To

Reference

Design Philosophy

Typed Coinbase follows the principles outlined in this blog post.

Details matter. Developer experience matters.

License

MIT — see LICENSE.

Release files for typed-coinbase 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typed-coinbase 0.4.0
File Size Uploaded
typed_coinbase-0.4.0.tar.gz 164.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for typed-coinbase 0.4.0
File Interpreter ABI Platform
typed_coinbase-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 493.3 kB

Release files / typed_coinbase-0.4.0.tar.gz

Download URL typed_coinbase-0.4.0.tar.gz
Size 164.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a2fa9edb31049c945ddcb05523a83a83b7d0d327afc72c1ff38a07b51716327e
BLAKE2b-256 checksum
How to use checksums
5f7822530f8ce964cdc2288a8f1f3d6d7917c4623dbb541984cd7408d7ec90cb
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 Sep 10, 2026.

Transparency log

Release files / typed_coinbase-0.4.0-py3-none-any.whl

Download URL typed_coinbase-0.4.0-py3-none-any.whl
Size 329.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d3a23ed72301c6bcdb877294aa6ad331aab6b283145306343086bee50e9f02f
BLAKE2b-256 checksum
How to use checksums
2485849ede024be4c3403151e792261f5a8427f08270b198a21b7afebe662e53
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 Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page