Skip to content
Guavy Logo GUAVY
GET
·
/api/v2/forex/trades/get-trend-segments

Get Trend Segments

Retrieve completed trend episodes for an instrument, newest first, each covering the period it ran. This is not a daily time series — instruments carry a few dozen segments rather than thousands of points, which is why it is named apart from get-trend-history. Not available for crypto.

Attributes

symbol
string
Required
The symbol of the instrument to fetch trend segments for.
limit
integer
The maximum number of segments to return, newest first. Defaults to 50, clamped to 1..500.

API Request

Example Request with cURL

curl \
--request GET \
--url     'https://guavy.com/api/v2/forex/trades/get-trend-segments/<symbol>?limit=<integer>' \
--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.

Example Response for /api/v2/forex/trades/get-trend-segments/EUR?limit=5

{
  "trend_segments": [
    {
      "close": 1.1528,
      "date": "2026-07-31T00:00:00.000Z",
      "last_updated": null,
      "long_term_average": 1.141631111111111,
      "max_price": 1.1528,
      "max_price_day": {
        "close": 1.1528,
        "date": "2026-07-31T00:00:00.000Z",
        "timestamp": 1785456000000,
        "trend": "neutral"
      },
      "mid_term_average": 1.1427749999999999,
      "min_price": 1.1528,
      "min_price_day": {
        "close": 1.1528,
        "date": "2026-07-31T00:00:00.000Z",
        "timestamp": 1785456000000,
        "trend": "neutral"
      },
      "peak_gain": 0.0,
      "peak_loss": 0.0,
      "short_term_average": 1.1424855555555555,
      "signal_strength": -1.2250243902438846e-4,
      "timestamp": 1785456000000,
      "trend": "neutral",
      "trend_duration_days": 0
    },
    {
      "close": 1.16417,
      "date": "2026-05-24T00:00:00.000Z",
      "last_updated": null,
      "long_term_average": 1.1708025000000002,
      "max_price": 1.16571,
      "max_price_day": {
        "close": 1.16571,
        "date": "2026-05-29T00:00:00.000Z",
        "timestamp": 1780012800000,
        "trend": "down"
      },
      "mid_term_average": 1.167495,
      "min_price": 1.13534,
      "min_price_day": {
        "close": 1.13534,
        "date": "2026-06-24T00:00:00.000Z",
        "timestamp": 1782259200000,
        "trend": "down"
      },
      "peak_gain": 0.13228308580362808,
      "peak_loss": -2.4764424439729518,
      "short_term_average": 1.16273,
      "signal_strength": -4.861731707317077e-4,
      "timestamp": 1779580800000,
      "trend": "down",
      "trend_duration_days": 67
    }
  ]
}

Response Object

trend_segments
array[object]
Completed trend episodes, newest first, each with the following keys:
trend
string
Trend direction as stored, lowercase (for example "up" or "down").
signal_strength
number
Raw signal strength as stored. The scale is not comparable across markets, so threshold it per market rather than assuming fixed bands.
trend_duration_days
integer
How many days the trend has run.
timestamp
integer
The entry's own timestamp, a unix epoch in milliseconds. On a segment this dates the episode and is what orders the list.
date
string
The same instant as an ISO-8601 string.
close
number
Closing price at that point.
last_updated
integer
When the trend was last computed. Present on the current trend; null on a closed segment.
short_term_average
number
Short-term moving average.
mid_term_average
number
Mid-term moving average.
long_term_average
number
Long-term moving average.
peak_gain
number
Largest gain within the trend.
peak_loss
number
Largest loss within the trend.
max_price
number
Highest price within the trend.
min_price
number
Lowest price within the trend.
max_price_day
object
The highest-closing day: close, timestamp (ms), date, and trend.
min_price_day
object
The lowest-closing day: close, timestamp (ms), date, and trend.

Token Costs

Each API call consumes tokens from your monthly budget. Endpoints that return richer or deeper data cost more tokens. Historical endpoints scale with the amount of data requested.

You never have to guess how much is left: every metered response carries your balance in x-tokens-* headers — x-tokens-cost (what this call cost), x-tokens-limit / x-tokens-remaining (monthly), and x-tokens-limit-today / x-tokens-remaining-today (daily). The remaining values are net of any credit applied to the same request.

Endpoint Token Cost
GET /api/v2/forex/instruments/list-symbols 1
GET /api/v2/forex/newsroom/get-recent-briefs/:symbol 3 – 8 (scales with limit)
GET /api/v2/forex/newsroom/search-briefs/:symbol 3 – 8 (scales with limit)
GET /api/v2/forex/newsroom/get-article/:id 3
GET /api/v2/forex/sentiment/get-sentiment-history/:symbol 3 – 12 (scales with limit)
GET /api/v2/forex/technical-analysis/get-price-history/:symbol 5
GET /api/v2/forex/technical-analysis/get-indicators/:symbol 8
GET /api/v2/forex/instruments/scorecard/:symbol 10
GET /api/v2/forex/trades/get-current-trend/:symbol 3
GET /api/v2/forex/trades/get-trend-segments/:symbol 5

Account Limits

Each plan includes a monthly token budget: 3,000 for Sandbox, 250,000 for Quant, and 1,000,000 for Pro. Your monthly plan budget resets to the full amount on the 1st of each month — unused base tokens don't carry over. You can top up at any time with a one-time token pack; pack tokens never expire and any unused pack balance rolls forward. If you exceed your budget, the API returns a 401 until the next reset or until you purchase more tokens.

Connection Limits

The Guavy API has a limit of 10 simultaneous connections and a 120-second timeout per request. We recommend caching responses that don't change frequently to reduce token consumption and improve performance.

Was this helpful?
Feedback option #{picture.id}
Feedback option #{picture.id}
Feedback option #{picture.id}
Feedback option #{picture.id}

© 2026 Guavy Inc. All rights reserved.