Get coin Supertrend

Professional This endpoint requires the professional plan or higher

Get the Supertrend for a coin throughout time — a trend-following line that sits below the price while the trend is up and above it while the trend is down, together with the direction it is currently reading. It is drawn from the Average True Range: the line trails the price by 3 ATRs, so it gives a volatile coin more room before it calls a reversal than a quiet one.

The settings are the conventional (10, 3) — a 10-candle ATR, placed 3 ATRs from the midpoint of each candle — and a candle is one bucket of the interval you request, so interval=day gives a 10-day Supertrend and interval=hour a 10-hour one.

Read the trend from direction, not by comparing supertrend against the price. The two agree on almost every candle, and disagree on exactly the one that matters: on the candle a reversal lands, the line has already moved to the other side while the closing price has not yet crossed it. direction is the value the calculation itself carried forward, so it is the one that is right on a flip.

The line is path-dependent: while a trend holds it only ever tightens toward the price, and it releases when the price closes through it. A value therefore depends on everything that has happened since the last reversal rather than on a fixed window, which is why we read a long run of earlier candles before the first one we return.

https://api.coinranking.com/v2/indicators/:uuid/supertrend

Path parameters

ParameterDescription
uuid StringUUID of the coin you want to request the Supertrend for.

Query parameters

Parameter Description
timePeriod (optional) String

The time period for which the Supertrend data is returned. The number of data points and the default interval are determined by the time period.

Default value: 24h
Allowed values:
1h 3h 12h 24h 7d 30d 3m 1y 3y 5y 10y all

Example:
https://api.coinranking.com/v2/indicators/Qwsogvtv82FCd/supertrend?timePeriod=7d
interval (optional) String

The interval determines the granularity of each data point, and therefore what one Supertrend period means. If not provided, a default interval is used based on the selected timePeriod. Only certain intervals are available per timePeriod — see the table below.


timePeriod Available intervals (default in bold)
1hminute, 5minutes
3hminute, 5minutes, hour
12hminute, 5minutes, hour
24hminute, 5minutes, hour, 8hours
7dhour, 8hours, day
30dhour, 8hours, day, week
3mhour, 8hours, day, week, month
1yday, week, month
3yday, week, month
5yday, week, month
10yday, week, month
allday, week, month

Example:
https://api.coinranking.com/v2/indicators/Qwsogvtv82FCd/supertrend?timePeriod=7d&interval=day
referenceCurrencyUuid (optional) String

UUID of coin (either fiat or crypto), in whose terms the price is measured before the Supertrend is calculated. Defaults to US Dollar, but you can use any coin. You can find UUIDs for reference currencies in any coin endpoint, including a convenient dedicated reference currency endpoint

The returned supertrend is a price in this currency, and the conversion happens before the calculation — so this choice can change direction too, not just the units. A coin trending up against the US Dollar may be trending down against Bitcoin, and this endpoint will say so.

Default value: yhjMzLPhuIDl

Example:
https://api.coinranking.com/v2/indicators/Qwsogvtv82FCd/supertrend?referenceCurrencyUuid=5k-_VTxqtCEI

Code examples

Response

json
HTTP/1.1 200 OK { "status": "success", "data": [ { "startingAt": 1774936800, "supertrend": "102847.3910284756", "direction": "up" }, { "startingAt": 1774933200, "supertrend": "102847.3910284756", "direction": "up" } ] }

Response fields

PropertyDescription
status String

Status of the request

Allowed values:
success
data Object[]

List of Supertrend data points, newest first

data.startingAt Number

An Epoch startingAt in seconds marking the start of the time period.

data.supertrend String

The Supertrend (10, 3) line, as a price in the reference currency. It sits below the price while direction is up and above it while direction is down. Repeated values are normal — the line holds its level until the price moves it.

data.direction String

Which side of the price the line is on, and so which way the trend is currently reading. Always present alongside supertrend.

Allowed values:
updown

Error response

json
HTTP/1.1 404 Not Found { "status": "fail", "type": "COIN_NOT_FOUND", "message": "Coin not found" }

Error responses