Bitstamp Public API (v2)

Download OpenAPI specification:Download

What is API?

Bitstamp application programming interface (API) allows our clients to access and control their accounts, using custom written software.

Response codes

Response code is a key that can be appended to an API response as response_code (string). Additionally, also explanation may or may not be included as the response_explanation (string) key, which defines further explanation to what has gone wrong when processing a request.

Below is the list of all available response codes and it's explanations:

response_code response_explanation (optional)
400.001 Unknown validation error.
400.002 Request rejected due to exceeded rate limit.
400.003 Trading for provided market is disabled.
400.004 POST parameter(s) is missing from request.
400.005 POST parameter(s) is missing from request: amount.
400.006 POST parameter(s) is missing from request: price.
400.007 POST parameter(s) is malformed.
400.008 POST parameter(s) is malformed: client_order_id.
400.009 Insufficient balance for provided user.
400.010 POST parameter(s) is malformed: offset.
400.011 POST parameter(s) is malformed: limit.
400.012 POST parameter(s) is malformed: sort.
400.013 POST parameter(s) is malformed: since_timestamp.
400.014 POST parameter(s) is missing from request: order_id.
400.015 POST parameter(s) is missing from request: client_order_id.
400.016 POST parameter(s) is malformed: order_id.
400.017 POST parameter(s) is malformed: client_cancel_id.
400.018 GET parameters not allowed for this request.
400.019 Provided client_order_id already exists.
400.020 Provided order size is lower than minimum order value.
400.021 Provided price is out of range.
400.022 POST parameter(s) is missing from request: expire_time.
400.023 POST parameter(s) is malformed: expire_time.
400.024 Only one of optional parameters can be set.
400.025 Both limit_price and any optional parameter cannot be set.
400.026 POST parameter(s) is malformed: amount.
400.027 Sell if executed price must be higher than buy price.
400.028 Buy if executed price must be lower than sell price.
400.029 'stop_order_id' is None.
400.030 'stop_order_price' is None.
400.031 'expire_time' is None.
400.032 'expire_time' must be set in future date.
400.033 'expire_time' must be None.
400.034 POST parameter(s) is malformed: until_timestamp.
400.035 POST parameter(s) is missing from request: id.
400.036 POST parameter(s) is malformed: id.
400.037 Provided order size is too large.
400.038 Provided order amount is too large.
400.039 Provided order size is higher than maximum order value.
400.040 Provided leverage differs from ones on open orders.
400.041 POST parameter(s) is malformed: price.
400.042 Position management mode already active
400.043 No positions present
400.044 POST parameter(s) is malformed: leverage.
400.045 Open orders present.
400.046 Provided order amount is too low.
400.047 POST parameter(s) is malformed: stop_price.
400.048 POST parameter(s) is malformed: activation_price.
400.049 POST parameter(s) is missing: subtype.
400.050 POST parameter(s) is missing: trigger.
400.051 POST parameter(s) is missing: reduce_only.
400.052 Too many stop orders on market.
400.053 Too many trailing stop orders on trade account.
400.054 Invalid value for trailing_delta.
400.055 Current price is lower than order price.
400.056 Current price is higher than order price.
400.057 Reduce only not supported with provided order parameters.
400.058 Only GTC, FOK and IOC time in force allowed for take profit and stop loss orders.
403.001 User verification failed.
403.002 Trading is not allowed on lending account.
403.003 Trading is not allowed on collateral account.
403.004 Trading is blocked for user.
403.005 Action not allowed at cross margin mode.
403.006 Trading of this market type is not allowed on trade account.
404.001 Unknown not found error.
404.002 Order not found for corresponding request.
404.003 Currency pair not found for corresponding request.
404.004 Trade account not found for provided API key.
404.005 Order book not found.
404.006 Currency not found for corresponding request.
404.007 Market not found for corresponding request.
405.001 GET method not allowed.
410.001 Requested endpoint is deprecated.
500.001 Unknown server error.
500.002 One of Bitstamp internal services failed to process request.
500.003 Unknown error while processing order.
500.004 No sell orders for provided market.
500.005 No buy orders for provided market.
500.006 Cash sell order types are currently disabled.
500.007 Error while serializing data.
500.008 Margin option for provided market is disabled.
500.009 Order book is currently unavailable.
500.010 Instant trading for provided market is disabled.
500.011 Market trading for provided market is disabled.
500.012 Matching blocked for this order book.
500.013 Unknown matching engine error.
500.014 Cash order for provided market is disabled.
500.015 Cannot place order. There are currently no orders for provided market.
500.016 Timeout on matching engine.
500.017 Order rejected by matching engine.
500.018 No orders for provided market.
500.019 Error at canceling orders
500.020 Pre reserved orders present
500.021 Post reserved orders present
500.022 More than one position present
500.023 Position management order not filled

Request limits

As standard, all clients can make 400 requests per second. There is a default limit threshold of 10,000 requests per 10 minutes in place. The rate limits mentioned above can be increased upon request and the client entering a bespoke agreement with Bitstamp. For real time data please refer to the websocket API.

Commercial Use of Bitstamp's Exchange Data

Companies seeking to utilize Bitstamp's exchange data for their own commercial purposes are directed to contact partners@bitstamp.net to receive and sign a commercial use Data License Agreement.

Bitstamp allows the incorporation and redistribution of our exchange data for commercial purposes. This includes the right to create ratios, calculations, new original works, statistics, and similar, based on the exchange data.

Authentication

All private API calls require authentication. For a successful authentication you need to provide the following authorization headers in your request:

Possible authentication errors

CodeReasonAction
API0001API key not foundCheck your API key value.
API0002IP address not allowedThis IP address has no permission to use this API key.
API0003No permission foundAPI key doesn't have permission for calling this api endpoint.
API0004Invalid nonceCheck your nonce value. It must be different than last nonce used in the last 150 seconds.
API0005Invalid signaturePosted signature doesn't match with ours.
API0006Your account is frozenContact support to unfreeze your account.
API0008Authentication failedCan't find customer with selected API key.
API0009Please update your profile with your FATCA information, before using API.Check that you filled out the FATCA information form on your account.
API0010Invalid versionCheck that you send "v2" in the version authorization header.
API0011Wrong API key formatCheck that your API key string is correct.
API0012X-Auth header is requiredX-Auth header is probably missing in your request.
API0013X-Auth-Signature header is requiredX-Auth-Signature header is probably missing in your request.
API0014X-Auth-Nonce header is requiredX-Auth-Nonce header is probably missing in your request.
API0015X-Auth-Timestamp header is requiredX-Auth-Timestamp header is probably missing in your request.
API0016X-Auth-Version header is requiredX-Auth-Version header is probably missing in your request.
API0017X-Auth-Timestamp header is out of boundariesTimestamp you added in the header is either too old or too new. Check that timestamp is within 150 second timeframe.
API0018X-Auth-Timestamp header is invalidCheck the format of X-Auth-Timestamp header.
API0019Content-Type header is not acceptedPlease specify the correct content type.
API0020Content-Type header should not be presentPlease make sure you're not sending any body in the request.
API0021Please make sure url query string is not too longPlease make sure the total length of the url does not exceed 2000 characters.

x_auth

Format: BITSTAMP {api_key}

Security Scheme Type: API Key
Header parameter name: X-Auth

x_auth_nonce

Client generated random nonce:

  • lowercase,

  • 36 char string,

  • each nonce can be used only once within a timeframe of 150 seconds.

Security Scheme Type: API Key
Header parameter name: X-Auth-Nonce

x_auth_signature

sha256.hmac({string_to_sign}, {api_secret})

{string_to_sign} is your signature message.

Content-Type should not be added to the string if request.body is empty.

The following have to be combined into a single string:

"BITSTAMP" + " " + api_key + 
HTTP Verb + 
url.host + 
url.path + 
url.query + 
Content-Type + 
X-Auth-Nonce + 
X-Auth-Timestamp + 
X-Auth-Version + 
request.body
Security Scheme Type: API Key
Header parameter name: X-Auth-Signature

