GET /sparkline/{id}
GET

/v1/sparkline/{id}

Price sparkline

AuthNone — works without a key

Request

GEThttps://api.xrpl.to/v1/sparkline/0dd550278b74cb6690fdae351e8e0df3
Path parameterValueDescription
idA token id: its md5, slug or issuer_currency
Query parameterValueDescription
period24h|7d (default: 7d)
vs_currencyXRP|USD (default: XRP)
lightweightbool - sample data points
max_pointsint (default: 20, range 2-500; only applies when lightweight=true)
pro24hfloat - override percentChange/chartColor when period=24h
pro7dfloat - override when period=7d
curl 'https://api.xrpl.to/v1/sparkline/0dd550278b74cb6690fdae351e8e0df3'

Response

200Example response1 ms · just now · 0.5 KB · 26 lines
https://api.xrpl.to/v1/sparkline/0dd550278b74cb6690fdae351e8e0df3
{
  "success": true,
  "chartColor": "#54D62C",
  "period": "7d",
  "percentChange": "8.07",
  "lightweight": false,
  "vsCurrency": "XRP",
  "data": {
    "prices": [
      "0.65690100110032145775",
      "0.65602162247267670203",
      "0.65520815403579424352",
      "0.6545445033093698628",
      "0.65349648275277560927"
    ],
    "timestamps": [
      1791162300000,
      1791162600000,
      1791162900000,
      1791163200000,
      1791163500000
    ],
    "max": "0.75676297595279240493",
    "min": "0.65349648275277560927"
  }
}

Long arrays and strings are shortened in the example; Send request for the full answer.

Shapeas documented
{
  success,
  chartColor,
  period,
  percentChange,
  lightweight,
  vsCurrency,
  data: { prices[], timestamps[], max, min }
}

What it does

Price sparkline

A token id can be its md5, slug or issuer_currency. How to build an md5 →
OpenAPI