Guavy API

Guavy API Documentation

Backtest summary

get
/api/v3/backtest/summary/{symbol}/{strategy}

This endpoint provides aggregated backtesting statistics and high-level performance overview for any cryptocurrency strategy. Delivers executive summary metrics without individual trade details.

Returns aggregated statistics including total trades, win rate accuracy, average trade duration, peak profits/losses, annualized returns, and buy-and-hold comparison. Includes $1,000 investment simulation showing final portfolio value and compound growth.

Perfect for executive dashboards, quick performance comparisons, and high-level investment presentations. Use when you need summary insights rather than granular trade analysis.

Note that these backtests are from a simulated environment and do not represent actual trades.

Path Parameters
symbol
string
required
The symbol of the cryptocurrency to get backtest summary for.
strategy
string
required
The strategy to use for the backtest summary. Can be 'aggressive' or 'conservative'.
Query Parameters
years
integer
optional
specifies the maximum number of years to analyze history (default is 2)

Example request with authentication

The example below demonstrates how to make an authenticated API request using cURL. All Guavy API endpoints require authentication via a Bearer token, which should be included in the Authorization header. This token identifies your account and determines your access level to various endpoints.

To use this example:

  1. Replace YOUR-GUAVY-ACCESS-TOKEN with your personal API key from the Guavy dashboard
  2. The URL includes the specific endpoint path shown in the documentation
  3. All requests use HTTPS for secure data transmission
curl --request GET \

--url 'https://api.guavy.com/api/v3/backtest/summary/{symbol}/{strategy}' \

--header 'Authorization: Bearer YOUR-GUAVY-ACCESS-TOKEN' \
--header 'Content-Type: application/json'

This request format works across all modern HTTP clients, including Python requests, JavaScript fetch, and other programming language libraries.

API Playground

Test this API route directly in your browser using our interactive Swagger documentation. Simply authenticate with your API key, input parameters, and execute requests to see real-time responses and understand how each endpoint behaves.

HTTP server response

The Guavy API uses standard HTTP response codes and JSON formatting for all responses. This consistent structure allows for predictable parsing and error handling in your applications.

Response Structure

All responses from the API are delivered as JSON objects with the following characteristics:

  • HTTP status codes indicate the result category (2xx for success, 4xx for client errors, 5xx for server errors)
  • Content is always delivered with the application/json MIME type
  • Successful responses wrap data in a Success object
  • Error responses include descriptive messages to help troubleshoot issues

A successful response will look like this:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 30

{
    "Success": {
        // Response payload containing requested data
    }
}

For large responses, consider implementing pagination using the limit and skip parameters where available to improve performance.

API response format

The Guavy API generally follows REST conventions, with some deviations.

  • All responses are wrapped in a top-level object.
  • Responses return either `Success` or `Error`.
  • Errors include a message field with details about the error.
  • All responses use the generic JSON content type.

An example of a successful response from this API endpoint is shown below:

{
    "Success": 
      {
        "start_date" : string
        "end_date" : string
        "analysis_duration" : integer
        "total_trades" : integer
        "profitable_trades" : integer
        "unprofitable_trades" : integer
        "accuracy" : number
        "average_profit" : number
        "average_duration" : number
        "peak_loss" : number
        "peak_profit" : number
        "total_profit" : number
        "percentage_profit" : number
        "initial_investment" : number
        "final_value" : number
        "average_profit_percent" : number
        "average_loss_percent" : number
        "annualized_return" : number
        "buy_and_hold_profit_percent" : number
      }
    
}

Response data types

The table below details all data fields returned by this endpoint, including their types and descriptions. Understanding these fields is essential for properly integrating this API into your application and extracting meaningful data from responses.

start_date
string
The start date of the backtest
end_date
string
The end date of the backtest
analysis_duration
integer
The total duration of the backtest in days
total_trades
integer
The total number of trades
profitable_trades
integer
The number of profitable trades
unprofitable_trades
integer
The number of unprofitable trades
accuracy
number
The overall accuracy of the trades
average_profit
number
The average profit per trade
average_duration
number
The average duration of the trades
peak_loss
number
The peak loss of the trades
peak_profit
number
The peak profit of the trades
total_profit
number
The total profit of the trades Total profit with compound reinvestment (starting with $1,000)
percentage_profit
number
Percentage return with compound reinvestment
initial_investment
number
The initial investment
final_value
number
The final value after all trades with reinvestment
average_profit_percent
number
The average profit percentage per trade
average_loss_percent
number
The average loss percentage per trade
annualized_return
number
The expected annualized return based on total profit and analysis duration
buy_and_hold_profit_percent
number
The profit percentage if you just bought and held the asset

API Limits

The Guavy API has a limit of 10 simultaneous connections. You'll receive a 429 error if you reach the limit. At exceptionally high volumes, you may receive an HTTP 429 or 403 without a JSON body.

We recommend that you cache frequently accessed values that do not change often in your application's data store. This will prevent your application from bumping up against the throttling limitations and will likely provide faster access to that data.

Account Limits

Your Guavy account will typically have a licensed limit of at least 100,000 API calls per month. In addition, there is a limit of 100,000 API calls per day. If you reach these limits, you will receive a 429 error.

Connection Timeouts

The Guavy API has a 120-second timeout on API calls. You may see this type of timeout after you've made a network socket connection and are already sending and receiving data.

Response times are dependent on the complexity of your request and the general load across Guavy. Some endpoints in the Guavy API return values that are large and slow to calculate.

Was this helpful?