> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serialized.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Sparklines

> Small price arrays for token list rows - one call for up to 100 tokens on a chain. We resolve each token's best pool (curve history stitched in) and return one evenly spaced line per token; a token younger than the timeframe gets a finer interval so its whole life fills the line. Timeframes 1m|5m|30m|1h|24h|7d, native or USD, optional timestamps. Unknown tokens return [] - we never invent data.

`POST /v1/token/sparklines` · **1 per token credit**

Small price arrays for token list rows - one call for up to 100 tokens. We resolve each token's best pool for you and stitch bonding-curve history onto it, so a freshly graduated token draws one continuous line. The response is keyed by token address. To spark specific pools instead, use [`POST /v1/pools/sparklines`](/endpoints/sparklines-batch).

| Timeframe | Points | Interval (at most) |
| - | - | - |
| `1m` | 30 | 2 s |
| `5m` | 30 | 10 s |
| `30m` | 30 | 1 min |
| `1h` | 30 | 2 min |
| `24h` | 24 | 1 h |
| `7d` | 28 | 6 h |

Every line is a grid of evenly spaced points, oldest to newest, the last one being the live price. A token older than the timeframe gets the interval above and the line covers the whole timeframe. A younger token keeps the same number of points on a finer interval, the finest that still spans its whole life (a 3-hour-old token on `24h` draws 24 points of 10 minutes; a 1-minute-old token on `1h` draws 30 points of 2 seconds), so a fresh launch draws a real line instead of a single point. An interval without a trade carries the previous price, and before the first trade a line holds its first price: you always get the full grid, or `[]`.

Two options shape the points:

* `timestamps: true` returns each point as `{ at, value }`, `at` being the start of its interval in unix milliseconds: the way to know the interval a line was drawn on. Dated points start at the first trade, so a line can hold fewer points than the grid.
* `quote: "usd"` returns USD prices on Solana, each point converted at the SOL/USD rate of its own time. Native prices are the default on every chain.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.serialized.xyz/v1/token/sparklines' \
    -H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \
    -d '{"chain": "evm:8453", "tokens": ["0x4ed4e862860bed51a9570b96d89af5e1b0efefed"], "timeframe": "24h"}'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "0x4ed4e862860bed51a9570b96d89af5e1b0efefed": [
        5.249040755790959e-7,
        5.299419269878368e-7,
        5.341024278723588e-7,
        5.353384270094856e-7,
        5.367245992625111e-7,
        5.382859734840854e-7,
        "…"
      ]
    },
    "meta": {
      "asOf": 1786725098728,
      "timeframe": "24h",
      "quote": "native"
    }
  }
  ```

  ```json Response (timestamps, usd) theme={null}
  {
    "data": {
      "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN": [
        { "at": 1790701200000, "value": 2.0211635444550846 },
        { "at": 1790704800000, "value": 2.0451174906709944 },
        { "at": 1790708400000, "value": 2.0222823998521657 },
        { "at": 1790712000000, "value": 2.042120738574924 },
        "…"
      ]
    },
    "meta": {
      "asOf": 1790787309837,
      "timeframe": "24h",
      "quote": "usd"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json POST /v1/token/sparklines
openapi: 3.1.0
info:
  title: Serialized Data API
  description: >-
    On-chain data for trading apps - tokens, candles, token filters. Built on
    our own indexers. 18 EVM chains + Solana, live.
  version: 0.1.0
servers:
  - url: https://demo.serialized.xyz
    description: 'Demo: no key needed, read endpoints, rate-limited per IP'
  - url: https://api.serialized.xyz
    description: 'Production: your API key in the Authorization header'
security:
  - apiKey: []
  - {}
paths:
  /v1/token/sparklines:
    post:
      summary: Token Sparklines
      description: >-
        Small price arrays for token list rows: one call for up to 100 tokens on
        one chain. We resolve each token's best pool for you and stitch
        bonding-curve history onto it, so a freshly graduated token draws one
        continuous line. The response is keyed by token address. Every timeframe
        is a grid of evenly spaced points, oldest to newest, the last point
        being the live price: `1m` = 30 points of 2 s, `5m` = 30 of 10 s, `30m`
        = 30 of 1 min, `1h` = 30 of 2 min, `24h` = 24 of 1 h, `7d` = 28 of 6 h
        for a token older than the timeframe. A younger token keeps the same
        number of points on a finer interval, the finest that still spans its
        whole life (a 3-hour-old token on `24h` draws 24 points of 10 minutes),
        so a fresh launch draws a real line; `timestamps: true` tells the
        interval. An interval without a trade carries the previous price, and
        before the first trade of the window a line holds its first price: a
        series is always the full grid, or `[]`. Prices are native by default;
        `quote: "usd"` converts each point at the SOL/USD rate of its own time
        (Solana). `timestamps: true` returns `{ at, value }` points instead of
        bare numbers, from the first trade of the window on: a token younger
        than the timeframe returns fewer points. An unknown token returns `[]` -
        we never invent data. To spark specific pools, across chains, use `POST
        /v1/pools/sparklines`.
      operationId: token-sparklines
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - chain
              properties:
                chain:
                  type: string
                  description: >-
                    Public chain id - `evm:<id>` or `solana`. One chain per
                    call.
                  example: evm:8453
                  x-default: evm:8453
                tokens:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    type: string
                  description: 1 to 100 token addresses on `chain`. Billed per token.
                  example:
                    - '0x4ed4e862860bed51a9570b96d89af5e1b0efefed'
                  x-default:
                    - '0x4ed4e862860bed51a9570b96d89af5e1b0efefed'
                pools:
                  minItems: 1
                  maxItems: 100
                  type: array
                  items:
                    type: string
                timeframe:
                  default: 24h
                  description: '`1m`|`5m`|`30m`|`1h`|`24h`|`7d`. Default `24h`.'
                  type: string
                  example: 24h
                  x-default: 24h
                quote:
                  default: native
                  description: >-
                    `native` (default) or `usd`. `usd` converts each point at
                    the SOL/USD rate of its own time; available on Solana.
                  anyOf:
                    - type: string
                      enum:
                        - native
                    - type: string
                      enum:
                        - usd
                  example: native
                  x-default: native
                timestamps:
                  default: false
                  description: >-
                    `true` returns each point as `{ at, value }`, `at` being the
                    start of the point's interval in unix milliseconds, from the
                    first trade of the window on. Default `false`: bare numbers,
                    always the full grid.
                  type: boolean
                  example: true
                  x-default: true
      responses:
        '200':
          description: Standard `{ data, meta }` envelope.
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: Authorization
      in: header
      description: Your raw API key (not needed on the demo server).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.