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

# 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.

export const EndpointMeta = ({premium, cus, cusUnit, mainnetOnly}) => {
  const items = [];
  const planName = typeof premium === "string" ? premium : "Pro";
  if (premium) {
    items.push({
      icon: "\u26a0\ufe0f",
      label: "Premium endpoint",
      text: <>
          Requires the <strong>{planName} plan</strong> or above.{" "}
          <a href="/data-api/introduction/resources/premium-endpoints">
            View all
          </a>
          .
        </>
    });
  }
  if (cus) {
    const isDynamic = !!cusUnit;
    items.push({
      icon: "\u26a1",
      label: isDynamic ? "Dynamic cost" : "Endpoint cost",
      text: isDynamic ? <>
          {cus} CUs per {cusUnit}.{" "}
          <a href="/get-started/pricing#dynamic-endpoints">Learn more</a>.
        </> : <>
          {cus} CUs.{" "}
          <a href="/get-started/pricing">Learn more</a>.
        </>
    });
  }
  if (mainnetOnly) {
    items.push({
      icon: "\ud83d\udd17",
      label: "Mainnet only",
      text: <>Testnet chains are not supported.</>
    });
  }
  if (items.length === 0) return null;
  return <div className="endpoint-meta" style={{
    border: "1px solid var(--border-color, #e2e8f0)",
    borderRadius: "8px",
    overflow: "hidden",
    marginBottom: "16px",
    fontSize: "14px",
    lineHeight: "1.6",
    maxWidth: "100%"
  }}>
      <style dangerouslySetInnerHTML={{
    __html: `
            .endpoint-meta {
              --border-color: #e2e8f0;
              --row-bg: #f8fafc;
              --label-color: #0f172a;
              --text-color: #1f2937;
            }
            .endpoint-meta a {
              color: #0f7fff !important;
              text-decoration: underline;
            }
            @media (prefers-color-scheme: dark) {
              .endpoint-meta {
                --border-color: #374151 !important;
                --row-bg: #1e293b !important;
                --label-color: #f9fafb !important;
                --text-color: #e5e7eb !important;
              }
              .endpoint-meta a {
                color: #60a5fa !important;
              }
            }
            html.dark .endpoint-meta,
            [data-theme="dark"] .endpoint-meta {
              --border-color: #374151 !important;
              --row-bg: #1e293b !important;
              --label-color: #f9fafb !important;
              --text-color: #e5e7eb !important;
            }
            html.dark .endpoint-meta a,
            [data-theme="dark"] .endpoint-meta a {
              color: #60a5fa !important;
            }
          `
  }} />
      {items.map((item, i) => <div key={i} style={{
    display: "flex",
    alignItems: "baseline",
    gap: "8px",
    padding: "10px 14px",
    borderBottom: i < items.length - 1 ? "1px solid var(--border-color, #e2e8f0)" : "none",
    backgroundColor: "var(--row-bg, #f8fafc)"
  }}>
          <span style={{
    flexShrink: 0
  }}>{item.icon}</span>
          <span style={{
    wordBreak: "break-word",
    color: "var(--text-color, #1f2937)"
  }}>
            <strong style={{
    color: "var(--label-color, #0f172a)"
  }}>
              {item.label}:
            </strong>{" "}
            {item.text}
          </span>
        </div>)}
    </div>;
};

<EndpointMeta cus={50} />

<Note>
  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`.
</Note>


## OpenAPI

````yaml openapi-files/data-api/api-v1.json GET /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline
openapi: 3.0.0
info:
  title: Moralis Universal API 🚧
  description: This API is in early access and is subject to change.
  version: '1.0'
servers:
  - url: https://api.moralis.com
security: []
externalDocs:
  description: Moralis API Docs
  url: https://docs.moralis.com
paths:
  /v1/chains/{chainAlias}/tokens/{tokenAliasOrTokenAddress}/price/sparkline:
    get:
      tags:
        - Tokens
      summary: Get sparkline price data for a token
      description: >-
        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.
      operationId: getTokenPriceSparkline
      parameters:
        - name: chainAlias
          required: true
          in: path
          description: The alias of the chain.
          schema:
            type: string
            enum:
              - '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
        - name: tokenAliasOrTokenAddress
          required: true
          in: path
          description: The token address or alias
          examples:
            native:
              summary: The native token of the chain
              value: native
            '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48':
              summary: USDC
              value: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
          schema:
            type: string
        - name: range
          required: true
          in: query
          description: >-
            The time range for the sparkline. Determines the interval and window
            size.
          schema:
            example: 7d
            enum:
              - 24h
              - 7d
              - 30d
              - 90d
              - 1y
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTokenPriceSparklineResponseDto'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GetTokenPriceSparklineResponseDto:
      type: object
      properties:
        chain:
          type: string
          description: The resolved blockchain chain ID
          example: '0x1'
        range:
          type: string
          description: The sparkline range used for this result
          enum:
            - 24h
            - 7d
            - 30d
            - 90d
            - 1y
          example: 7d
        fromDate:
          type: string
          description: ISO-8601 timestamp of the computed window start
          example: '2025-01-01T00:00:00.000Z'
        toDate:
          type: string
          description: ISO-8601 timestamp of the computed window end
          example: '2025-01-08T00:00:00.000Z'
        page:
          type: number
          description: Always 1. Sparkline responses are not paginated.
          example: 1
        cursor:
          type: object
          description: Always null. Sparkline responses are not paginated.
          nullable: true
          example: null
        result:
          description: Array of price data points
          type: array
          items:
            $ref: '#/components/schemas/PriceTimeSeriesItemDto'
        meta:
          $ref: '#/components/schemas/SingleChainResponseMetaDto'
      required:
        - chain
        - range
        - fromDate
        - toDate
        - page
        - cursor
        - result
        - meta
    PriceTimeSeriesItemDto:
      type: object
      properties:
        timestamp:
          type: string
          description: The timestamp of the price point in ISO-8601 format
          example: '2025-01-02T09:00:00.000Z'
        price:
          type: string
          description: The price in USD at this timestamp
          example: '0.00123'
      required:
        - timestamp
        - price
    SingleChainResponseMetaDto:
      type: object
      properties:
        syncedAt:
          type: object
          description: Last ingested block number per chain ID
          additionalProperties:
            type: number
          example:
            '0x1': 19800000
      required:
        - syncedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````