x_auth_subaccount_id

Make requests for specific sub account. Set this header to the sub account Unique ID.

Security Scheme Type: API Key
Header parameter name: X-Auth-Subaccount-Id

x_auth_timestamp

Request departure timestamp UTC in milliseconds.

If timestamp is more than 150 seconds from current server time, it will not allow to make the request.

Security Scheme Type: API Key
Header parameter name: X-Auth-Timestamp

x_auth_version

Format: v2

Security Scheme Type: API Key
Header parameter name: X-Auth-Version

x_content_type

Please note that you you should not set Content-Type header if there is no body.

Security Scheme Type: API Key
Header parameter name: Content-Type

Authentication examples

Note: if the request body is empty, the Content-Type header has to be removed both from the headers and from the signature

Python
import hashlib
import hmac
import time
import requests
import uuid
import sys
from urllib.parse import urlencode

api_key = 'api_key'
API_SECRET = b'api_key_secret'

timestamp = str(int(round(time.time() * 1000)))
nonce = str(uuid.uuid4())
content_type = 'application/x-www-form-urlencoded'
payload = {'offset': '1'}

payload_string = urlencode(payload)

# '' (empty string) in message represents any query parameters or an empty string in case there are none
message = 'BITSTAMP ' + api_key + \
    'POST' + \
    'www.bitstamp.net' + \
    '/api/v2/user_transactions/' + \
    '' + \
    content_type + \
    nonce + \
    timestamp + \
    'v2' + \
    payload_string
message = message.encode('utf-8')
signature = hmac.new(API_SECRET, msg=message, digestmod=hashlib.sha256).hexdigest()
headers = {
    'X-Auth': 'BITSTAMP ' + api_key,
    'X-Auth-Signature': signature,
    'X-Auth-Nonce': nonce,
    'X-Auth-Timestamp': timestamp,
    'X-Auth-Version': 'v2',
    'Content-Type': content_type
}
r = requests.post(
    'https://www.bitstamp.net/api/v2/user_transactions/',
    headers=headers,
    data=payload_string
    )
if not r.status_code == 200:
    raise Exception('Status code not 200')

string_to_sign = (nonce + timestamp + r.headers.get('Content-Type')).encode('utf-8') + r.content
signature_check = hmac.new(API_SECRET, msg=string_to_sign, digestmod=hashlib.sha256).hexdigest()
if not r.headers.get('X-Server-Auth-Signature') == signature_check:
    raise Exception('Signatures do not match')

print(r.content)

Java
package com.example.AuthenticationExample;

import org.apache.commons.codec.binary.Hex;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.UUID;

public class Authentication {
    public static void main(String[] args) {
        String apiKey = String.format("%s %s", "BITSTAMP", "api_key");
        String apiKeySecret = "api_key_secret";
        String httpVerb = "POST";
        String urlHost = "www.bitstamp.net";
        String urlPath = "/api/v2/user_transactions/";
        String urlQuery = "";
        String timestamp = String.valueOf(System.currentTimeMillis());
        String nonce = UUID.randomUUID().toString();
        String contentType = "application/x-www-form-urlencoded";
        String version = "v2";
        String payloadString = "offset=1";
        String signature = apiKey +
            httpVerb +
            urlHost +
            urlPath +
            urlQuery +
            contentType +
            nonce +
            timestamp +
            version +
            payloadString;

        try {
            SecretKeySpec secretKey = new SecretKeySpec(apiKeySecret.getBytes(), "HmacSHA256");
            Mac mac = Mac.getInstance("HmacSHA256");
            mac.init(secretKey);
            byte[] rawHmac = mac.doFinal(signature.getBytes());
            signature = new String(Hex.encodeHex(rawHmac)).toUpperCase();

            HttpClient client = HttpClient.newHttpClient();
            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://www.bitstamp.net/api/v2/user_transactions/"))
                .POST(HttpRequest.BodyPublishers.ofString(payloadString))
                .setHeader("X-Auth", apiKey)
                .setHeader("X-Auth-Signature", signature)
                .setHeader("X-Auth-Nonce", nonce)
                .setHeader("X-Auth-Timestamp", timestamp)
                .setHeader("X-Auth-Version", version)
                .setHeader("Content-Type", contentType)
                .build();

            HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

            if (response.statusCode() != 200) {
                throw new RuntimeException("Status code not 200");
            }

            String serverSignature = response.headers().map().get("x-server-auth-signature").get(0);
            String responseContentType = response.headers().map().get("Content-Type").get(0);
            String stringToSign = nonce + timestamp + responseContentType + response.body();

            mac.init(secretKey);
            byte[] rawHmacServerCheck = mac.doFinal(stringToSign.getBytes());
            String newSignature = new String(Hex.encodeHex(rawHmacServerCheck));

            if (!newSignature.equals(serverSignature)) {
                throw new RuntimeException("Signatures do not match");
            }

            System.out.println(response.body());

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

C++
#include <curl/curl.h>
#include <openssl/hmac.h>
#include <uuid/uuid.h>

#include <iostream>
#include <string>
#include <chrono>
#include <iomanip>

static size_t write_call_back(void *contents, size_t size, size_t nmemb, void *userp)
{
    ((std::string*)userp)->append((char*)contents, size * nmemb);
    return size * nmemb;
}

std::string b2a_hex(char *byte_arr, int n)
{
    const static std::string hex_codes = "0123456789abcdef";
    std::string hex_string;
    for ( int i = 0; i < n ; ++i ) {
        unsigned char bin_value = byte_arr[i];
        hex_string += hex_codes[( bin_value >> 4 ) & 0x0F];
        hex_string += hex_codes[bin_value & 0x0F];
    }
    return hex_string;
}

std::string url_encode(std::string data)
{
    std::string res = data;
    CURL *curl = curl_easy_init();

    if(curl) {
        char *output = curl_easy_escape(curl, data.c_str(), data.length());
        if(output) {
            res = output;
            curl_free(output);
        }
    }

    return res;
}


int main() {

    const std::string api_key = "api_key";
    const std::string api_secret = "api_key_secret";

    std::chrono::milliseconds timestamp = std::chrono::duration_cast< std::chrono::milliseconds >(
            std::chrono::system_clock::now().time_since_epoch()
    );

    uuid_t uuid;
    uuid_string_t nonce;
    uuid_generate(uuid);
    uuid_unparse_lower(uuid, nonce);

    std::string x_auth = "BITSTAMP " + api_key;
    std::string x_auth_nonce = nonce;
    std::string x_auth_timestamp = std::to_string(timestamp.count());
    std::string x_auth_version = "v2";
    std::string content_type = "application/x-www-form-urlencoded";
    std::string payload = url_encode("{offset:1}");

    std::string http_method = "POST";
    std::string url_host = "www.bitstamp.net";
    std::string url_path = "/api/v2/user_transactions/";
    std::string url_query = "";

    std::string data_to_sign = "";
    data_to_sign.append(x_auth);
    data_to_sign.append(http_method);
    data_to_sign.append(url_host);
    data_to_sign.append(url_path);
    data_to_sign.append(url_query);
    data_to_sign.append(content_type);
    data_to_sign.append(x_auth_nonce);
    data_to_sign.append(x_auth_timestamp);
    data_to_sign.append(x_auth_version);
    data_to_sign.append(payload);

    // calculate hmac signature
    unsigned char* result;
    unsigned int len = 20;
    result = (unsigned char*)malloc(sizeof(char) * len);

    HMAC_CTX ctx;
    HMAC_CTX_init(&ctx);

    HMAC_Init_ex(&ctx, api_secret.c_str(), api_secret.length(), EVP_sha256(), NULL);
    HMAC_Update(&ctx, (unsigned char*)data_to_sign.c_str(), data_to_sign.length());
    HMAC_Final(&ctx, result, &len);
    HMAC_CTX_cleanup(&ctx);

    std::string x_auth_signature = b2a_hex( (char *)result, 32 );
    free(result);

    // send request
    CURL *curl;
    CURLcode res;
    std::string read_buffer;

    curl = curl_easy_init();

    if(curl) {

        struct curl_slist *headers = NULL;
        headers = curl_slist_append(headers, ("X-Auth: " + x_auth).c_str());
        headers = curl_slist_append(headers, ("X-Auth-Signature: " + x_auth_signature).c_str());
        headers = curl_slist_append(headers, ("X-Auth-Nonce: " + x_auth_nonce).c_str());
        headers = curl_slist_append(headers, ("X-Auth-Timestamp: " + x_auth_timestamp).c_str());
        headers = curl_slist_append(headers, ("X-Auth-Version: " + x_auth_version).c_str());
        headers = curl_slist_append(headers, ("Content-Type: " + content_type).c_str());

        std::string url = "https://" + url_host + url_path + url_query;

        curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload.c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_call_back);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &read_buffer);

        res = curl_easy_perform(curl);

        if(res != CURLE_OK) {
            std::cout << "curl_easy_perform() failed: " << curl_easy_strerror(res) << std::endl;
        }

        std::cout << "curl_easy_perform() response: " << read_buffer << std::endl;

        curl_easy_cleanup(curl);

    }

    return 0;

}

Changelog

2024-12-04

