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
| Parameter | Description |
|---|---|
uuid String | UUID of the coin you want to request the Supertrend for. |
| 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: 24hAllowed 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.
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 Example:
https://api.coinranking.com/v2/indicators/Qwsogvtv82FCd/supertrend?referenceCurrencyUuid=5k-_VTxqtCEI
|
jsonHTTP/1.1 200 OK
{
"status": "success",
"data": [
{
"startingAt": 1774936800,
"supertrend": "102847.3910284756",
"direction": "up"
},
{
"startingAt": 1774933200,
"supertrend": "102847.3910284756",
"direction": "up"
}
]
}
| Property | Description |
|---|---|
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 |
data.direction String | Which side of the price the line is on, and so which way the trend is currently reading. Always present alongside updown |
jsonHTTP/1.1 404 Not Found
{
"status": "fail",
"type": "COIN_NOT_FOUND",
"message": "Coin not found"
}