GET
https://api.cryptohopper.com/v1/hopper/{id}/position
Returns all open positions of the hopper. Each position includes its effective take profit, stop-loss, trailing stop-loss, auto close and DCA settings, resolved from the position itself, its config pool and the hopper config.
OAuth scope:
read About scopes
Not available for exchange arbitrage, market maker and grid bots. Scalar values are returned as strings; amount and rate keep their full stored precision, and config is the position's own settings as a JSON string or null. stop_loss_percentage is left out when stop-loss is off, and trailing_arm and trailing_arm_percentage are left out when trailing stop-loss is off. take_profit_levels is null when the position uses the hopper's layered take profit, otherwise a list of {profit, share} levels.
Example request
curl "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position" \
-H "access-token: YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position', {
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",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position');
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 |
|---|---|---|---|
id |
string | Required | Hopper ID. |
Response
{
"data": [
{
"id": "123456",
"pair": "BTCUSDT",
"currency": "BTC",
"amount": "0.0015000000000000",
"rate": "64250.1200000000000000",
"buy_id": "987654321",
"order_id": null,
"sell_id": null,
"buy_trigger": "strategy",
"sell_trigger": null,
"config": null,
"percentage_profit": "3",
"stop_loss": "0",
"sell_rate": null,
"trailing_percentage": "0.0000000000000000",
"buy_time": "1758790000",
"sell_time": null,
"auto_close_time": "0",
"hold": "0",
"sold": "0",
"take_profit_levels": null,
"take_profit_levels_done": [],
"tsl_enabled": "0",
"dca_enabled": "0",
"dca_latest_average": "0",
"dca_count": "0",
"auto_dca_time": "-1 hours",
"auto_dca_max": "3",
"auto_dca_percentage": "5",
"dca_order_type": "limit",
"auto_dca_strategy": "0",
"cost": "96.37518",
"trailing_stop_loss_enabled": "0",
"trailing_stop_loss_only": "0",
"stop_loss_enabled": "0",
"auto_close_enabled": "0"
}
]
}