  • Updated withdrawal endpoints:
    • Crypto withdrawals subject to Travel rule may require address verification

2024-11-20

  • Updated Contacts endpoint:
    • POST /api/v2/travel_rule/contacts: Fields retail_info.first_name and retail_info.last_name are now required.

2024-10-15

  • GET /api/v2/trading-pairs-info/ is obsolete and replaced by endpoint api/v2/markets/
    • We will no longer guarantee /api/v2/trading-pairs-info/ to work after Dec 31st 2024
  • Added new error code API5012 to /api/v2/earn/unsubscribe/
  • GET /api/v2/currencies/ has been extended with the following information:
    • networks: which blockchains are supported for withdrawals, minimum withdrawal amounts, deposits, decimal precision and status per blockchain

2024-07-17

  • Updated descriptions for Ripple IOU endpoint by adding support for ETH-IOU:
    • POST /api/v2/ripple_address/
    • POST /api/v2/ripple_withdrawal/

2024-03-13

  • Added transfer_id param to crypto endpoints:
    • POST /api/v2/{currency}_address/ response
    • POST /api/v2/{currency}_withdrawal/ request

2023-10-12

  • New API changes due to compliance with Travel Rule requirements:
  • All endpoints for creating new orders have an optional client_order_id field. If submitted, up until now client_order_id had to be unique. We are deprecating the checking of duplicate client_order_id and will allow duplicates beginning November 2023. If you currently rely on us checking for duplicates and us rejecting those, this change may cause you to submit multiple orders so please make the necessary changes to not rely on that check.
  • New API endpoints that enable you to access full Earn (Staking and Lending) functionality.

2023-09-29

  • Added revoke_all_api_keys as a kill switch functionality to terminate all API connectivity:
    • POST /api/v2/revoke_all_api_keys/

2023-09-25

  • Updated GTD order description by noting that the orders expire at midnight:
    • POST /api/v2/buy/{market_symbol}/
    • POST /api/v2/sell/{market_symbol}/

2023-09-22

  • Extended error responses for /api/v2/cancel_order:
    • POST /api/v2/cancel_order/

2023-08-31

  • Added market property with the goal of deprecating currency_pair long term:
    • GET /api/v2/fees/trading/
  • Added datetime and type properties to order status endpoint:
    • GET /api/v2/order_status/

2023-07-05

  • Introduced a new side field (0 - buy; 1 - sell) to all Ticker endpoints:
    • GET /api/v2/ticker/
    • GET /api/v2/ticker/{currency_pair}/
    • GET /api/v2/ticker_hour/

2023-06-29

  • Updated destination_tag field description for Ripple IOU address endpoint:
    • POST /api/v2/ripple_address/

2023-04-07

  • Introduced a new Currencies endpoint:
    • GET /api/v2/currencies/: Get listed currencies info.

Tickers

Collection of endpoints that return ticker info.

Currencies

Returns list of all currencies with basic data.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

All currency pairs tickers

Return ticker data for all currency pairs. Passing any GET parameters, will result in your request being rejected.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Market ticker

Return ticker data for the requested currency pair. Passing any GET parameters, will result in your request being rejected.

path Parameters
market_symbol
required
string

Responses

Response samples

Content type
application/json
{
  • "ask": "2211.00",
  • "bid": "2188.97",
  • "high": "2811.00",
  • "last": "2211.00",
  • "low": "2188.97",
  • "open": "2211.00",
  • "open_24": "2211.00",
  • "percent_change_24": "13.57",
  • "side": "0",
  • "timestamp": "1643640186",
  • "volume": "213.26801100",
  • "vwap": "2189.80"
}

Hourly ticker

Return hourly ticker data for the requested currency pair. Passing any GET parameters, will result in your request being rejected.

path Parameters
market_symbol
required
string

Responses

Response samples

Content type
application/json
{
  • "ask": "43521.92",
  • "bid": "43499.58",
  • "high": "43701.83",
  • "last": "43505.90",
  • "low": "43416.85",
  • "open": "43640.06",
  • "side": "0",
  • "timestamp": "1644405321",
  • "volume": "26.24890063",
  • "vwap": "43578.11"
}

Order book

Collection of endpoints that return order book info.

Order book

Returns order book data.

Possible errors
Reason Action
POST method not allowed for this request. HTTP method other than GET used.
Invalid GET parameter. Missing group parameter.
Internal error. Order book unavailable.
path Parameters
market_symbol
required
string
query Parameters
group
integer <int32> [ 0 .. 2 ]
Example: group=0

The group parameter is used for accessing different data from order book. Possible values are 0 (orders are not grouped at same price), 1 (orders are grouped at same price - default) or 2 (orders with their order ids are not grouped at same price).

Responses

Response samples

Content type
application/json
Example
{
  • "asks": [
    ],
  • "bids": [
    ],
  • "microtimestamp": "1643643584684047",
  • "timestamp": "1643643584"
}

Transactions

Collection of endpoints that return transaction info.

Transactions

Return transaction data from a given time frame.

path Parameters
market_symbol
required
string
query Parameters
time
string
Enum: "day" "hour" "minute"
Example: time=minute

The time interval from which we want the transactions to be returned. Possible values are minute, hour (default) or day.

Responses

Response samples

Content type
application/json
{
  • "amount": "0.00676053",
  • "date": "1644406050",
  • "price": "43524.69",
  • "tid": "220744838",
  • "type": "string"
}

Travel Rule

Collection of Travel Rule related endpoints

VASP list

A list of Virtual Asset Service Providers needed to comply with the Travel Rule. These may be needed when transferring cryptocurrency from/to the platform. This is required in cases where the originating or destination address of the crypto transfer is hosted by a VASP.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Successfully retrieved the vasp list.
400 Could not fetch VASP list, service unavailable.
query Parameters
per_page
integer
page
integer

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Market info

Collection of endpoints that return market info.

EUR/USD conversion rate

Return EUR/USD conversion rate.

Responses

Response samples

Content type
application/json
{
  • "buy": "16.52234567",
  • "sell": "0.06577932"
}

Markets

View that returns list of all available markets.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

OHLC data

Returns OHLC (Open High Low Close) data.

Possible errors
Reason Action
Missing data for required field. Step and limit parameters are missing.
Not a valid choice. Value entered in parameter is invalid.
Must be between 1 and 1000. Limit value must be between 1 and 1000.
path Parameters
market_symbol
required
string[a-z0-9\-]+
query Parameters
step
required
integer <int32>
Enum: 60 180 300 900 1800 3600 7200 14400 21600 43200 86400 259200
Example: step=60

Timeframe in seconds.

limit
required
integer <int32> [ 1 .. 1000 ]
Example: limit=50

Limit OHLC results.

start
integer <int32> [ 0 .. 253402297199 ]
Example: start=10000

Unix timestamp from when OHLC data will be started.

end
integer <int32> [ 0 .. 253402297199 ]
Example: end=60

Unix timestamp to when OHLC data will be shown.If none from start or end timestamps are posted then endpoint returns OHLC data to current unixtime. If both start and end timestamps are posted, end timestamp will be used.

exclude_current_candle
boolean
Default: false
Example: exclude_current_candle=true

If set, results won't include current (open) candle.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Account balances

Collection of endpoints that return account balances.

Account balances

Return account balances.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Account balance for currency

Return account balances for currency.

path Parameters
currency
required
string

Responses

Response samples

Content type
application/json
{
  • "available": "90.00",
  • "currency": "usd",
  • "reserved": "10.00",
  • "total": "100.00"
}

Fees

Collection of endpoints that return fee info.

Trading fees

Return all trading fees.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Trading fee for market

Return trading fees for market.

path Parameters
market_symbol
required
string

Responses

Response samples

Content type
application/json
{
  • "currency_pair": "btcusd",
  • "fees": [
    ],
  • "market": "btcusd"
}

Withdrawal fees

Return withdrawal fees.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Withdrawal fee for currency

Return withdrawal fee for currency.

Possible errors
Reason Action
Invalid network selection The selected network is not supported for 'currency'. Please select a compatible network for it.
path Parameters
currency
required
string
Request Body schema: application/json
network
string
Enum: "bitcoin-cash" "bitcoin" "ethereum" "litecoin" "stellar" "xrpl" "algorand" "flare" "hedera" "cardano" "songbird" "avalanche-c-chain" "solana" "polkadot" "near" "doge" "sui" "casper" "multiversx" "internet-computer" "xdc-network"

Cryptocurrency network.

Responses

Request samples

Content type
application/json
{
  • "network": "bitcoin"
}

Response samples

Content type
application/json
{
  • "currency": "btc",
  • "fee": "0.00015000",
  • "network": "bitcoin"
}

Orders

Collection of endpoints for managing orders.

Buy instant order

Open a buy instant order. By placing an instant order you acknowledge that the execution of your order depends on the market conditions and that these conditions may be subject to sudden changes that cannot be foreseen. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing amount and/or price POST parameters Missing one or both parameters.
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
Minimum order size is 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH Order value must be at least 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH
You can only buy 'amount' 'currency'. Check your account balance for details. Account has less 'available_currency' than is required to make this order.
Maximum market buy amount at the moment is 'amount' 'currency'. Please use limit order instead. Order amount exceeds the limit amount set for market buy orders.
Order could not be placed. Order could not be placed (perhaps due to internal error or trade halt). Please retry placing order.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
amount
required
number

Amount in counter currency (Example: For BTC/USD pair, amount is quoted in USD)

client_order_id
string

Client order ID set by the client for internal reference. It should be unique, but there are no additional constraints or checks guaranteed on the field by Bitstamp.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "1234123412341234",
  • "market": "BTC/USD",
  • "datetime": "2022-01-31 14:43:15.796000",
  • "type": "0",
  • "price": "2211.00",
  • "amount": "45.00000000",
  • "client_order_id": "123456789"
}

