Get coin moving averages

Get the simple moving averages (SMA) for a coin throughout time. The supported moving averages are 20-day, 50-day, 100-day and 200-day. These are calculated based on daily closing prices in USD and are available at various time intervals.

https://api.coinranking.com/v2/indicators/:uuid/moving-averages

Path parameters

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

Query parameters

Parameter Description
timePeriod (optional) String

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

The maximum timePeriod you can use is all for the Startup and Professional plan, and 1y for the Free plan.

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/moving-averages?timePeriod=7d
interval (optional) String

The interval determines the granularity of each data point. 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/moving-averages?timePeriod=7d&interval=day
referenceCurrencyUuid (optional) String

UUID of coin (either fiat or crypto), in which all the moving average values are 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

Default value: yhjMzLPhuIDl

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

Code examples

Response

json
HTTP/1.1 200 OK { "status": "success", "data": [ { "startingAt": 1774936800, "ma20d": "61051.50263116225", "ma50d": "59938.44387892327", "ma100d": "67917.84166179039", "ma200d": "79262.68876699556" }, { "startingAt": 1774933200, "ma20d": "61050.102576064244", "ma50d": "59937.069348890385", "ma100d": "67916.28414532698", "ma200d": "79260.87108640283" } ] }

Response fields

PropertyDescription
status String

Status of the request

Allowed values:
success
data Object[]

List of moving average data points

data.startingAt Number

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

data.ma20d String/null

The 20-day simple moving average price in the reference currency. Calculated as the average closing price over the last 20 days.

data.ma50d String/null

The 50-day simple moving average price in the reference currency. Calculated as the average closing price over the last 50 days.

data.ma100d String/null

The 100-day simple moving average price in the reference currency. Calculated as the average closing price over the last 100 days.

data.ma200d String/null

The 200-day simple moving average price in the reference currency. Calculated as the average closing price over the last 200 days.

Error response

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

Error responses