Guavy API

Guavy API Documentation

Sector price trends

get
/api/v3/index/price/trends/{sector}/{days}

This endpoint retrieves historical trend analysis for a specific Guavy index sector or the entire index by using 'all' as the sector parameter. Trends are generated by applying Guavy's technical analysis algorithms to historical price data, identifying market patterns and directional movements over time.

Each trend represents a distinct period of market behavior (up, down, or neutral) with calculated strength indicators. Returns all trends with start dates within the specified time period.

Use this data to analyze historical market cycles, identify recurring patterns, and understand how index sectors have performed during different market conditions. Ideal for backtesting trading strategies or comparing trend strength across time periods.

For more information about how the index works, see the Guavy Index documentation.

Path Parameters
sector
string
required
The name of the Guavy Index sector to fetch the price trends for. Can be found in the /index/sector/list route.
days
integer
required
The number of days to fetch the price trends for. e.g. 30 will return trends for the last 30 days.

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/index/price/trends/{sector}/{days}' \

--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.
  • Array responses are wrapped in an additional array layer.

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

{
    "Success": [
      {
        "trend" : object
        "strength" : object
        "close" : number
        "price" : number
        "volume" : number
        "timestamp" : integer
        "date" : string
      }
    ]
}

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.

trend
object
The trend of the cryptocurrency action e.g. up, down, or neutral
strength
object
The strength of the trend e.g. moderate, solid, strong, or weak
close
number
The price of the cryptocurrency at the end of the trend
price
number
The price of the cryptocurrency at the start of the trend
volume
number
The volume of the cryptocurrency at the start of the trend
timestamp
integer
Unix timestamp representing when this data was collected
date
string
Human-readable date string formatted from the timestamp

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?