Buy market order

Open a buy market order. By placing a market order you acknowledge that the execution of your order depends on the market conditions and that these conditions may be subject to sudden changes that cannot be foreseen. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing amount and/or price POST parameters Missing one or both parameters.
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
Minimum order size is 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH Order value must be at least 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH
You can only buy 'amount' 'currency'. Check your account balance for details. Account has less 'available_currency' than is required to make this order.
Maximum market buy amount at the moment is 'amount' 'currency'. Please use limit order instead. Order amount exceeds the limit amount set for market buy orders.
Order could not be placed. Order could not be placed (perhaps due to internal error or trade halt). Please retry placing order.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
amount
required
number

Amount in base currency (Example: For BTC/USD pair, amount is quoted in BTC)

client_order_id
string

Client order ID set by the client for internal reference. It should be unique, but there are no additional constraints or checks guaranteed on the field by Bitstamp.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "1234123412341234",
  • "market": "BTC/USD",
  • "datetime": "2022-01-31 14:43:15.796000",
  • "type": "0",
  • "price": "2211.00",
  • "amount": "45.00000000",
  • "client_order_id": "123456789"
}

Buy limit order

Open a buy limit order. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing amount and/or price POST parameters Missing one or both parameters.
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
Minimum order size is 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH Order value must be at least 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH
Price is more than 20% above market price. Order price must not exceed 20% of current price.
You need 'order_value' USD to open that order. You have only 'available_fiat' USD available. Check your account balance for details. Account has less 'available_fiat' than is required to make this order.
Sell if executed price must be higher than buy price. 'limit_price' must be larger than 'price' parameter.
Both limit_price and daily_order cannot be set. Only one of those parameters can be set.
Order could not be placed. Order could not be placed (perhaps due to internal error or trade halt). Please retry placing order.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
amount
required
number [ 1e-8 .. 92233720368 ]

Amount.

price
required
number [ 1e-8 .. 92233720368 ]

Price.

limit_price
number [ 1e-8 .. 92233720368 ]

If the order gets executed, a new opposite order will be placed, with "limit_price" as its price.

daily_order
boolean

Opens limit order which will be canceled at 0:00 UTC unless it already has been executed.

ioc_order
boolean

An Immediate-Or-Cancel (IOC) order is an order that must be executed immediately. Any portion of an IOC order that cannot be filled immediately will be cancelled.

fok_order
boolean

A Fill-Or-Kill (FOK) order is an order that must be executed immediately in its entirety. If the order cannot be immediately executed in its entirety, it will be cancelled.

moc_order
boolean

A Maker-Or-Cancel (MOC) order is an order that ensures it is not fully or partially filled when placed. In case it would be, the order is cancelled.

gtd_order
boolean

A Good-Till-Date (GTD) lets you select an expiration time up until which the order will be open. Note that all GTD orders are cancelled at 00:00:00 UTC.

expire_time
integer <int32>

Unix timestamp in milliseconds. Required in case of GTD order.

client_order_id
string

Client order ID set by the client for internal reference. It should be unique, but there are no additional constraints or checks guaranteed on the field by Bitstamp.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "1234123412341234",
  • "market": "BTC/USD",
  • "datetime": "2022-01-31 14:43:15.796000",
  • "type": "0",
  • "price": "2211.00",
  • "amount": "45.00000000",
  • "client_order_id": "123456789"
}

Cancel all orders

Cancel all open orders. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Responses

Response samples

Content type
application/json
{
  • "canceled": [
    ],
  • "success": true
}

Cancel all orders for market

Cancel all open orders for a market. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

path Parameters
market_symbol
required
string

Responses

Response samples

Content type
application/json
{
  • "canceled": [
    ],
  • "success": true
}

Cancel order

Cancel an order. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing id POST param. Id parameter missing.
Invalid id POST param. Id parameter must be a positive integer.
Invalid client_cancel_id POST param. client_cancel_id parameter can contain at most 180 characters.
Order not found Order with that id was not found in orderbook. Order might already be filled or canceled. Please check order status.
Order cancellation failed due to internal error. Please try again. Please retry cancelling order.
Order cancelattion failed due to trade halt. You can cancel order after trade halt is lifted.
Request Body schema: www-form-urlencoded
id
string

Order ID.

Responses

Response samples

Content type
application/json
Example
{
  • "id": 1453282316578816,
  • "amount": "0.02035278",
  • "price": "2100.45",
  • "type": 0,
  • "market": "BTC/USD"
}

Trading markets

Returns all markets that can be traded on selected account.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Open orders

Return user's open orders. This API call is cached for 10 seconds. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Open orders for market

Return user's open orders for market. This API call is cached for 10 seconds. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

path Parameters
market_symbol
required
string[a-z0-9\-]+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Order status

Returns order status. This call will be executed on the account (Sub or Main), to which the used API key is bound to. Order can be fetched by using either id or client_order_id parameter. For closed orders, this call only returns information for the last 30 days. 'Order not found' error will be returned for orders outside this time range.

