-
Notifications
You must be signed in to change notification settings - Fork 0
Coinbase API Setup
daybook supports two Coinbase ingestion paths:
-
daybook sync --source coinbase— Coinbase API sync. -
daybook sync --source coinbase --file <csv>— Coinbase "All Transactions" CSV import.
Use the Coinbase API path when you want repeatable syncs without downloading CSV exports. The CSV path remains useful for one-off imports, historical exports, and troubleshooting.
Coinbase owns the API key flow, scopes, endpoint behavior, and naming. Treat these Coinbase pages as the source of truth:
- Coinbase App API key authentication
- Coinbase Track API transactions
- Coinbase Advanced Trade API endpoints
daybook uses Coinbase App Track APIs for accounts and transaction history, then enriches Advanced Trade activity with the Advanced Trade fills endpoint when matching fill data is available.
Follow Coinbase's API key authentication guide. At a high level:
- Open Coinbase Developer Platform.
- Create a Secret API Key for Coinbase App APIs.
- Select
ECDSA/ES256as the signature algorithm. - Use read/view permissions for testing daybook. Avoid trade or transfer permissions unless you explicitly need them elsewhere.
- Copy the API key name and private key.
Coinbase's docs currently call out that Coinbase App API keys must use ES256/ECDSA. Ed25519 keys are not supported for this flow.
Set these before running daybook sync --source coinbase:
export COINBASE_CDP_KEY_NAME="organizations/<org-id>/apiKeys/<key-id>"
export COINBASE_CDP_PRIVATE_KEY="-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----\n"If the private key is saved as a PEM file:
export COINBASE_CDP_PRIVATE_KEY="$(cat ~/path/to/coinbase-private-key.pem)"COINBASE_CDP_KEY_SECRET is accepted as an alias for COINBASE_CDP_PRIVATE_KEY.
daybook account add main-coinbase \
--source coinbase \
--identifier you@example.com \
--label "My Coinbase"The identifier is a local label for your Coinbase account. The API sync fetches Coinbase accounts from Coinbase using the configured API key.
For the first run, use a bounded date so you can inspect a smaller result:
daybook sync --source coinbase --from 2024-01-01After a successful API sync, daybook stores a local per-account sync watermark. Future API syncs can omit --from:
daybook sync --source coinbaseTo inspect imported events:
daybook events count --source coinbase
daybook events list --source coinbase --limit 20Coinbase CSV import does not use API credentials:
daybook sync --source coinbase --file ~/Downloads/Coinbase-All-Transactions.csv--from is supported for Coinbase API sync, but not for Coinbase CSV imports.
- Store Coinbase credentials in environment variables or a local secret manager, not in git.
- Prefer read/view-only permissions for daybook testing.
- Consider IP allowlisting in Coinbase if your environment has a stable outbound IP.
- Rotate the key if it is copied into logs, shell history, chat, or any repository.
Getting Started
Usage
Architecture