Generating an API Key
All API endpoints require authentication to access. You will need to create an API key via the Coinbase Prime web UI to interact with these resources. API keys created in the Prime UI are scoped to individual portfolios.Signing Requests
Prime REST API requests must include an access signature header:X-CB-ACCESS-KEY
: The API key as a stringX-CB-ACCESS-PASSPHRASE
: The Passphrase shown when creating the API keyX-CB-ACCESS-SIGNATURE
: The base64-encoded signatureX-CB-ACCESS-TIMESTAMP
: A timestamp for your request
Selecting a Timestamp
TheX-CB-ACCESS-TIMESTAMP
header must be number of seconds since Unix Epoch in UTC. Decimal values are not allowed, so make sure to use an integer.
Your timestamp must be within 30 seconds of your request, or it will be considered expired and be rejected.
Creating a Signature
To generate theX-CB-ACCESS-SIGNATURE
, first compute the SHA256 HMAC of the concatenated message string using the secret key. The process for GET requests may look like the following: