GUIDES

Coinbase API Setup Guide — Crypto Market Data and Order Book in TraderWe

Contents
Connect Coinbase to TraderWe for crypto market data and order routing — spot and perpetual futures, with a ten-level order book. Market data needs no key at all; orders need a CDP API key. This takes about five minutes.

1. Market data first — there is no key to create

Settings → Exchange connections → Coinbase (spot) or Coinbase Futures. Press Connect. That is the whole setup for quotes. Coinbase's Advanced Trade market data stream is public, so TraderWe does not authenticate to read prices. You can record, backtest and run paper strategies without ever creating a key. Symbol notation differs by product: - Spot: BTC-USD, ETH-USD, pairs quoted in USD. - Perpetuals: BTC-PERP-INTX, ETH-PERP-INTX.

2. Add a CDP key when you want to place orders

Coinbase signs trading requests with a CDP API key, which is a different thing from the old API key + passphrase. You get two values. - Sign in to the Coinbase Developer Platform and create an API key for your trading account. - Give it View and Trade permission. Do not give it Transfer. TraderWe never moves funds, and a key that cannot withdraw cannot be used to drain the account if it leaks. - You receive a key name that looks like organizations/{org}/apiKeys/{key} and a private key in PEM form that begins with -----BEGIN EC PRIVATE KEY-----. Paste the key name into API Key and the whole private key into API Secret. Paste it exactly as Coinbase gave it to you — if it arrives as one long line with \n in the middle, that is fine, TraderWe restores the line breaks. Both values are encrypted on your own machine and never returned to the screen. Press Connect. TraderWe signs one harmless request to confirm the key works before you ever place an order. If the signature is rejected, market data keeps running and the badge tells you the key was refused rather than failing the whole connection.

3. Orders

TypeSent asNotes
Marketmarket_market_iocfills immediately at the book
Limitlimit_limit_gtc / limit_limit_fokGTC or FOK validity
Stop limitstop_limit_stop_limit_gtcneeds both a stop price and a limit price
Two things about Coinbase specifically: There is no plain stop-market order. Coinbase only offers stop-limit, so a stop must carry a limit price too. TraderWe refuses a stop without one instead of inventing a price for you. There is no "day" in crypto. The market never closes, so a DAY validity is treated as GTC. IOC is not routed on this connection; if you select it the order is refused with a message rather than quietly becoming something else. Stop direction is chosen from the side: a sell stop triggers when price falls, a buy stop when price rises. Order routing stays locked until you arm it. Until then, strategies run in paper mode and fill inside TraderWe against live Coinbase prices.

4. Order book — why it arrives in waves

When you subscribe to many symbols at once you may notice the ladders fill in over a few seconds rather than all at once. That is deliberate. Coinbase sends a full order book snapshot when you subscribe to a symbol's depth. On 2026-08-04 we measured a single spot symbol's opening snapshot at 4.7 MB — roughly 45,000 price levels. Subscribing to 41 symbols at once would have meant about 190 MB arriving in one burst, and reception broke. So TraderWe subscribes to depth four symbols at a time with a short pause between groups, and keeps the top ten levels per side. Quotes and trades are not batched, those arrive immediately.

5. What the universe scanner does here

Every 30 seconds TraderWe asks Coinbase for the product list and ranks it by 24-hour turnover — last price times 24-hour volume, then subscribes to the top N. Two differences from the stock connections, worth knowing before you write rules: - Sorting by percent change is ignored for crypto. Ranking is by turnover. - Price band filters (min/max price) are ignored. A coin at $0.02 and one at $60,000 are both eligible; turnover is what decides. Stablecoins and fiat-quoted pairs are dropped, as are products the exchange marks disabled or view-only. You can stream up to 50 symbols at once.

6. Check it worked

- The connection badge reads Connected. With a key it also says the signature was accepted. - Prices tick. Crypto trades continuously, so there is no "market closed" state to wait for. - The order book ladder is populated, not empty. - Trade strength becomes meaningful right after connecting — TraderWe seeds it from recent trades rather than starting from zero. One more thing for US residents: Coinbase's INTX perpetuals may not be tradable from a US-resident account. Market data is unaffected because the stream is public.

7. Common problems

The key is rejected but market data works. That is the intended behaviour — we do not kill your quotes over a bad key. Check that you pasted the key *name* (the organizations/... string) into API Key and the PEM block into API Secret, and that the key has Trade permission. "Coinbase private key is not in PEM format" The API Secret field does not contain a PEM block. Copy the privateKey value from the file Coinbase gave you, including the BEGIN and END lines. The order book stays empty while quotes tick. Depth is subscribed in small groups with pauses. Give it a few seconds. If it is still empty after that and quotes are flowing, parse errors are surfaced in diagnostics, send us the first few lines. A quiet coin's bid/ask looks frozen. It should not on this connection, and here is why. Coinbase's ticker channel only publishes a new best bid and ask when a trade happens, so on an illiquid coin the top of book can sit unchanged for minutes even though the real quote moved. We saw the same class of problem on Kraken, where a quiet pair went 150 seconds without an update. TraderWe therefore takes the level-1 quote from the top of the order book instead of from the ticker channel. If you still see a frozen quote, that is worth reporting. Day turnover looks wrong or grows without limit. It should not. We take the 24-hour figure from the exchange and assign it, rather than adding up trades ourselves. Self-accumulation inflated the number by 16.6× in a single day and by up to 610× in the worst case, which corrupted rankings, backtests and training data. That was fixed on 2026-08-04 — if you see runaway turnover, you are on an older build. A stop order was refused. Coinbase has no stop-market order. Set a limit price as well, and use GTC validity. Limitations - The 4.7 MB snapshot figure is one measurement of one spot symbol on 2026-08-04. Snapshot size varies by product and over time; treat it as the reason for the batching, not as a constant. - Fills of resting limit orders are learned from polling rather than a push stream, so a late fill can take a moment to appear. - Perpetual funding rate is not received on this connection. - Historical backfill for Coinbase spot is slow paginated REST, and there is no historical backfill for futures. Recording forward from now is the reliable path.

Related reading

← All guides

Originally published by TraderWe on July 14, 2026. You may quote and link to this page. Republishing the full text without a link back to the original is not permitted.

5 replies

N
NightOwl_Yuki· Jul 2026 ago
ok the no-key market data thing is honestly the part i wish i knew earlier, been paper testing overnight sessions and never needed to touch the developer platform at all. quick q though — does the order book depth stream the same on perps as it does on spot pairs, or is one of them slower to update?
G
GapHunterMike· Jul 2026 ago
view and trade only, no transfer. that line should be in bold at the top. everything else is just plumbing.
TraderWeTraderWe Team· Jul 2026 ago
On the PEM: paste the whole block including the BEGIN and END lines, line breaks and all. Trimming them is the most common reason a key gets rejected on save. Also worth flagging that a data-only connection will happily quote and backtest but will reject any live order until a CDP key is attached, which surprises people who assume the connection is one thing. And to Yuki's question, spot and perp books come off separate product streams, so behaviour can differ during thin hours; if you see something odd there, send us the symbol and rough timestamp and we'll look.
CryptoKarl· Aug 2026 ago
the -PERP-INTX suffix has bitten me more than once, typed BTC-PERP and wondered why nothing loaded. also +1 on never giving Transfer perms, my leverage does enough damage to my account without help from a leaked key
G
GapHunterMike· Aug 2026 ago
market data with no key is the part people sleep on. paper trade the whole thing first, add the cdp key later when you actually know what you're doing. post got cut off mid table btw. what's the limit order mapping?
Sign in to reply →