---
title: "Candlestick Chart Image API — Stock & crypto OHLC | Imejis"
description: "Generate candlestick (OHLC) chart images for stocks and crypto — pass open/high/low/close data and render a fresh price chart on every API call. Start free."
url: "https://www.imejis.io/components/candlestick"
---

# Candlestick Chart Image API — Stock & crypto OHLC | Imejis

An OHLC candlestick chart for stock and crypto prices — bullish and bearish candles with wicks, rendered straight into your image from the open/high/low/close data.

## Use cases

- Daily market-recap images auto-posted to social
- Crypto price snapshots for newsletters and alerts
- Trading-journal and portfolio report graphics
- Watchlist cards with a fresh price chart per ticker

## Authoring notes

- candles is an array of { open, high, low, close } objects — one per period; labels align by index.
- Bullish candles (close ≥ open) use upColor, bearish use downColor; wicks span low→high.
- Use a wide box so many candles stay legible.

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `candles` | `object[]` | `[]` | OHLC data — one { open, high, low, close } object per period. |
| `labels` | `string[]` | `[]` | Period labels along the x-axis (e.g. dates). |
| `upColor` | `color` | `"#16a34a"` | Body color of bullish candles (close ≥ open). |
| `downColor` | `color` | `"#dc2626"` | Body color of bearish candles (close < open). |
| `wickColor` | `color` | — | Wick (high-low line) color; defaults to the candle body color. |
| `showAxis` | `boolean` | `true` | Show the price and date axes. |
| `showGrid` | `boolean` | `true` | Show horizontal grid lines. |
| `valueFormat` | `'number' \| 'compact' \| 'percent' \| 'currency'` | `"number"` | Price format (1,200 / 1.2K / 12% / $1,200). |
| `currencySymbol` | `string` | `"$"` | Currency symbol used with the 'currency' format. |
| `textColor` | `color` | `"#52514e"` | Axis label color. |
| `gridColor` | `color` | `"#e6e6e3"` | Grid line color. |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Sample design JSON

```json
{
  "title": "Candlestick sample",
  "description": "A weekly OHLC price chart",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-candlestick",
      "key": "ohlc",
      "type": "candlestick",
      "position": {
        "x": 120,
        "y": 50
      },
      "rotation": 0,
      "size": {
        "width": 560,
        "height": 320
      },
      "dynamic": true,
      "properties": {
        "candles": [
          {
            "open": 100,
            "high": 112,
            "low": 97,
            "close": 109
          },
          {
            "open": 109,
            "high": 114,
            "low": 105,
            "close": 106
          },
          {
            "open": 106,
            "high": 108,
            "low": 98,
            "close": 101
          },
          {
            "open": 101,
            "high": 118,
            "low": 100,
            "close": 116
          },
          {
            "open": 116,
            "high": 122,
            "low": 113,
            "close": 120
          },
          {
            "open": 120,
            "high": 121,
            "low": 110,
            "close": 112
          },
          {
            "open": 112,
            "high": 119,
            "low": 111,
            "close": 118
          }
        ],
        "labels": [
          "Mon",
          "Tue",
          "Wed",
          "Thu",
          "Fri",
          "Sat",
          "Sun"
        ],
        "upColor": "#16a34a",
        "downColor": "#dc2626",
        "showAxis": true,
        "showGrid": true,
        "valueFormat": "currency",
        "currencySymbol": "$",
        "opacity": 1
      }
    }
  ]
}
```

## Examples

### Weekly stock recap

Five trading days of OHLC with a dollar-formatted price axis.

API overrides that reproduce this example:

```json
{
  "ohlc.candles": [
    {
      "open": 182,
      "high": 188,
      "low": 180,
      "close": 186
    },
    {
      "open": 186,
      "high": 190,
      "low": 184,
      "close": 185
    },
    {
      "open": 185,
      "high": 187,
      "low": 178,
      "close": 179
    },
    {
      "open": 179,
      "high": 192,
      "low": 178,
      "close": 190
    },
    {
      "open": 190,
      "high": 196,
      "low": 188,
      "close": 194
    }
  ],
  "ohlc.labels": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri"
  ],
  "ohlc.valueFormat": "currency",
  "ohlc.currencySymbol": "$"
}
```

