PATCH
https://api.cryptohopper.com/v1/hopper/{id}/config
Merges the config keys you send into the hopper config, validates the result and saves it. Returns the full saved config.
OAuth scope:
read manage About scopes
Keys you sent that are unknown or fail validation are dropped and listed in ignored_settings; the field is left out when nothing was dropped. For trading bots the number of allowed_coins is limited by the subscription (15, 50 or 75). Set config.load_api_from to the ID of another of your hoppers on the same exchange to copy its API keys. Not available for AI Bots.
Example request
curl -X PATCH "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/config" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"config":{"allowed_coins":["BTC","ETH","SOL"],"max_open_positions":10,"stop_loss":1,"stop_loss_percentage":5}}'
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/config', {
method: 'PATCH',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"config": {
"allowed_coins": [
"BTC",
"ETH",
"SOL"
],
"max_open_positions": 10,
"stop_loss": 1,
"stop_loss_percentage": 5
}
})
});
const data = await response.json();
import requests
response = requests.patch(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID/config",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"config": {
"allowed_coins": [
"BTC",
"ETH",
"SOL"
],
"max_open_positions": 10,
"stop_loss": 1,
"stop_loss_percentage": 5
}
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/config');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'config' => [
'allowed_coins' => [
'BTC',
'ETH',
'SOL',
],
'max_open_positions' => 10,
'stop_loss' => 1,
'stop_loss_percentage' => 5,
],
]),
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Hopper ID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
config | object | Optional | |
exchange | string | Optional | |
base_currency | string | Optional | |
allowed_coins | array of string | Optional | |
strategy | string | Optional | |
num_targets_per_buy | string | Optional | |
advanced_settings | object | Optional | |
candle_size | string | Optional | One of: 5_min, 15_min, 30_min, 1_hour, 2_hours, 4_hours, 1_day. |
stochastic | integer | Optional | |
stochastic_RSI | integer | Optional | |
RSI | integer | Optional | |
MACD | integer | Optional | |
EMA | integer | Optional | |
KAMA | integer | Optional | |
SMA | integer | Optional | |
bollinger_bands | integer | Optional | |
stoch_fast_K period | integer | Optional | |
stoch_slow_K_period | integer | Optional | |
stoch_slow_KMA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
stoch_slow_D_period | integer | Optional | |
stoch_slow_DMA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
stoch_oversold_threshold | integer | Optional | |
stoch_overbought_threshold | integer | Optional | |
stoch_req_for_buy_signal | integer | Optional | |
stoch_RSI_period | integer | Optional | |
stoch_RSI_fast_K_period | integer | Optional | |
stoch_RSI_fast_D_period | integer | Optional | |
stoch_RSI_fast_DMA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
stoch_RSI_oversold_threshold | integer | Optional | |
stoch_RSI_overbought_threshold | integer | Optional | |
stoch_RSI_req_for_buy_signal | integer | Optional | |
RSI_period | integer | Optional | |
RSI_oversold_threshold | integer | Optional | |
RSI_overbought_threshold | integer | Optional | |
RSI_needed_for_buy_signal | integer | Optional | |
MACD_fast_period | integer | Optional | |
MACD_slow_period | integer | Optional | |
MACD_signal_period | integer | Optional | |
MACD_req_for_buy_signal | integer | Optional | |
EMA_short_period | integer | Optional | |
EMA_long_period | integer | Optional | |
EMA_req_for_buy_signal | integer | Optional | |
SMA_short_period | integer | Optional | |
SMA_long_period | integer | Optional | |
SMA_req_for_buy_signal | integer | Optional | |
KAMA_short_period | integer | Optional | |
KAMA_long_period | integer | Optional | |
KAMA_req_for_buy_signal | integer | Optional | |
bollinger_bands_period | number | Optional | |
bollinger_bands_deviation_upper_band | number | Optional | |
bollinger_bands_deviation_lower_band | number | Optional | |
bollinger_bands_MA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
bollinger_bands_req_for_buy_signal | integer | Optional | |
targets_to_buy | integer | Optional | |
sell_with_strategy | integer | Optional | |
pct_profit | integer | Optional | |
ticker_rate | string | Optional | One of: highest_bid_lowest_ask, last_tick_if_higher_lower, always_last_tick. |
cool_down | integer | Optional | |
one_open_order_coin | integer | Optional | |
pct_lower_bid | number | Optional | |
pct_higher_ask | number | Optional | |
stop_loss_pct | number | Optional | |
trailing_stop_loss | integer | Optional | |
trailing_stop_loss_pct | number | Optional | |
trailing_stop_arm_pct | number | Optional | |
trailing_stop_buy_pct | number | Optional | |
hold_target_is_same | integer | Optional | |
only_buy_positive_pairs | integer | Optional | |
autoclose_position | integer | Optional | |
DCA | integer | Optional | |
DCA_after_time | integer | Optional | |
DCA_max_retries | integer | Optional | |
DCA_pct_trigger | integer | Optional | |
DCA_buy_immediately | integer | Optional | |
DCA_order_size | string | Optional | One of: double_down, triple_down. |
sell_order_max_open_time | integer | Optional | |
buy_order_max_open_time | integer | Optional | |
max_open_positions | integer | Optional | |
coin_max_open_pos | integer | Optional | |
coin_max_open_pos_pct | number | Optional | |
buy_order_amount_pct | number | Optional | |
buy_order_min_amount | number | Optional | |
max_amount_allocated | string | Optional | |
min_buy_amount | string | Optional | |
perc_buy_amount | string | Optional | |
min_buy_amount_force | string | Optional | |
min_buy_score | string | Optional | |
min_sell_score | string | Optional | |
sell_score_corrected | string | Optional | |
buy_score_corrected | string | Optional |
Response
{
"data": {
"config": {
"name": "My BTC bot",
"exchange": "binance",
"collect_currency": "usdt",
"api_key": "***",
"api_secret": "***",
"allowed_coins": [
"BTC",
"ETH",
"SOL"
],
"max_open_positions": "10",
"stop_loss": "1",
"stop_loss_percentage": "5"
},
"message": "Config saved.",
"ignored_settings": [
"unknown_setting"
]
}
}