# getCoinOhlc

**Identifier:** `coingecko_getCoinOhlc`

**Provider:** [CoinGecko](https://kirha.com/providers/coingecko.md)

Get OHLC (Open, High, Low, Close) data for a specific coin.

## Run it with the CLI

```bash
kirha tools run coingecko_getCoinOhlc \
  --input '{
    "coinId": "<coinId>"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "coingecko_getCoinOhlc",
  "input": {
    "coinId": "<coinId>"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "coinId": {
      "description": "Get from searchCoin tool",
      "type": "string"
    },
    "currency": {
      "default": "usd",
      "enum": [
        "eur",
        "usd",
        "gbp",
        "jpy",
        "aud",
        "sek",
        "btc",
        "eth",
        "cny",
        "chf"
      ],
      "type": "string"
    },
    "days": {
      "default": "7",
      "enum": [
        "1",
        "7",
        "14",
        "30",
        "90",
        "180",
        "365"
      ],
      "type": "string"
    }
  },
  "required": [
    "coinId"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "ohlcData": {
      "items": {
        "items": false,
        "maxItems": 5,
        "minItems": 5,
        "prefixItems": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "number"
          },
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "type": "array"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "ohlcData"
  ],
  "type": "object"
}
```

## Related tools

Other CoinGecko tools that this tool refers to, or that refer to it.

- [`searchCoin`](https://kirha.com/providers/coingecko/searchCoin.md)

-----

[All CoinGecko tools](https://kirha.com/providers/coingecko.md) · [< Back to tools list](https://kirha.com/tools.md)