/v1/sparkline/{id}
Price sparkline
Request
https://api.xrpl.to/v1/sparkline/0dd550278b74cb6690fdae351e8e0df3| Path parameter | Value | Description |
|---|---|---|
| id | A token id: its md5, slug or issuer_currency |
| Query parameter | Value | Description |
|---|---|---|
| period | 24h|7d (default: 7d) | |
| vs_currency | XRP|USD (default: XRP) | |
| lightweight | bool - sample data points | |
| max_points | int (default: 20, range 2-500; only applies when lightweight=true) | |
| pro24h | float - override percentChange/chartColor when period=24h | |
| pro7d | float - override when period=7d |
curl 'https://api.xrpl.to/v1/sparkline/0dd550278b74cb6690fdae351e8e0df3'
Response
https://api.xrpl.to/v1/sparkline/0dd550278b74cb6690fdae351e8e0df3{ "success": true, "chartColor": "#54D62C", "period": "7d", "percentChange": "7.16", "lightweight": false, "vsCurrency": "XRP", "data": { "prices": [ "0.71168317083297671921", "0.7111809989261231868", "0.71138428267565856356", "0.7115663459221948095", "0.71096608213415402044" ], "timestamps": [ 1791794400000, 1791794700000, 1791795000000, 1791795300000, 1791795600000 ], "max": "0.79572750276051229523", "min": "0.7109659966017457533" } }
Long arrays and strings are shortened in the example; Send request for the full answer.
{ success, chartColor, period, percentChange, lightweight, vsCurrency, data: { prices[], timestamps[], max, min } }