GET
https://api.cryptohopper.com/v1/hopper/{id}/position/{position_id}
Returns one open position with its effective take profit, stop-loss, trailing stop-loss, auto close and DCA details, including the current DCA profit or loss and DCA target rate based on a live ticker.
OAuth scope:
read About scopes
Not available for exchange arbitrage, market maker, copy and grid bots. Scalar values are returned as strings, except dca_position_lock and dca_coin_lock which are booleans. config is the position's own settings as a JSON string or null. ta_values holds the strategy indicator values of the buy, if any. stop_loss_percentage is left out when stop-loss is off, and trailing_arm_percentage when trailing stop-loss is off.
Example request
curl "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/POSITION_ID" \
-H "access-token: YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/POSITION_ID', {
method: 'GET',
headers: {
"access-token": "YOUR_ACCESS_TOKEN"
}
});
const data = await response.json();
import requests
response = requests.get(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/POSITION_ID",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/POSITION_ID');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
],
]);
$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 |
|---|---|---|---|
position_id |
string | Required | Open position ID. |
id |
string | Required | Hopper ID. |
Response
{
"data": {
"id": "123456",
"hold": "0",
"sold": "0",
"deleted": "0",
"pair": "BTCUSDT",
"config": null,
"rate": "64250.12",
"buy_time": "1758790000",
"currency": "BTC",
"order_id": null,
"percentage_profit": "3",
"trailing_percentage": "0",
"stop_loss": "0",
"auto_close_time": "0",
"amount": "0.0015",
"btc": "0",
"buy_trigger": "synced",
"buy_id": "987654321",
"ta_values": [],
"cost": "96.37518",
"take_profit_levels": null,
"take_profit_levels_done": [],
"trailing_stop_loss_enabled": "0",
"trailing_stop_loss_only": "0",
"stop_loss_enabled": "0",
"auto_close_time_config": "-5 days",
"auto_close_enabled": "0",
"auto_dca": "0",
"dca_enabled": "0",
"dca_latest_average": "0",
"dca_count": "0",
"auto_dca_time": "-1 hours",
"auto_dca_max": "3",
"auto_dca_size": "double",
"auto_dca_size_custom": "0",
"auto_dca_percentage": "5",
"auto_dca_percentage_2": "7.5",
"auto_dca_percentage_3": "10",
"auto_dca_percentage_4": "0",
"auto_dca_percentage_5": "0",
"auto_dca_percentage_6": "0",
"use_dca_percentage_level": "1",
"dca_order_type": "limit",
"auto_dca_strategy": "0",
"dca_position_lock": false,
"dca_coin_lock": false,
"dca_mode": "merged",
"dca_current_average_rate": "64250.12",
"dca_current_profit_loss": "-1.25",
"dca_latest_average_rate": "64250.12",
"dca_current_target_rate": "61037.61"
}
}