### Crypto downtrend week

A choppy week trending down, compact-formatted for a social card.

API overrides that reproduce this example:

```json
{
  "ohlc.candles": [
    {
      "open": 42000,
      "high": 43500,
      "low": 41200,
      "close": 41500
    },
    {
      "open": 41500,
      "high": 42000,
      "low": 39800,
      "close": 40100
    },
    {
      "open": 40100,
      "high": 40500,
      "low": 37600,
      "close": 38200
    },
    {
      "open": 38200,
      "high": 39000,
      "low": 37900,
      "close": 38800
    },
    {
      "open": 38800,
      "high": 39200,
      "low": 36500,
      "close": 36900
    }
  ],
  "ohlc.labels": [
    "1",
    "2",
    "3",
    "4",
    "5"
  ],
  "ohlc.valueFormat": "compact"
}
```

## API overrides

Push a fresh OHLC array per render with '<key>.candles' (or just '<key>'); labels and colors are overridable too.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "ohlc.candles": [
    {
      "open": 100,
      "high": 112,
      "low": 97,
      "close": 109
    },
    {
      "open": 109,
      "high": 114,
      "low": 105,
      "close": 106
    },
    {
      "open": 106,
      "high": 108,
      "low": 98,
      "close": 101
    },
    {
      "open": 101,
      "high": 118,
      "low": 100,
      "close": 116
    },
    {
      "open": 116,
      "high": 122,
      "low": 113,
      "close": 120
    },
    {
      "open": 120,
      "high": 121,
      "low": 110,
      "close": 112
    },
    {
      "open": 112,
      "high": 119,
      "low": 111,
      "close": 118
    }
  ],
  "ohlc.labels": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri",
    "Sat",
    "Sun"
  ],
  "ohlc.upColor": "#16a34a",
  "ohlc.downColor": "#dc2626",
  "ohlc.showAxis": true,
  "ohlc.showGrid": true,
  "ohlc.valueFormat": "currency",
  "ohlc.currencySymbol": "$",
  "ohlc.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "ohlc.candles": [
        {
            "open": 100,
            "high": 112,
            "low": 97,
            "close": 109
        },
        {
            "open": 109,
            "high": 114,
            "low": 105,
            "close": 106
        },
        {
            "open": 106,
            "high": 108,
            "low": 98,
            "close": 101
        },
        {
            "open": 101,
            "high": 118,
            "low": 100,
            "close": 116
        },
        {
            "open": 116,
            "high": 122,
            "low": 113,
            "close": 120
        },
        {
            "open": 120,
            "high": 121,
            "low": 110,
            "close": 112
        },
        {
            "open": 112,
            "high": 119,
            "low": 111,
            "close": 118
        }
    ],
    "ohlc.labels": [
        "Mon",
        "Tue",
        "Wed",
        "Thu",
        "Fri",
        "Sat",
        "Sun"
    ],
    "ohlc.upColor": "#16a34a",
    "ohlc.downColor": "#dc2626",
    "ohlc.showAxis": true,
    "ohlc.showGrid": true,
    "ohlc.valueFormat": "currency",
    "ohlc.currencySymbol": "$",
    "ohlc.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Frequently Asked Questions

### How do I pass the price data?

Send '<key>.candles' as an array of { open, high, low, close } objects — one per period — plus '<key>.labels' for the dates.

### Can I change the up/down colors?

Yes — upColor styles bullish candles (close ≥ open) and downColor bearish ones; wickColor overrides the high-low line color.

### Is volume supported?

The candles render the OHLC price bars; a separate chart or metric component can show volume alongside on the same canvas.

## Variants

- [Minimal](https://www.imejis.io/components/candlestick/minimal.md) — Axis and grid hidden — just the candles, for a clean inline price spark.
- [Dark](https://www.imejis.io/components/candlestick/dark.md) — Light candles on a dark canvas — the classic trading-terminal look.

All components: https://www.imejis.io/components.md