Possible errors
Reason Action
Missing id POST param Id parameter missing.
Invalid order id Order id parameter can only be number.
Order not found. Order with that id was not found in our system.
Request Body schema: application/json
id
string

Order ID.

client_order_id
string

(Optional) Client order id. (Can only be used if order was placed with client order id parameter.).

omit_transactions
string

(Optional) Omits list of transactions for order ID. Possible value: True

Responses

Request samples

Content type
application/json
{
  • "id": "1234123412341234",
  • "client_order_id": "1234123412341234",
  • "omit_transactions": true
}

Response samples

Content type
application/json
Example
{
  • "id": 1458532827766784,
  • "datetime": "2022-01-31 14:43:15",
  • "type": "0",
  • "status": "Open",
  • "market": "BTC/USD",
  • "transactions": [
    ],
  • "amount_remaining": "100.00",
  • "client_order_id": "0.50000000"
}

Sell instant order

Open an instant sell order. By placing an instant order you acknowledge that the execution of your order depends on the market conditions and that these conditions may be subject to sudden changes that cannot be foreseen. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing amount and/or price POST parameters Missing one or both parameters.
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
Minimum order size is 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH Order value must be at least 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH
You can only sell 'amount' 'currency'. Check your account balance for details. Account has less 'available_currency' than is required to make this order.
Order could not be placed. Order could not be placed (perhaps due to internal error or trade halt). Please retry placing order.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
amount
required
number

Amount in base currency (Example: For BTC/USD pair, amount is quoted in BTC)

amount_in_counter
boolean

(Optional) Instant sell orders allow you to sell an amount of the base currency determined by the value of it in the counter-currency. Amount_in_counter sets the amount parameter to refer to the counter currency instead of the base currency of the selected trading pair. Possible value: True

client_order_id
string

Client order ID set by the client for internal reference. It should be unique, but there are no additional constraints or checks guaranteed on the field by Bitstamp.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "1234123412341234",
  • "market": "BTC/USD",
  • "datetime": "2022-01-31 14:43:15.796000",
  • "type": "0",
  • "price": "2211.00",
  • "amount": "45.00000000",
  • "client_order_id": "123456789"
}

Sell market order

Open a sell market order. By placing a market order you acknowledge that the execution of your order depends on the market conditions and that these conditions may be subject to sudden changes that cannot be foreseen. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing amount and/or price POST parameters Missing one or both parameters.
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
Minimum order size is 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH Order value must be at least 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH
You can only sell 'amount' 'currency'. Check your account balance for details. Account has less 'available_currency' than is required to make this order.
No buy orders for currency pair 'currency_pair' The buy side of the orderbook for 'currency_pair' is empty, therefore a market sell order cannot be placed.
Maximum market sell amount at the moment is 'amount' 'currency'. Please use limit order instead. Order amount exceeds the limit amount set for market sell orders.
Order could not be placed. Order could not be placed (perhaps due to internal error or trade halt). Please retry placing order.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
amount
required
number

Amount in base currency (Example: For BTC/USD pair, amount is quoted in BTC)

client_order_id
string

Client order ID set by the client for internal reference. It should be unique, but there are no additional constraints or checks guaranteed on the field by Bitstamp.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "1234123412341234",
  • "market": "BTC/USD",
  • "datetime": "2022-01-31 14:43:15.796000",
  • "type": "0",
  • "price": "2211.00",
  • "amount": "45.00000000",
  • "client_order_id": "123456789"
}

Sell limit order

Open a sell limit order. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Missing amount and/or price POST parameters Missing one or both parameters.
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
Minimum order size is 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH Order value must be at least 10 USD / 10 EUR / 10 GBP / 10 USDT / 10 USDC / 10 PAX / 10 GUSD / 0.0002 BTC / 0.002 ETH
Price is more than 20% below market price. Order price must not exceed 20% of current price.
You have only 'available_btc' BTC available. Check your account balance for details. Account has less 'available_btc' than is required to make this order.
Buy if executed price must be lower than sell price. 'limit_price' must be lower than 'price' parameter.
Both limit_price and daily_order cannot be set. Only one of those parameters can be set.
Order could not be placed. Order could not be placed (perhaps due to internal error or trade halt). Please retry placing order.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
amount
required
number [ 1e-8 .. 92233720368 ]

Amount.

price
required
number [ 1e-8 .. 92233720368 ]

Price.

limit_price
number [ 1e-8 .. 92233720368 ]

If the order gets executed, a new opposite order will be placed, with "limit_price" as its price.

daily_order
boolean

Opens limit order which will be canceled at 0:00 UTC unless it already has been executed.

ioc_order
boolean

An Immediate-Or-Cancel (IOC) order is an order that must be executed immediately. Any portion of an IOC order that cannot be filled immediately will be cancelled.

fok_order
boolean

A Fill-Or-Kill (FOK) order is an order that must be executed immediately in its entirety. If the order cannot be immediately executed in its entirety, it will be cancelled.

moc_order
boolean

A Maker-Or-Cancel (MOC) order is an order that ensures it is not fully or partially filled when placed. In case it would be, the order is cancelled.

gtd_order
boolean

A Good-Till-Date (GTD) lets you select an expiration time up until which the order will be open. Note that all GTD orders are cancelled at 00:00:00 UTC.

expire_time
integer <int32>

Unix timestamp in milliseconds. Required in case of GTD order.

client_order_id
string

Client order ID set by the client for internal reference. It should be unique, but there are no additional constraints or checks guaranteed on the field by Bitstamp.

Responses

Response samples

Content type
application/json
Example
{
  • "id": "1234123412341234",
  • "market": "BTC/USD",
  • "datetime": "2022-01-31 14:43:15.796000",
  • "type": "0",
  • "price": "2211.00",
  • "amount": "45.00000000",
  • "client_order_id": "123456789"
}

Withdrawals

Collection of endpoints for managing withdrawals.

Ripple IOU withdrawal

This call will be executed on the account (Sub or Main), to which the used API key is bound to. This endpoint supports withdrawals of USD, BTC, EUR or ETH IOU on the XRP Ledger.

*IOU supported globally except in the US and Singapore. ETH-IOU is also unsupported in UK

Possible errors
Reason Action
Missing amount and/or address POST parameters One or both parameters missing.
User not verified Your account needs to be verified before you can use this endpoint.
'crypto_currency' withdrawals are currently unavailable for your account Contact support for additional information.
Not allowed to withdraw to specified 'crypto_currency' address API key is set for withdrawing to another 'crypto_currency' address.
Enter a number. Use "." as a decimal point Amount parameter can only be number.
You have only 'available' 'crypto_currency' available. Check your account balance for details Account has less available 'crypto_currency' than are required to make this withdrawal.
Your withdrawals are currently disabled No new withdrawals can be opened at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.
Ensure this value is greater than or equal to 'minimum_withdrawal_amount' Minimum withdrawal amount is 'minimum_withdrawal_amount'.
Ensure this value has at least 'minimum_address_length' characters (it has x). Ensure this value has at most 'maximum_address_length' characters (it has x). Address parameter must be between 'minimum_address_length' and 'maximum_address_length' characters long.
Contact does not exist Review and validate the contact_uuid to ensure it matches an existing contact, you may also create contacts at the /v2/travel_rule/contacts endpoint
Contact is missing required information Ensure that contact has all the required information in case of retail_info, first_name and last_name are required.
Vasp does not exist Verify that the vasp_uuid exists within the /v2/travel_rule/vasps endpoint.
contact_uuid: You must set this field because contact_thirdparty=True contact_uuid must be provided if withdrawing to a third party
The address you provided is not verified You must verify this address before you can withdraw to it.
Request Body schema: www-form-urlencoded
address
required
string

Ripple address.

amount
required
number

Currency amount.

contact_thirdparty
boolean

If the address you are withdrawing to is in your name (regardless of if this is a hosted or unhosted wallet), this should be set to False. If you are withdrawing to a third party, set it to True

contact_uuid
string <uuid>

If setting the contact_thirdparty field to True, you need to provide the UUID of the contact from the /v2/travel_rule/contacts/ endpoint

