Bitstamp application programming interface (API) allows our clients to access and control their accounts, using custom written software.
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 |
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.
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.
All private API calls require authentication. For a successful authentication you need to provide the following authorization headers in your request:
Code | Reason | Action |
---|---|---|
API0001 | API key not found | Check your API key value. |
API0002 | IP address not allowed | This IP address has no permission to use this API key. |
API0003 | No permission found | API key doesn't have permission for calling this api endpoint. |
API0004 | Invalid nonce | Check your nonce value. It must be different than last nonce used in the last 150 seconds. |
API0005 | Invalid signature | Posted signature doesn't match with ours. |
API0006 | Your account is frozen | Contact support to unfreeze your account. |
API0008 | Authentication failed | Can't find customer with selected API key. |
API0009 | Please update your profile with your FATCA information, before using API. | Check that you filled out the FATCA information form on your account. |
API0010 | Invalid version | Check that you send "v2" in the version authorization header. |
API0011 | Wrong API key format | Check that your API key string is correct. |
API0012 | X-Auth header is required | X-Auth header is probably missing in your request. |
API0013 | X-Auth-Signature header is required | X-Auth-Signature header is probably missing in your request. |
API0014 | X-Auth-Nonce header is required | X-Auth-Nonce header is probably missing in your request. |
API0015 | X-Auth-Timestamp header is required | X-Auth-Timestamp header is probably missing in your request. |
API0016 | X-Auth-Version header is required | X-Auth-Version header is probably missing in your request. |
API0017 | X-Auth-Timestamp header is out of boundaries | Timestamp you added in the header is either too old or too new. Check that timestamp is within 150 second timeframe. |
API0018 | X-Auth-Timestamp header is invalid | Check the format of X-Auth-Timestamp header. |
API0019 | Content-Type header is not accepted | Please specify the correct content type. |
API0020 | Content-Type header should not be present | Please make sure you're not sending any body in the request. |
API0021 | Please make sure url query string is not too long | Please make sure the total length of the url does not exceed 2000 characters. |
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
X-Auth-Signature
Note: if the request body is empty, the Content-Type header has to be removed both from the headers and from the signature
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)
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);
}
}
}
#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;
}
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 endpointapi/v2/markets/
- We will no longer guarantee
/api/v2/trading-pairs-info/
to work after Dec 31st 2024
- We will no longer guarantee
- 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/
responsePOST /api/v2/{currency}_withdrawal/
request
2023-10-12
- New API changes due to compliance with Travel Rule requirements:
- Travel Rule endpoints: https://www.bitstamp.net/api/#tag/Travel-rule-public
- Changes to all crypto withdrawals to provide optional Travel Rule data (this data will become mandatory in the near future which will be a breaking change!).
- 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.
Response samples
- 200
[- {
- "name": "Bitcoin",
- "currency": "BTC",
- "type": "crypto",
- "symbol": "₿",
- "decimals": 8,
- "logo": "https://assets.bitstamp.net/static/webapp/images/currencies/btc.8f1b1e09e4fa24d3fde4d2a158a6df9a34261bb3.svg",
- "available_supply": "234565.232",
- "deposit": "Enabled",
- "withdrawal": "Enabled",
- "networks": [
- {
- "deposit": "Enabled",
- "network": "ethereum",
- "withdrawal": "Enabled",
- "withdrawal_decimals": 8,
- "withdrawal_minimum_amount": "0.01"
}
]
}
]
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
- 200
[- {
- "ask": "2211.00",
- "bid": "2188.97",
- "high": "2811.00",
- "last": "2211.00",
- "low": "2188.97",
- "open": "2211.00",
- "open_24": "2211.00",
- "pair": "BTC/USD",
- "percent_change_24": "13.57",
- "side": "0",
- "timestamp": "1643640186",
- "volume": "213.26801100",
- "vwap": "2189.80"
}
]
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
- 200
{- "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
- 200
{- "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
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
- 200
{- "asks": [
- [
- "9484.34",
- "1.00000000"
]
], - "bids": [
- [
- "9484.34",
- "1.00000000"
]
], - "microtimestamp": "1643643584684047",
- "timestamp": "1643643584"
}
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
- 200
{- "amount": "0.00676053",
- "date": "1644406050",
- "price": "43524.69",
- "tid": "220744838",
- "type": "string"
}
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
- 200
- 400
{- "data": [
- {
- "name": "Bitstamp",
- "uuid": "258b8c23-48c0-4916-bba9-0dd47bcdd7cf"
}
], - "pagination": {
- "page": 0,
- "size": 0,
- "count": 0
}
}
Response samples
- 200
[- {
- "name": "BTC/USD",
- "market_symbol": "btcusd",
- "base_currency": "BTC",
- "base_decimals": 8,
- "counter_currency": "USD",
- "counter_decimals": 2,
- "minimum_order_value": "20.0",
- "maximum_order_value": "200.0",
- "minimum_order_amount": "0.01",
- "maximum_order_amount": "10",
- "trading": "Enabled",
- "instant_order_counter_decimals": 2,
- "instant_and_market_orders": "Enabled",
- "description": "Bitcoin / U.S. dollar"
}
]
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
- 200
{- "data": {
- "pair": "BTC/USD",
- "ohlc": [
- {
- "timestamp": "1643630400",
- "open": "2188.97",
- "high": "2211.00",
- "low": "2188.97",
- "close": "2188.97",
- "volume": "4.01560417"
}
]
}
}
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
- Payload
{- "network": "bitcoin"
}
Response samples
- 200
{- "currency": "btc",
- "fee": "0.00015000",
- "network": "bitcoin"
}
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
- 200
{- "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
- 200
{- "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
- 200
{- "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
- 200
{- "canceled": [
- {
- "id": 1453282316578816,
- "amount": "0.02035278",
- "price": "2100.45",
- "type": 0,
- "currency_pair": "BTC/USD",
- "market": "BTC/USD"
}
], - "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
- 200
{- "canceled": [
- {
- "id": 1453282316578816,
- "amount": "0.02035278",
- "price": "2100.45",
- "type": 0,
- "currency_pair": "BTC/USD",
- "market": "BTC/USD"
}
], - "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
- 200
{- "id": 1453282316578816,
- "amount": "0.02035278",
- "price": "2100.45",
- "type": 0,
- "market": "BTC/USD"
}
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
- 200
[- {
- "id": "1234123412341234",
- "datetime": "2022-01-31 14:43:15",
- "type": "0",
- "price": "100.00",
- "amount": "0.50000000",
- "amount_at_create": "0.50000000",
- "currency_pair": "BTC/USD",
- "market": "BTC/USD",
- "limit_price": "110.00",
- "client_order_id": "1234123412341234"
}
]
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
- 200
[- {
- "id": "1234123412341234",
- "datetime": "2022-01-31 14:43:15",
- "type": "0",
- "price": "100.00",
- "amount": "0.50000000",
- "amount_at_create": "0.50000000",
- "market": "BTC/USD",
- "limit_price": "110.00",
- "client_order_id": "1234123412341234"
}
]
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
- Payload
{- "id": "1234123412341234",
- "client_order_id": "1234123412341234",
- "omit_transactions": true
}
Response samples
- 200
{- "id": 1458532827766784,
- "datetime": "2022-01-31 14:43:15",
- "type": "0",
- "status": "Open",
- "market": "BTC/USD",
- "transactions": [
- {
- "tid": 1,
- "price": "100.00",
- "{from_currency}": "101.00",
- "{to_currency}": "1",
- "fee": "1.00",
- "datetime": "2022-01-31 14:43:15",
- "type": 0
}
], - "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
- 200
{- "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
- 200
{- "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
- 200
{- "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"
}
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
- 200
{- "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
- 200
{- "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
- 200
{- "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
- 200
{- "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
- 200
{- "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
- 200
{- "id": 1
}
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
- 200
{- "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
- 200
{- "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
- Payload
{- "network": "bitcoin"
}
Response samples
- 200
{- "address": "0x6a56f5b80f04b4fd70d64d72e1396698635e5436",
- "destination_tag": 89473951,
- "memo_id": "299576079",
- "transfer_id": 89473951
}
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
- 200
{- "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
- 200
{- "reason": "Missing parameters: [\"subAccount\"].",
- "status": "error"
}
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
- 200
[- {
- "address": "3MDvHUAg41uJx1511gDotsf4ccKuc9frz1",
- "currency_pair": "BTC/USD",
- "transactions": [
- {
- "count": 1,
- "order_id": 1,
- "trades": [
- {
- "btc_amount": "1.0",
- "exchange_rate": "1.0",
- "fees": "0.0"
}
]
}
]
}
]
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
|
liquidation_currency | string Deposited BTCs will be automatically converted to liquidation_currency. |
Responses
Response samples
- 200
{- "address": "3MDvHUAg41uJx1511gDotsf4ccKuc9frz1"
}
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
- 200
{- "deposits": [
- {
- "amount": 0.00012,
- "currency": "BTC",
- "datetime": 1642665114,
- "destinationAddress": "3FiKkjgZ6Sj4RWp3ZsCjYh5Pt7ZCBsL7uF",
- "network": "bitcoin",
- "txid": "e4123d1d57df4106aaae5ec4d77eb6cd42e226d020a0a2c1c7919d14b932494b"
}
], - "ripple_iou_transactions": [
- {
- "amount": 0.00012,
- "currency": "BTC",
- "datetime": 1642665114,
- "destinationAddress": "3FiKkjgZ6Sj4RWp3ZsCjYh5Pt7ZCBsL7uF",
- "network": "bitcoin",
- "txid": "e4123d1d57df4106aaae5ec4d77eb6cd42e226d020a0a2c1c7919d14b932494b"
}
], - "withdrawals": [
- {
- "amount": 0.00012,
- "currency": "BTC",
- "datetime": 1642665114,
- "destinationAddress": "3FiKkjgZ6Sj4RWp3ZsCjYh5Pt7ZCBsL7uF",
- "network": "bitcoin",
- "txid": "e4123d1d57df4106aaae5ec4d77eb6cd42e226d020a0a2c1c7919d14b932494b"
}
]
}
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
- 200
[- {
- "datetime": "2022-03-01 10:54:53.849000",
- "fee": "0.62563",
- "id": 1,
- "order_id": 1463489000206336,
- "self_trade": true,
- "self_trade_order_id": 1,
- "type": "1",
- "{currency_pair}": 1,
- "{from_currency}": "-1.0",
- "{to_currency}": "1.0"
}
]
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
- 200
[- {
- "datetime": "2022-03-01 10:54:53.849000",
- "fee": "0.62563",
- "id": 1,
- "order_id": 1463489000206336,
- "self_trade": true,
- "self_trade_order_id": 1,
- "type": "1",
- "{currency_pair}": 1,
- "{from_currency}": "-1.0",
- "{to_currency}": "1.0"
}
]
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
- 200
[- {
- "corporate_info": {
- "company_name": "Good company"
}, - "description": "",
- "id": "258b8c23-48c0-4916-bba9-0dd47bcdd7cf",
- "retail_info": {
- "first_name": "John",
- "last_name": "Doe"
}
}
]
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
- Payload
{- "corporate_info": {
- "company_name": "Good company"
}, - "description": "",
- "retail_info": {
- "first_name": "John",
- "last_name": "Doe"
}
}
Response samples
- 201
- 400
{- "corporate_info": {
- "company_name": "Good company"
}, - "description": "",
- "id": "258b8c23-48c0-4916-bba9-0dd47bcdd7cf",
- "retail_info": {
- "first_name": "John",
- "last_name": "Doe"
}
}
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
- 200
- 400
{- "corporate_info": {
- "company_name": "Good company"
}, - "description": "",
- "id": "258b8c23-48c0-4916-bba9-0dd47bcdd7cf",
- "retail_info": {
- "first_name": "John",
- "last_name": "Doe"
}
}
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
- Payload
{- "amount": 10,
- "currency": "ETH",
- "earn_term": "FLEXIBLE",
- "earn_type": "STAKING"
}
Response samples
- 400
{- "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
- 200
[- {
- "activation_period": "24 hours",
- "amount": 1,
- "amount_earned": 2,
- "available_amount": 1,
- "currency": "ETH",
- "distribution_period": "DAILY",
- "estimated_annual_yield": 10,
- "minimum_subscription_amount": 0,
- "term": "FIXED",
- "type": "LENDING"
}
]
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
- Payload
{- "currency": "ALGO",
- "earn_type": "STAKING",
- "setting": "OPT_IN"
}
Response samples
- 400
{- "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
- 200
[- {
- "amount": 10,
- "currency": "ETH",
- "datetime": "2022-01-31 14:43:15.796000",
- "quote_currency": "USD",
- "status": "COMPLETED",
- "type": "SUBSCRIBE",
- "value": 100
}
]
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
- Payload
{- "amount": 10,
- "currency": "ETH",
- "earn_term": "FLEXIBLE",
- "earn_type": "STAKING"
}
Response samples
- 400
{- "code": "string",
- "field": "string",
- "message": "string"
}
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.
Responses
Request samples
- Payload
{ }
Response samples
- 200
- 400
{- "revoked_api_keys": [
- "rkBWB2SMjCyU4lJKQvjRNwszMr11kSRU",
- "beXTolq77X3GU70rpmBNjwNrvazuHYx8",
- "ltIGEkaqvb79wdRuJk1RLa2MrLdSJMlC"
]
}