POST
https://api.cryptohopper.com/v1/market/downloaditem
Adds a free template or strategy from the marketplace to your account, so you can load it into your hoppers, and records it as a purchase. Downloading a template again updates your copy.
OAuth scope:
read manage About scopes
Paid items cannot be bought through the API. For a paid item, or an item that is not a template or strategy, the response is still HTTP 200 with data "Marketplace item is not free to download".
Example request
curl -X POST "https://api.cryptohopper.com/v1/market/downloaditem" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "marketplace_item_id: MARKETPLACE_ITEM_ID"
const response = await fetch('https://api.cryptohopper.com/v1/market/downloaditem', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"marketplace_item_id": "MARKETPLACE_ITEM_ID"
}
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/market/downloaditem",
headers={
"access-token": "YOUR_ACCESS_TOKEN",
"marketplace_item_id": "MARKETPLACE_ITEM_ID"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/market/downloaditem');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'marketplace_item_id: MARKETPLACE_ITEM_ID',
],
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
marketplace_item_id |
string | Required | Marketplace item ID of the free template or strategy. |
Response
{
"data": "The marketplace item has been bought and added to your account. You can now select and configure this item in the configuration of your hopper(s)."
}