currency
required
string

Currency to withdraw.

vasp_uuid
string <uuid>

When withdrawing to a hosted wallet by a Virtual Asset Services Provider, provide the UUID from the /v2/travel_rule/vasps/ endpoint

Responses

Response samples

Content type
application/json
Example
{
  • "id": 1
}

Withdrawal requests

Return user's withdrawal requests. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Invalid timedelta Timedelta needs to have only numeric characters.
Timedelta too large Timedelta too large.
Invalid offset Offset needs to be numeric characters between 0 and 200000.
Invalid limit Limit needs to be numeric characters between 1 and 1000.
Invalid id Id needs to have only numeric characters.
Both limit and offset must be present Both limit and offset must be present.
Too many parameters Pick one or combination of parameters and run again.
Request Body schema: www-form-urlencoded
id
string

Withdrawal request id.

limit
string

Limit result to that many withdrawal requests (minimum: 1; maximum: 1000; default: 1000).

offset
string

Skip that many withdrawal requests before returning results (minimum: 0; maximum: 200000).

timedelta
string <= 10 characters

Withdrawal requests from number of seconds ago to now (max. 50000000).

Responses

Response samples

Content type
application/json
Example
{
  • "address": "aMDHooGmAkyrsaQiKhAORhSNTmoRzxqWIO",
  • "amount": "0.00006000",
  • "currency": "BTC",
  • "datetime": "2022-01-31 16:07:32",
  • "id": 1,
  • "network": "bitcoin",
  • "status": 2,
  • "transaction_id": "NsOeFbQhRnpGzNIThWGBTkQwRJqTNOGPVhYavrVyMfkAyMUmIlUpFIwGTzSvpeOP",
  • "txid": 1,
  • "type": 0
}

Cancel bank or crypto withdrawal

Cancels a bank or crypto withdrawal request. This call can only be performed by your Main Account.

Possible errors
Reason Action
Cancelling bank withdrawals with sub account API keys is not supported. This API endpoint can only be utilized by your main account.
Missing parameters: [...] Parameters stated in the list ([...]) are required for this call.
No active bank withdrawal with id=X found. Could not find any active bank withdrawal with the id X. Will return the same response for already cancelled withdrawal requests.
Cannot cancel a withdrawal in process (id=X). The bank withdrawal request with id=X is currently being processed and cannot be cancelled.
Your withdrawals are currently disabled No bank withdrawals can be canceled at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.
Request Body schema: www-form-urlencoded
id
required
string

ID of the withdrawal request.

Responses

Response samples

Content type
application/json
Example
{
  • "account_currency": "EUR",
  • "amount": 100,
  • "currency": "EUR",
  • "id": "1",
  • "type": "EU bank transfer (SEPA)"
}

Open bank withdrawal

Opens a bank withdrawal request (SEPA or international). Withdrawal requests opened via API are automatically confirmed (no confirmation e-mail will be sent), but are processed just like withdrawals opened through the platform's interface. This call can only be performed by your Main Account.

Possible errors
Reason Action
Opening bank withdrawals with sub account API keys is not supported. This API endpoint can only be utilized by your main account.
'X': ['This field is required.'] Parameter X is required for this call.
'X': ['Select a valid choice. Y is not one of the available choices.'] Y is not a valid value for parameter X.
Bank withdrawals temporarily disabled. No new bank withdrawals can be opened at this time.
Unsupported withdrawal type (must be either SEPA or international). When opening bank withdrawals, you must specify one of the two supported types: SEPA or international.
When opening bank withdrawals, you must specify one of the two supported types: SEPA or international. To open this withdrawal, your balance must have at least 'amount' of target currency available.
'X': ['Enter a number. Use "." as a decimal point.'] Parameter X can only be a decimal number.
Your withdrawals are currently disabled No new withdrawals can be opened at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.
Request Body schema: www-form-urlencoded
account_currency
required
string

The balance from which you wish to withdraw. Can be either "USD", "EUR" or "GBP".

address
required
string

User or company address.

amount
required
string

The amount to withdraw.

bank_address
string

Target bank address (international withdrawals only).

bank_city
string

Target bank city (international withdrawals only).

bank_country
string

Target bank country. Country codes must be in accordance with the ISO 3166-1 standard (use two character Alpha-2 codes). Disclaimer: Not all country choices listed at this reference URL are supported. For a detailed list please refer to our platform's withdrawal interfaces (international withdrawals only).

bank_name
string

Target bank name (international withdrawals only).

bank_postal_code
string

Target bank postal code (international withdrawals only).

bic
required
string

The target bank BIC.

city
required
string

User or company city.

comment
string

Withdrawal comment.

country
required
string

User or company country. Country codes must be in accordance with the ISO 3166-1 standard (use two character Alpha-2 codes). Disclaimer: Not all country choices listed at this reference URL are supported. For a detailed list please refer to our platform's withdrawal interfaces.

currency
string

The currency in which the funds should be withdrawn (may involve conversion fees). Currency codes must be in accordance with the ISO 4217 standard. Disclaimer: Not all currency choices listed at this reference URL are supported. For a detailed list please refer to our platform's withdrawal interfaces. (international withdrawals only)

iban
required
string

User or company IBAN.

name
required
string

Full user or company name.

postal_code
required
string

User or company postal code.

type
required
string

Type of the withdrawal request ("sepa" or "international").

Responses

Response samples

Content type
application/json
Example
{
  • "withdrawal_id": 1
}

Fiat withdrawal status

Checks the status of a fiat withdrawal request. This call can only be performed by your Main Account.

Possible errors
Reason Action
Performing bank withdrawal status checks with sub account API keys is not supported. This API endpoint can only be utilized by your main account.
Missing parameters: [...]. Parameters stated in the list ([...]) are required for this call.
No bank withdrawal with id=X found. Could not find any bank withdrawal with the id X.
Request Body schema: www-form-urlencoded
id
required
string

ID of the withdrawal request.

Responses

Response samples

Content type
application/json
Example
{
  • "status": "Waiting to be processed"
}

Crypto withdrawal

Request a crypto withdrawal.

Possible errors
Reason Action
Missing amount and/or address POST parameters One or both parameters missing.
User not verified Your account needs to be verified before you can use this endpoint.
'crypto_currency' withdrawals are currently unavailable for your account Contact support for additional information.
Not allowed to withdraw to specified 'crypto_currency' address API key is set for withdrawing to another 'crypto_currency' address.
Enter a number. Use "." as a decimal point Amount parameter can only be number.
You have only 'available' 'crypto_currency' available. Check your account balance for details Account has less available 'crypto_currency' than are required to make this withdrawal.
Your withdrawals are currently disabled No new withdrawals can be opened at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.
Ensure this value is greater than or equal to 'minimum_withdrawal_amount' Minimum withdrawal amount is 'minimum_withdrawal_amount'.
Ensure this value has at least 'minimum_address_length' characters (it has x). Ensure this value has at most 'maximum_address_length' characters (it has x). Address parameter must be between 'minimum_address_length' and 'maximum_address_length' characters long.
Invalid network selection The selected network is not supported for 'currency'. Please select a compatible network for it.
Contact does not exist Review and validate the contact_uuid to ensure it matches an existing contact, you may also create contacts at the /v2/travel_rule/contacts endpoint
Contact is missing required information Ensure that contact has all the required information in case of retail_info, first_name and last_name are required.
Vasp does not exist Verify that the vasp_uuid exists within the /v2/travel_rule/vasps endpoint.
contact_uuid: You must set this field because contact_thirdparty=True contact_uuid must be provided if withdrawing to a third party
The address you provided is not verified You must verify this address before you can withdraw to it.
path Parameters
currency
required
string
Request Body schema: www-form-urlencoded
address
required
string

Cryptocurrency address.

amount
required
number

Cryptocurrency amount.

contact_thirdparty
boolean

If the address you are withdrawing to is in your name (regardless of if this is a hosted or unhosted wallet), this should be set to False. If you are withdrawing to a third party, set it to True

contact_uuid
string <uuid>

