Registry / payments / coinbase-advanced-py

coinbase-advanced-py

JSON →
library1.8.4pypypi✓ verified 25d ago

Official Coinbase Advanced Trade API Python SDK. Current version: 1.8.2 (Mar 2026). TWO deprecated packages to avoid: 'coinbase' (old Coinbase Commerce SDK, EOL) and 'cbpro' (Coinbase Pro, discontinued). The correct package is 'coinbase-advanced-py'. Uses CDP (Coinbase Developer Platform) API keys with EC private key format — NOT the old HMAC API key format. Import is 'from coinbase.rest import RESTClient'.

pip install coinbase-advanced-py
INSTALL
IMPORT
SIG · COINBASE-ADVANCED-
C
coinbase-advanced-py
paymentspythonv1.8.4
Install
4.0s avg
Import
476ms
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.8.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.494s · 40.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.458s · 41MB
39MB installed
● package 39MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RESTClient
from coinbase.rest import RESTClient
from coinbase.rest import RESTClient

Coinbase Advanced Trade Python SDK — accounts, product info, and market order.

# pip install coinbase-advanced-py from coinbase.rest import RESTClient # From CDP dashboard: Advanced Trade API key client = RESTClient(key_file='cdp_api_key.json') # Get accounts accounts = client.get_accounts() for acct in accounts['accounts']: print(acct['name'], acct['available_balance']['value']) # Get BTC-USD product info product = client.get_product(product_id='BTC-USD') print(product['price']) # Place market buy ($10 of BTC) order = client.market_order_buy( client_order_id='', # auto-generate product_id='BTC-USD', quote_size='10' ) print(order['success'])
Debug
Known issues
breakingPackage name is 'coinbase-advanced-py' but import is 'from coinbase.rest import RESTClient'. The 'coinbase' PyPI package is a completely different old SDK (Coinbase Commerce). Do not confuse them.
fix
pip install coinbase-advanced-py; from coinbase.rest import RESTClient
affects: all
breakingCoinbase Pro (cbpro) discontinued. All LLM and tutorial code using cbpro or the old Coinbase Pro API is broken. Migrate to coinbase-advanced-py.
fix
pip install coinbase-advanced-py. Migration guide at docs.cdp.coinbase.com
affects: all
breakingCDP API keys use EC private key format (PEM). Old HMAC-based API keys (key + secret string) are not compatible with coinbase-advanced-py. Must generate new CDP keys.
fix
Generate CDP API key from developer.coinbase.com — downloads a JSON file with name and privateKey fields.
affects: all
gotchaclient_order_id must be unique per order. Setting to empty string '' auto-generates a UUID. Reusing the same client_order_id for different orders causes idempotent rejection.
fix
Use client_order_id='' for auto-generation, or generate your own UUID.
affects: all
gotchaquote_size (in USD) vs base_size (in BTC) for market orders. market_order_buy uses quote_size to buy X dollars of crypto. market_order_sell uses base_size to sell X units of crypto.
fix
Buy $10 of BTC: quote_size='10'. Sell 0.001 BTC: base_size='0.001'.
affects: all
Upgrade
Version history
1.8.4latest on PyPI · released Jun 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
60 hits · last 30 days
node
52
Perplexity
1
OpenAI (training)
1
Resources
coinbase-advanced-py — pip install coinbase-advanced-py · libregistry