Skip to main content
Deribit provides three different interfaces to access the API:
  • JSON-RPC over WebSocket (recommended) - Real-time, bidirectional communication
  • JSON-RPC over HTTP - Simple REST-like interface
  • FIX API - Financial Information eXchange protocol for institutional trading
All examples in this documentation use the test environment (test.deribit.com). To use production, change the URLs to www.deribit.com. Test and production environments are separate and require different accounts and API keys.
1

Get API Credentials

  1. Log in to your Deribit account at www.deribit.com or test.deribit.com for testing
  2. Navigate to AccountAPI
  3. Create a new API key with appropriate permissions
  4. Save your Client ID and Client Secret securely
Never share your API credentials or commit them to version control. The client secret is only shown once and cannot be retrieved later.
2

Choose Your Interface

Best for: Simple scripts, one-off requests, testing
# Get market data (no authentication required)
curl -X GET "https://test.deribit.com/api/v2/public/get_instruments?currency=BTC&kind=future"
3

Authenticate

For private methods, you need to authenticate. Deribit supports multiple authentication methods:
  • Client Credentials - Standard OAuth 2.0 flow
  • Client Signature - User generated signature
  • Refresh Token - Token renewal
# Get access token using Client Credentials
curl -X GET "https://test.deribit.com/api/v2/public/auth" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"
Response:
{
  "jsonrpc": "2.0",
  "result": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
    "expires_in": 31536000,
    "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
    "scope": "account:read trade:read",
    "token_type": "bearer"
  }
}

Access Scopes

Learn more about API permissions and access scopes
4

Make Your First Requests

Get Market Data
# Get all BTC futures
curl -X GET "https://test.deribit.com/api/v2/public/get_instruments?currency=BTC&kind=future"

# Get ticker for BTC-PERPETUAL
curl -X GET "https://test.deribit.com/api/v2/public/ticker?instrument_name=BTC-PERPETUAL"

# Get order book
curl -X GET "https://test.deribit.com/api/v2/public/get_order_book?instrument_name=BTC-PERPETUAL&depth=5"
5

Place a Test Order (Testnet Only)

Only use test.deribit.com for testing. Never test with real funds on production.
# Place a limit buy order (testnet)
curl -X GET "https://test.deribit.com/api/v2/private/buy" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d "instrument_name=BTC-PERPETUAL" \
  -d "amount=10" \
  -d "type=limit" \
  -d "price=50000"