Before you start
- A verified Coinbase account
- 2-step verification enabled
Create your Coinbase Advanced Trade API key
- 1
Open the CDP portal
Sign in at
portal.cdp.coinbase.comwith your Coinbase account. - 2
Create an API key
Go to API keys → Create API key. Name it and select the portfolio it may use.
- 3
Set permissions
Choose View and Trade. Do not enable Transfer for a trading bot. Add an IP allowlist if offered.
- 4
Download the key
Copy the key name and private key (or download the JSON). The private key is shown once.
Test the key
Before wiring the key into a strategy, make one request by hand. It separates “the key is wrong” from “my code is wrong”.
# pip install coinbase-advanced-py
from coinbase.rest import RESTClient
client = RESTClient(api_key=KEY_NAME, api_secret=PRIVATE_KEY)
print(client.get_accounts())401 usually means a wrong key format or an expired JWT clock.Keep the credentials safe
- Store values in a password manager or a git-ignored
.env, never in code or notebooks you share. - In an AlgoGP project you can still add them under APIs & keys (encrypted at rest) and read them with
strategy_runtime.secrets.get("COINBASE_API_KEY_NAME"). - Give each bot its own credential so you can revoke one without stopping the others.
COINBASE_API_KEY_NAME=paste-your-value-here
COINBASE_API_PRIVATE_KEY=paste-your-value-hereFrequently asked questions
Where is my Coinbase API secret?
CDP keys have a private key instead of an HMAC secret; it is shown only at creation.
Design and backtest your Coinbase Advanced Trade strategy first
AlgoGP turns an idea into Python and tests it on years of history before you connect it to Coinbase Advanced Trade. The exported code keeps the broker behind four small adapter methods.
- AI copilot writes and revises the rules
- Backtests with realistic costs
- Exported Python ready to wire to Coinbase Advanced Trade
Free plan, no card required.
How the Coinbase Advanced Trade API works
AlgoGP is not affiliated with Coinbase Advanced Trade. Menus get renamed from time to time; if a label differs, the official documentation has the current path.