Template List
This endpoint allows you to retrieve a list of rental bot templates that are available to users in the Bots Marketplace.
Get List of Bots
GET https://api.aitrade.com/api/templates
Query Params
page_size
integer
maximum number of items returned per request
page
integer
Current page number for pagination
sort
string
Sort the list by apy or wl_ratio.
order
string
Order of sorting, either desc for descending or asc for ascending
strategy
string
Filter the list by strategy, options are Long or Short
Response
This endpoint supports pagination and allows filtering and sorting to help integrate and display bots data efficiently in your applications.
The response includes status code indicating the outcome. A successful request (code: 200) returns bot templates' details including the id, status, title, description, performance metrics, and more. An unsuccessful attempt due to authentication issues returns code: 401 with a message indicating the user is unauthenticated.
//sample javascript code
const axios = require('axios');
const fetchBotTemplates = async () => {
try {
const response = await axios.get('https://api.stockhero.ai/api/templates', {
params: {
page: 1, // Specify the page number
per_page: 8, // Specify number of items per page
sort: 'apy', // Field to sort by
direction: 'desc' // Sorting direction: asc or desc
},
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN' // Replace YOUR_ACCESS_TOKEN with your actual token
}
});
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
};
fetchBotTemplates();{
"code": 200,
"message": "Success",
"templates": {
"current_page": 1,
"data": [
{
"id": 3,
"owner_id": 19,
"bot_id": 18,
"status": "approved",
"title": "Market Neutral, BEST BOT AWARD",
"description": "This bot trades in up, down and range bound market to deliver consistent returns. Please ensure that you have at least 7x the price of the stock that you want to trade, allocated for this bot. For e.g., if a stock price is $1, you need $7 for fund.",
"apy": 22.62,
"performance": 85.81,
"wl_ratio": 100,
"total_deal": 17,
"avg_monthly_deal": 3.29,
"total_profit": 0,
"total_sub": 413,
"current_renter": 270,
"created_at": "2022-10-01 06:11:44",
"updated_at": "2024-03-26 14:49:09",
"image": "https://yourdomain/path_to_image_file.jpg",
"view_count": 8518,
"strategy": "Long",
"total_thumbs_up": 67,
"real_performances": {
"id": 31283,
"template_id": 3,
"total_deal": 871,
"avg_wl": 88.05,
"total_deal_3_months": 455,
"avg_wl_3_months": 85.49,
"win_rate": 92,
"track_record": 90,
"bot_activity": 50,
"created_at": "2023-04-18 08:29:49",
"updated_at": "2024-03-24 00:01:15"
}
}
],
"first_page_url": "https://api.stockhero.ai/api/templates?page=1",
"from": 1,
"last_page": 2,
"last_page_url": "https://api.stockhero.ai/api/templates?page=2",
"next_page_url": "https://api.stockhero.ai/api/templates?page=2",
"path": "https://api.stockhero.ai/api/templates",
"per_page": 8,
"prev_page_url": null,
"to": 8,
"total": 11
}
}{
"code": 401,
"success": false,
"message": "Unauthenticated."
}Last updated