If setting the contact_thirdparty field to True, you need to provide the UUID of the contact from the /v2/travel_rule/contacts/ endpoint

destination_tag
required
string

Address destination tag - applicable to: XRP.

memo_id
string

Address memo id - applicable to: XLM, HBAR, GYEN, VCHF, VEUR, ZUSD.

network
string
Enum: "bitcoin-cash" "bitcoin" "ethereum" "litecoin" "stellar" "xrpl" "algorand" "flare" "hedera" "cardano" "songbird" "avalanche-c-chain" "solana" "polkadot" "near" "doge" "sui" "casper" "multiversx" "internet-computer" "xdc-network"

Cryptocurrency network.

transfer_id
integer <int32>

Address transfer id - applicable to: CSPR.

vasp_uuid
string <uuid>

When withdrawing to a hosted wallet by a Virtual Asset Services Provider, provide the UUID from the /v2/travel_rule/vasps/ endpoint

Responses

Response samples

Content type
application/json
Example
{
  • "id": 1
}

Deposits

Collection of endpoints for managing deposits.

Unconfirmed bitcoin deposits

This API call is cached for 60 seconds. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Responses

Response samples

Content type
application/json
Example
{
  • "address": "0x6a56f5b80f04b4fd70d64d72e1396698635e5436",
  • "destination_tag": 89473951,
  • "memo_id": "299576079",
  • "transfer_id": 89473951
}

Ripple IOU deposit address

This API call is cached for 60 seconds. This call will be executed on the account (Sub or Main), to which the used API key is bound to. This endpoint supports withdrawals of USD, BTC, EUR and ETH IOU on the XRP Ledger.

*IOU supported globally except in the US and Singapore. ETH-IOU is also unsupported in UK.

Possible errors
Reason Action
User not verified Your account needs to be verified before you can use this endpoint.
Your deposits are currently disabled No new deposits can be made at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.

Responses

Response samples

Content type
application/json
Example
{
  • "address": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
  • "destination_tag": 89473951
}

Crypto deposit address

This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
User not verified Your account needs to be verified before you can use this endpoint.
Your deposits are currently disabled No new deposits can be made at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.
Invalid network selection The selected network is not supported for 'currency'. Please select a compatible network for it.
path Parameters
currency
required
string
Request Body schema: application/json
network
string
Enum: "bitcoin-cash" "bitcoin" "ethereum" "litecoin" "stellar" "xrpl" "algorand" "flare" "hedera" "cardano" "songbird" "avalanche-c-chain" "solana" "polkadot" "near" "doge" "sui" "casper" "multiversx" "internet-computer" "xdc-network"

Cryptocurrency network.

Responses

Request samples

Content type
application/json
{
  • "network": "bitcoin"
}

Response samples

Content type
application/json
Example
{
  • "address": "0x6a56f5b80f04b4fd70d64d72e1396698635e5436",
  • "destination_tag": 89473951,
  • "memo_id": "299576079",
  • "transfer_id": 89473951
}

Sub account

Collection of endpoints for managing Sub Accounts.

Transfer balance from Main to Sub Account

Transfers the desired balance from your Main Account to a Sub Account, specified by the subAccount parameter. This call can only be performed by your Main Account.

Possible errors
Reason Action
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
You have only 'available' 'currency' available. Check your account balance for details. Account has less 'available_currency' than is required to make this transfer.
Select a valid choice. X is not one of the available choices. X is not valid currency. Select a valid currency.
Sub account with identifier "X" does not exist. Can't find sub account with id X.
Request Body schema: www-form-urlencoded
amount
required
number

Amount.

currency
required
string

Currency.

subAccount
required
integer <int32>

The Sub Account unique identifier.

Responses

Response samples

Content type
application/json
Example
{
  • "reason": "Missing parameters: [\"subAccount\"].",
  • "status": "error"
}

Transfer balance from Sub to Main account

Transfers the desired balance from a Sub Account to your Main Account. Can be called by either the Main Account or a Sub Account, but requires a permission in both cases. The subAccount parameter must be provided if the Main Account is initiating the call. If a Sub Account is making the call, then it is the target Sub Account for the transfer and no further clarification is required. In that case, passing this parameter will have no additional effect.

Possible errors
Reason Action
'parameter': Enter a number. Use "." as a decimal point. 'parameter' can only be number.
You have only 'available' 'currency' available. Check your account balance for details. Account has less 'available_currency' than is required to make this transfer.
Select a valid choice. X is not one of the available choices. X is not valid currency. Select a valid currency.
Sub account with identifier "X" does not exist. Can't find sub account with id X.
Request Body schema: www-form-urlencoded
amount
required
number

Amount.

currency
required
string

Currency.

subAccount
required
integer <int32>

The Sub Account unique identifier.

Responses

Response samples

Content type
application/json
Example
{
  • "reason": "Missing parameters: [\"subAccount\"].",
  • "status": "error"
}

Instant convert

If you want us to convert your crypto directly to fiat upon deposit, you can use the following endpoints.

Instant convert address

Shows transactions for the instant convert address.

Possible errors
Reason Action
Address not found. Provided address is wrong.
Request Body schema: www-form-urlencoded
address
string

Shows transactions for specific instant convert address or for all users instant convert addresses.

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

New instant convert address

Creates a new instant convert address which will automatically sell your crypto for specified fiat currency.

Possible errors
Reason Action
Missing liquidation_currency parameter. Parameter liquidation_currency is required for this call.
Invalid currency / Currency [...] not supported. Invalid liquidation_currency.
Cannot create new address, please try later. At the moment we can't create new deposit address. Try again later.
Invalid address format. Invalid address_format.
Your trading features are currently disabled No new liquidation addresses can be created at this time. If a URL is provided you can follow it to resolve any issues which might be causing this.
Request Body schema: www-form-urlencoded
address_format
string
Address format. Can be either "P2SHP2WSH" or "BECH32".
liquidation_currency
string

Deposited BTCs will be automatically converted to liquidation_currency.

Responses

Response samples

Content type
application/json
Example
{
  • "address": "3MDvHUAg41uJx1511gDotsf4ccKuc9frz1"
}

Websocket

Collection of endpoints for managing Websocket access.

Websockets token

Generates token required for subscribing to private WebSocket channels.

Responses

Response samples

Content type
application/json
{
  • "token": "vRQqHEFoxp23seihJnbhPGt0lgBG5EFe",
  • "user_id": 1,
  • "valid_sec": 60
}

Transactions

Collection of endpoints that return transaction info.

Crypto transactions

Return user's crypto transactions. This call will be executed on the account, to which the used API key is bound to. This call is for your main account only.

Possible errors
Reason Action
Limit too large Max value of limit parameter is 1000.
Invalid limit Limit parameter should be number from 1 to 1000.
Offset too large Offset parameter cannot be larger than 200000.
Invalid offset Offset parameter needs to be a number from 0 to 200000.
Request Body schema: www-form-urlencoded
include_ious
boolean

True - shows also ripple IOU transactions.

limit
integer <int32>

Limit result to that many transactions (default: 100; maximum: 1000).

offset
integer <int32>

Skip that many transactions before returning results (default: 0, maximum: 200000).

Responses

Response samples

Content type
application/json
Example
{
  • "deposits": [
    ],
  • "ripple_iou_transactions": [
    ],
  • "withdrawals": [
    ]
}

User transactions

Return user transactions from a given time frame. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Invalid offset Offset parameter should be number from 0 to 200000.
Limit too large Max value of limit parameter is 1000.
Invalid limit Limit parameter should be number from 1 to 1000.
Invalid sort parameter Sort parameter can only be 'asc' or 'desc'.
Invalid since_timestamp parameter since_timestamp can only be digit.
since_timestamp parameter must be higher than .. Make sure that since_timestamp is less than 30 days in the past.
Failed to convert since_timestamp parameter Check the value of since_timestamp parameter.
Invalid until_timestamp parameter until_timestamp can only be digit.
until_timestamp parameter must be higher than .. Make sure that until_timestamp is less than 30 days in the past.
Failed to convert until_timestamp parameter Check the value of until_timestamp parameter.
Request Body schema: www-form-urlencoded
limit
string

