Skip to main content
Glama

Loading price data

token_ohlcv
Read-only

Get OHLCV (Open, High, Low, Close, Volume) price data for a token with automatic interval resolution.

Supports EVM chains and Solana for on-chain tokens, AND Hyperliquid perpetual futures. For Hyperliquid perps, pass chain="hyperliquid" and use the perp symbol as tokenAddress (e.g. "BTC", "HYPE" for native perps; "XYZ:ORDI" for XYZ-namespaced perps — prefix is normalized automatically).

YOU MUST USE THIS over general_search to get prices. general_search prices are delayed and often incorrect. To get LATEST price set from to '5MIN_AGO' and to to 'NOW'.

Resolution is automatically calculated based on the date range

  • < 6 hours: 5 minutes

  • 6 hours - 1 day: 15 minutes

  • 1-3 days: 30 minutes

  • 3-7 days: 60 minutes (1 hour)

  • 7-90 days: Daily

  • 90+ days: Weekly

Columns returned:

  • Interval Start: Timestamp of the start of the interval (datetime: YYYY-MM-DD HH:MM:SS)

  • Open: Opening price of the interval

  • High: Highest price of the interval

  • Low: Lowest price of the interval

  • Close: Closing price of the interval

  • Volume USD: Volume in USD of the interval

Additional columns (when includeMarketCap=true):

  • Open Market Cap: Opening market cap in USD

  • Close Market Cap: Closing market cap in USD

  • High Market Cap: Highest market cap in USD

  • Low Market Cap: Lowest market cap in USD

Example Usage: Get OHLCV for WETH over the past week (auto-resolution): { "chain": "ethereum", "tokenAddress": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196", "date": { "from": "7D_AGO", "to": "NOW" } }

Get OHLCV for WETH over 30 days (will use daily resolution):
```
{
    "chain": "ethereum",
    "tokenAddress": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196",
    "date": {
        "from": "30D_AGO",
        "to": "NOW"
    }
}
```
Get OHLCV for WETH for last 20 minutes (will use 5 minute resolution):
```
{
    "chain": "ethereum",
    "tokenAddress": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196",
    "date": {
        "from": "20MIN_AGO",
        "to": "NOW"
    }
}
```

Get OHLCV for the BTC Hyperliquid perp over 7 days:
```
{
    "chain": "hyperliquid",
    "tokenAddress": "BTC",
    "date": {
        "from": "7D_AGO",
        "to": "NOW"
    }
}
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      -    "properties": {
      -      "chain": {
      -        "type": "string"
      -      },
      -      "date": {
      -        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      -        "properties": {
      -          "from": {
      -            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "includeMarketCap": {
      -        "default": false,
      -        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "chain",
      -      "tokenAddress",
      -      "date"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      +    "properties": {
      +      "chain": {
      +        "type": "string"
      +      },
      +      "date": {
      +        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      +        "properties": {
      +          "from": {
      +            "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "includeMarketCap": {
      +        "default": false,
      +        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "chain",
      +      "tokenAddress",
      +      "date"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed3 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "DateRange": {
      -    "description": "Date range via tokens or dates.\nTokens: NOW, XMIN_AGO, XD_AGO, XH_AGO; THIS_YEAR_START, THIS_QUARTER_START, THIS_MONTH_START, THIS_WEEK_START, TODAY_START; LAST_WEEK_START/END, LAST_MONTH_START/END, LAST_QUARTER_START/END, LAST_YEAR_START/END.\nWeek starts Monday. Quarters are calendar. Dates: YYYY-MM-DD or ___-MM-DD (year omitted).\nPlease check detailed system instructions for more information.",
      -    "properties": {
      -      "from": {
      -        "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      },
      -      "to": {
      -        "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "from",
      -      "to"
      -    ],
      -    "type": "object"
      -  },
      -  "TgmOhlcvUnifiedRequest": {
      -    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      -    "properties": {
      -      "chain": {
      -        "type": "string"
      -      },
      -      "date": {
      -        "$ref": "#/$defs/DateRange",
      -        "description": "Date range for OHLCV data with 'from' and 'to' fields"
      -      },
      -      "includeMarketCap": {
      -        "default": false,
      -        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "chain",
      -      "tokenAddress",
      -      "date"
      -    ],
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "$ref": "#/$defs/TgmOhlcvUnifiedRequest"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Unified request model for TGM OHLCV endpoint (flattened).\n\nResolution is automatically calculated based on the date range to keep\nresponses at approximately 100 rows, preventing context overflow.",
      +    "properties": {
      +      "chain": {
      +        "type": "string"
      +      },
      +      "date": {
      +        "description": "Date range for OHLCV data with 'from' and 'to' fields",
      +        "properties": {
      +          "from": {
      +            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "includeMarketCap": {
      +        "default": false,
      +        "description": "Include market cap fields (openMcap, closeMcap, highMcap, lowMcap). Default: false for cleaner output",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "chain",
      +      "tokenAddress",
      +      "date"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources