Authentication

Set up the authentication for your API to help users manage their credentials.

Log in to see your API keys
API KeyLabelLast Used

Authentication

All /v1 endpoints require HMAC-SHA256 authentication. Every request must include three headers:

HeaderDescription
COIN-KEYYour API key
COIN-TSUTC timestamp used for signing
COIN-SIGNBase64 URL-safe HMAC-SHA256 signature

Timestamp

The COIN-TS header must be a UTC timestamp in one of these formats:

YYYY-MM-DDTHH:mm:ssZ
YYYY-MM-DDTHH:mm:ss.ffffffZ

The server accepts timestamps within a ±60 second window. Keep your clock synchronized (NTP recommended).


Python

import base64
import hashlib
import hmac
from datetime import datetime, timezone

API_KEY = "your_api_key"
API_SECRET = "your_api_secret"

def sign_request(method, host, path, body="", query=""):
    ts = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
    parts = [method.upper(), ts, host, path]
    if query:
        parts.append(query)
    if body:
        parts.append(body)
    payload = "\n".join(parts)
    mac = hmac.new(
        API_SECRET.encode("ascii"),
        payload.encode("ascii"),
        hashlib.sha256,
    ).digest()
    signature = base64.urlsafe_b64encode(mac).decode()
    return ts, signature

ts, signature = sign_request("GET", "api.coinotc.com", "/v1/ping")

headers = {
    "COIN-KEY": API_KEY,
    "COIN-TS": ts,
    "COIN-SIGN": signature,
}
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here!

Did this page help you?