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

# Get Sparkline

> Retrieves the 24-hour sparkline chart for a given asset. The sparkline is returned as an SVG image by default. You can request a PNG version by adding the query parameter png=true.

### Query details

Input in “asset” the name of the asset you want to query, or the contract address while adding the blockchain as a second parameter. The market data asset query pattern is explained [in great details here](/rest-api-reference/docs/market-asset-query), with blockchain format, etc.

The default response is a SVG image, if you want a png you can just add a param `png=true` to the query.

| Name         | Type   | Required | Description                                                                         |
| ------------ | ------ | -------- | ----------------------------------------------------------------------------------- |
| `asset`      | string | No       | The asset identifier to query. This can be the token’s name or the contract address |
| `blockchain` | string | No       | Blockchain name (e.g., `"ethereum"`). Required if using a contract address.         |
| `symbol`     | string | No       | Asset symbol (e.g., `"BTC"`).                                                       |
| `id`         | string | No       | Mobula internal asset ID.                                                           |
| `timeFrame`  | string | No       | Timeframe for the sparkline (e.g., `"24h"`, `"7d"`). Default: `"24h"`.              |
| `png`        | string | No       | If `"true"`, returns the image in PNG format instead of SVG.                        |

### Usage Examples

* Query by `Asset Address` & `Blockchain` with `PNG` output and `7-day` timeframe:

```bash theme={null}
curl -X GET "https://demo-api.mobula.io/api/1/market/sparkline?asset=0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf&blockchain=8453&png=true&timeFrame=7d"
```

* Query by `Asset Name` & `Blockchain`:

```bash theme={null}
curl -X GET "https://demo-api.mobula.io/api/1/market/sparkline?asset=Tether&blockchain=ethereum&png=true"
```

### Query Response

Returns the 24h sparkline url for the given asset.

<img src="https://storage.googleapis.com/mobula-assets/sparklines-png/100011613/24h.png" />


## OpenAPI

````yaml get /1/market/sparkline
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula API
  description: >-
    Documentation of the Mobula API


    **Demo API**: The default server (demo-api.mobula.io) is a demo API with
    rate limits.

    For production use, please use api.mobula.io with an API key from
    https://admin.mobula.io
servers:
  - url: https://demo-api.mobula.io/api/
    description: Demo API (rate limited, for testing only)
  - url: https://api.mobula.io/api/
    description: Production API (requires API key)
security: []
tags:
  - name: V2 - Token
    description: Token details, price, security, ATH, and holder data
  - name: V2 - Market Data
    description: Market details, OHLCV history, and lighthouse metrics
  - name: V2 - Trades
    description: Token trades, enriched trades, and trade filters
  - name: V2 - Wallet
    description: Wallet positions, activity, trades, analysis, and labels
  - name: V2 - Assets
    description: Cross-chain asset details and price history
  - name: V2 - Swap
    description: Swap quoting and execution
  - name: V2 - Perps
    description: Perpetual futures quoting, execution, and positions
  - name: V2 - Bridge
    description: Cross-chain bridge quoting and intent status (Alpha Preview)
  - name: V2 - DeFi
    description: Bonding pools and pulse data
  - name: V2 - Search
    description: Universal fast search
  - name: V2 - Usage
    description: Per-key API and WebSocket usage history
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V2 - Prediction Markets
    description: >-
      Polymarket markets/events, wallet positions, and the full execution stack
      (auth, order build/submit/cancel, approvals, pUSD wrap/unwrap, deploy,
      deposit/withdraw, redeem). Alpha — see /api/2/pm/*.
  - name: V1 - Market Data
    description: Market prices, history, sparklines, pairs, and multi-data
  - name: V1 - Wallet
    description: Wallet portfolio, transactions, history, and NFTs
  - name: V1 - Token
    description: First buyers
  - name: V1 - Trades
    description: Market trades by pair
  - name: V1 - Metadata
    description: Token metadata, categories, and news
  - name: V1 - Assets
    description: List all assets
  - name: V1 - Search
    description: Search for assets, tokens, and pairs
  - name: V1 - DeFi
    description: Bonding pool pulse data
  - name: V1 - Blockchains
    description: Blockchain listings, pairs, and stats
  - name: V1 - Webhooks
    description: Webhook management
  - name: V1 - Feed
    description: Custom feed creation
paths:
  /1/market/sparkline:
    get:
      tags:
        - V1 - Market Data
      summary: Get market sparkline
      parameters:
        - schema:
            type: string
          required: false
          name: asset
          in: query
        - schema:
            type: string
          required: false
          name: blockchain
          in: query
        - schema:
            type: string
          required: false
          name: symbol
          in: query
        - schema:
            type: string
          required: false
          name: id
          in: query
        - schema:
            type: string
            default: 24h
          required: false
          name: timeFrame
          in: query
        - schema:
            type: string
            default: 'false'
          required: false
          name: png
          in: query
      responses:
        '200':
          description: Market sparkline response
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                required:
                  - url

````