Limit result to that many transactions (default: 100; maximum: 1000).

offset
string

Skip that many transactions before returning results (default: 0, maximum: 200000). If you need to export older history contact support OR use combination of limit and since_id parameters.

since_id
string

(Optional) Show only transactions from specified transaction id. If since_id parameter is used, limit parameter is set to 1000.

since_timestamp
string

(Optional) Show only transactions from unix timestamp (for max 30 days old).

sort
string

Sorting by date and time: asc - ascending; desc - descending (default: desc).

until_timestamp
string

Show only transactions to unix timestamp (for max 30 days old).

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

User transactions for market

Return user transactions for a market from a given time frame. This call will be executed on the account (Sub or Main), to which the used API key is bound to.

Possible errors
Reason Action
Invalid offset Offset parameter should be number from 0 to 200000.
Limit too large Max value of limit parameter is 1000.
Invalid limit Limit parameter should be number from 1 to 1000.
Invalid sort parameter Sort parameter can only be 'asc' or 'desc'.
Invalid since_timestamp parameter since_timestamp can only be digit.
since_timestamp parameter must be higher than .. Make sure that since_timestamp is less than 30 days in the past.
Failed to convert since_timestamp parameter Check the value of since_timestamp parameter.
Invalid until_timestamp parameter until_timestamp can only be digit.
until_timestamp parameter must be higher than .. Make sure that until_timestamp is less than 30 days in the past.
Failed to convert until_timestamp parameter Check the value of until_timestamp parameter.
path Parameters
market_symbol
required
string
Request Body schema: www-form-urlencoded
limit
string

Limit result to that many transactions (default: 100; maximum: 1000).

offset
string

Skip that many transactions before returning results (default: 0, maximum: 200000). If you need to export older history contact support OR use combination of limit and since_id parameters.

since_id
string

(Optional) Show only transactions from specified transaction id. If since_id parameter is used, limit parameter is set to 1000.

since_timestamp
string

(Optional) Show only transactions from unix timestamp (for max 30 days old).

sort
string

Sorting by date and time: asc - ascending; desc - descending (default: desc).

until_timestamp
string

Show only transactions to unix timestamp (for max 30 days old).

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

Travel Rule

Collection of Travel Rule related endpoints

Get all contacts

Returns all contacts that have been previously created. These can then be used to provide the originator or beneficiary details of a Travel Rule message, when transferring crypto from/to the platform.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Successfully retrieved the list of contacts.
403 You do not have sufficient permissions to access this endpoint.
query Parameters
per_page
integer
page
integer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create contact

Enables a contact to be created and relevant information to be provided and stored. This can then be used to provide the originator or beneficiary details of a Travel Rule message, when transferring crypto from/to the platform.

Response Code Status Code Reason
201 Successfully created the contact.
403 You do not have sufficient permissions to access this endpoint.
Request Body schema: application/json
object

Additional info if the beneficiary is a corporate client

description
required
string

Alias for your internal usage of the contact

object

Additional info if the beneficiary is a retail client

Responses

Request samples

Content type
application/json
{
  • "corporate_info": {
    },
  • "description": "",
  • "retail_info": {
    }
}

Response samples

Content type
application/json
{
  • "corporate_info": {
    },
  • "description": "",
  • "id": "258b8c23-48c0-4916-bba9-0dd47bcdd7cf",
  • "retail_info": {
    }
}

Get contact

Returns a specific contact that has been previously created. This can then be used to provide the originator or beneficiary details of a Travel Rule message, when transferring crypto from/to the platform.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Successfully retrieved the contact.
403 You do not have sufficient permissions to access this endpoint.
404 Contact with given contact uuid is not found.
path Parameters
contact_uuid
required
string([0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-...

Responses

Response samples

Content type
application/json
{
  • "corporate_info": {
    },
  • "description": "",
  • "id": "258b8c23-48c0-4916-bba9-0dd47bcdd7cf",
  • "retail_info": {
    }
}

Earn

Collection of endpoints for managing Earn.

Subscribe to earn

Subscribe given amount to lending / staking.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Successfully subscribed to earn.
400 API5001 Earn request amount too low.
400 API5002 Earn request amount too high.
400 API5003 Decimal places in amount exceed maximum allowed.
400 API5004 Operation is unsupported.
400 API5005 Operation is currently unavailable, please try again later.
400 API5006 Required personal information is missing, please reach out to support@bitstamp.net.
400 API5007 Operation is unavailable, please reach out to support@bitstamp.net.
400 API5011 Something went wrong, try again later.
403 This feature is not available for your account.
Request Body schema: application/json
amount
required
number

Amount to subscribe or unsubscribe with.

currency
required
string

Currency

earn_term
required
string
Enum: "FLEXIBLE" "FIXED"

Type of Earn term

earn_type
required
string
Enum: "STAKING" "LENDING"

Type of Earn product

Responses

Request samples

Content type
application/json
{
  • "amount": 10,
  • "currency": "ETH",
  • "earn_term": "FLEXIBLE",
  • "earn_type": "STAKING"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "field": "string",
  • "message": "string"
}

Get earn subscriptions

Get earn subscriptions for user.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Returned earn subscriptions
400 API5011 Something went wrong, try again later.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Manage subscription settings

Manage subscription settings (opt in, opt out). Currently only supported for staking.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Successfully update subscription setting.
400 API5004 Operation is unsupported.
400 API5005 Operation is currently unavailable, please try again later.
400 API5008 Already opted in.
400 API5009 Not opted in.
400 API5010 Insufficient balance.
400 API5011 Something went wrong, try again later.
403 This feature is not available for your account.
Request Body schema: application/json
currency
required
string

Currency

earn_type
required
string
Enum: "STAKING" "LENDING"

Type of Earn product

setting
required
string
Enum: "OPT_IN" "OPT_OUT"

Type of setting action.

Responses

Request samples

Content type
application/json
{
  • "currency": "ALGO",
  • "earn_type": "STAKING",
  • "setting": "OPT_IN"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "field": "string",
  • "message": "string"
}

Get earn transactions

Get earn transaction history.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Returned earn transaction history.
400 API5011 Something went wrong, try again later.
query Parameters
currency
string
Example: currency=ETH

Currency

limit
integer <int32> [ 0 .. 1000 ]
Default: 100
Example: limit=100

Limit result to that many events (default: 100; maximum: 1000)

offset
integer <int32> [ 0 .. 200000 ]
Default: 0
Example: offset=0

Skip that many events before returning results (default: 0, maximum: 200000)

quote_currency
string
Example: quote_currency=USD

Currency in which value is calculated

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Unsubscribe from earn

Unsubscribe given amount from lending / staking.

The below table defines the HTTP Status codes that this API may return

Response Code Status Code Reason
200 Successfully unsubscribed from earn.
400 API5001 Earn request amount too low.
400 API5002 Earn request amount too high.
400 API5003 Decimal places in amount exceed maximum allowed.
400 API5004 Operation is unsupported.
400 API5005 Operation is currently unavailable, please try again later.
400 API5011 Something went wrong, try again later.
400 API5012 Staked balance is insufficient.
403 This feature is not available for your account.
Request Body schema: application/json
amount
required
number

Amount to subscribe or unsubscribe with.

currency
required
string

Currency

earn_term
required
string
Enum: "FLEXIBLE" "FIXED"

Type of Earn term

earn_type
required
string
Enum: "STAKING" "LENDING"

Type of Earn product

Responses

Request samples

Content type
application/json
{
  • "amount": 10,
  • "currency": "ETH",
  • "earn_term": "FLEXIBLE",
  • "earn_type": "STAKING"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "field": "string",
  • "message": "string"
}

Security

Collection of security related endpoints.

Revoke all API access

Revoke all API keys across all user's accounts.

Request Body schema: application/json

This endpoint does not expect a request body.

object (EmptySchema)

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "revoked_api_keys": [
    ]
}