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

Name
Type
Required
Description

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();

Last updated