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.5.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.5.0
File Size Uploaded
typed_coinbase-0.5.0.tar.gz 164.3 kB Details

Built distribution (wheel)

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

Total release size: 493.4 kB

Release files / typed_coinbase-0.5.0.tar.gz

Download URL typed_coinbase-0.5.0.tar.gz
Size 164.3 kB
Tags Source
SHA-256 checksum
How to use checksums
51d506baf06be1b284a7cc5f59f0bc0a49686ef20da6f2c41bb00adc1720f938
BLAKE2b-256 checksum
How to use checksums
328b2e9de8d4f507036ec2a3508c12cfdbc440e2c827233d2edb954c2b0dba60
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 20, 2026.

Transparency log

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

Download URL typed_coinbase-0.5.0-py3-none-any.whl
Size 329.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3f5d21554e68002799e99beda8c0d25a616f366fb105d4633e230c5b2dc821c
BLAKE2b-256 checksum
How to use checksums
0d938d6e85a10507214060e6262c52de2148e3eb47ff0edbbe3f2e2005547096
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 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

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