Get sparkline price data for a token
curl --request GET \
--url https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"chain": "0x1",
"range": "7d",
"fromDate": "2025-01-01T00:00:00.000Z",
"toDate": "2025-01-08T00:00:00.000Z",
"page": 1,
"cursor": null,
"result": [
{
"timestamp": "2025-01-02T09:00:00.000Z",
"price": "0.00123"
}
],
"meta": {
"syncedAt": {
"0x1": 19800000
}
}
}Token API
Token Price Sparkline
Get a small set of historical price points suitable for sparkline charts (tiny charts in token lists, watchlists, portfolio rows). Returns a fixed number of points based on the selected range.
GET
/
v1
/
chains
/
{chainAlias}
/
tokens
/
{tokenAliasOrTokenAddress}
/
price
/
sparkline
Get sparkline price data for a token
curl --request GET \
--url https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"chain": "0x1",
"range": "7d",
"fromDate": "2025-01-01T00:00:00.000Z",
"toDate": "2025-01-08T00:00:00.000Z",
"page": 1,
"cursor": null,
"result": [
{
"timestamp": "2025-01-02T09:00:00.000Z",
"price": "0.00123"
}
],
"meta": {
"syncedAt": {
"0x1": 19800000
}
}
}Returns a fixed number of price points for the selected
range (24h to 1y) - a compact, chart-ready array you can drop directly into a sparkline widget without resampling. For native coins, pass native as tokenAliasOrTokenAddress.Authorizations
Path Parameters
The alias of the chain.
Available options:
0x1, ethereum, 0x15b38, chiliz, 0x171, pulse, 0x19, cro, 0x2105, base, 0x2eb, flow, 0x38, binance, 0x46f, lisk, 0x504, moon beam, 0x531, sei, 0x64, gnosis, 0x89, polygon, 0x8f, monad, 0xa, optimism, 0xa4b1, arbitrum, 0xa86a, avalanche, 0xe708, linea, bitcoin-mainnet, bitcoin, solana-mainnet, sol The token address or alias
Query Parameters
The time range for the sparkline. Determines the interval and window size.
Available options:
24h, 7d, 30d, 90d, 1y Example:
"7d"
Response
200 - application/json
The resolved blockchain chain ID
Example:
"0x1"
The sparkline range used for this result
Available options:
24h, 7d, 30d, 90d, 1y Example:
"7d"
ISO-8601 timestamp of the computed window start
Example:
"2025-01-01T00:00:00.000Z"
ISO-8601 timestamp of the computed window end
Example:
"2025-01-08T00:00:00.000Z"
Always 1. Sparkline responses are not paginated.
Example:
1
Always null. Sparkline responses are not paginated.
Example:
null
Array of price data points
Show child attributes
Show child attributes
Show child attributes
Show child attributes

