{"id":187,"library":"coinbase-advanced-py","title":"Coinbase Advanced Trade Python SDK","description":"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'.","status":"active","version":"1.8.2","language":"python","source_language":"en","source_url":"https://github.com/coinbase/coinbase-advanced-py","tags":["coinbase","crypto","trading","python","api"],"install":[{"cmd":"pip install coinbase-advanced-py","lang":"bash","label":"Python"}],"dependencies":[],"imports":[{"wrong":"from coinbase.rest import RESTClient","symbol":"RESTClient","correct":"from coinbase.rest import RESTClient"}],"quickstart":{"code":"# pip install coinbase-advanced-py\nfrom coinbase.rest import RESTClient\n\n# From CDP dashboard: Advanced Trade API key\nclient = RESTClient(key_file='cdp_api_key.json')\n\n# Get accounts\naccounts = client.get_accounts()\nfor acct in accounts['accounts']:\n    print(acct['name'], acct['available_balance']['value'])\n\n# Get BTC-USD product info\nproduct = client.get_product(product_id='BTC-USD')\nprint(product['price'])\n\n# Place market buy ($10 of BTC)\norder = client.market_order_buy(\n    client_order_id='',  # auto-generate\n    product_id='BTC-USD',\n    quote_size='10'\n)\nprint(order['success'])","lang":"python","description":"Coinbase Advanced Trade Python SDK — accounts, product info, and market order."},"warnings":[{"fix":"pip install coinbase-advanced-py; from coinbase.rest import RESTClient","message":"Package 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.","severity":"breaking","affected_versions":"all"},{"fix":"pip install coinbase-advanced-py. Migration guide at docs.cdp.coinbase.com","message":"Coinbase Pro (cbpro) discontinued. All LLM and tutorial code using cbpro or the old Coinbase Pro API is broken. Migrate to coinbase-advanced-py.","severity":"breaking","affected_versions":"all"},{"fix":"Generate CDP API key from developer.coinbase.com — downloads a JSON file with name and privateKey fields.","message":"CDP 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.","severity":"breaking","affected_versions":"all"},{"fix":"Use client_order_id='' for auto-generation, or generate your own UUID.","message":"client_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.","severity":"gotcha","affected_versions":"all"},{"fix":"Buy $10 of BTC: quote_size='10'. Sell 0.001 BTC: base_size='0.001'.","message":"quote_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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.8.2':15 '2026':17 'advanc':2,8,40 'api':10,47,58,71 'avoid':22 'cbpro':30 'cdp':43 'coinbas':1,7,23,25,31,39,44,67 'coinbase-advanced-pi':38 'coinbase.rest':64 'commerc':26 'correct':35 'crypto':68 'current':13 'deprec':19 'develop':45 'discontinu':33 'ec':50 'eol':28 'format':53,60 'hmac':57 'import':61,65 'key':48,52,59 'mar':16 'offici':6 'old':24,56 'packag':20,36 'platform':46 'privat':51 'pro':32 'py':41 'python':4,11,70 'restclient':66 'sdk':5,12,27 'trade':3,9,69 'two':18 'use':42 'version':14","created_at":"2026-03-25T03:09:06.817947+00:00","updated_at":"2026-04-16T03:03:38.902846+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"1.8.4","cli_name":"","cli_version":null,"type":"library","homepage":"https://docs.cdp.coinbase.com/advanced-trade/docs/welcome","github":"https://github.com/coinbase/coinbase-advanced-py","docs":null,"changelog":null,"pypi":"https://pypi.org/project/coinbase-advanced-py/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["payments","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-26","next_check":"2026-07-30","install_tag":"verified"}}